Skip to content

Commit

Permalink
Clean up the use of USE_X11 and OS_CHROMEOS in gpu/
Browse files Browse the repository at this point in the history
Now that we ChromeOS has switched over to ozone, the combination
USE_X11 && !OS_CHROMEOS is redundant.

This is a driven by CL that cleans it up in gpu/.

BUG=750642

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I1e190ba086dd37f35c96c6f476383d99bbe41003
Reviewed-on: https://chromium-review.googlesource.com/629107
Reviewed-by: kylechar <kylechar@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496962}
  • Loading branch information
tonikitoo authored and Commit Bot committed Aug 24, 2017
1 parent 3192c54 commit 5b4d98e
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions gpu/config/gpu_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ GPUInfo::GPUInfo()
dx_diagnostics_info_state(kCollectInfoNone),
#endif
jpeg_decode_accelerator_supported(false)
#if defined(USE_X11) && !defined(OS_CHROMEOS)
#if defined(USE_X11)
,
system_visual(0),
rgba_visual(0)
Expand Down Expand Up @@ -146,7 +146,7 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
VideoEncodeAcceleratorSupportedProfiles
video_encode_accelerator_supported_profiles;
bool jpeg_decode_accelerator_supported;
#if defined(USE_X11) && !defined(OS_CHROMEOS)
#if defined(USE_X11)
VisualID system_visual;
VisualID rgba_visual;
#endif
Expand Down Expand Up @@ -213,7 +213,7 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
EnumerateVideoEncodeAcceleratorSupportedProfile(profile, enumerator);
enumerator->AddBool("jpegDecodeAcceleratorSupported",
jpeg_decode_accelerator_supported);
#if defined(USE_X11) && !defined(OS_CHROMEOS)
#if defined(USE_X11)
enumerator->AddInt64("systemVisual", system_visual);
enumerator->AddInt64("rgbaVisual", rgba_visual);
#endif
Expand Down
4 changes: 2 additions & 2 deletions gpu/config/gpu_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "gpu/gpu_export.h"
#include "ui/gfx/geometry/size.h"

#if defined(USE_X11) && !defined(OS_CHROMEOS)
#if defined(USE_X11)
typedef unsigned long VisualID;
#endif

Expand Down Expand Up @@ -247,7 +247,7 @@ struct GPU_EXPORT GPUInfo {
video_encode_accelerator_supported_profiles;
bool jpeg_decode_accelerator_supported;

#if defined(USE_X11) && !defined(OS_CHROMEOS)
#if defined(USE_X11)
VisualID system_visual;
VisualID rgba_visual;
#endif
Expand Down
6 changes: 3 additions & 3 deletions gpu/config/gpu_info_collector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "ui/gl/gl_version_info.h"
#include "ui/gl/init/gl_factory.h"

#if defined(USE_X11) && !defined(OS_CHROMEOS)
#if defined(USE_X11)
#include "ui/gl/gl_visual_picker_glx.h"
#endif

Expand Down Expand Up @@ -178,7 +178,7 @@ CollectInfoResult CollectGraphicsInfoGL(GPUInfo* gpu_info) {
reinterpret_cast<GLint*>(&gpu_info->gl_reset_notification_strategy));
}

#if defined(USE_X11) && !defined(OS_CHROMEOS)
#if defined(USE_X11)
if (gl::GetGLImplementation() == gl::kGLImplementationDesktopGL) {
gl::GLVisualPickerGLX* visual_picker = gl::GLVisualPickerGLX::GetInstance();
gpu_info->system_visual = visual_picker->system_visual().visualid;
Expand Down Expand Up @@ -242,7 +242,7 @@ void MergeGPUInfoGL(GPUInfo* basic_gpu_info,
basic_gpu_info->jpeg_decode_accelerator_supported =
context_gpu_info.jpeg_decode_accelerator_supported;

#if defined(USE_X11) && !defined(OS_CHROMEOS)
#if defined(USE_X11)
basic_gpu_info->system_visual = context_gpu_info.system_visual;
basic_gpu_info->rgba_visual = context_gpu_info.rgba_visual;
#endif
Expand Down
2 changes: 1 addition & 1 deletion gpu/ipc/common/gpu_info_struct_traits.cc
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ bool StructTraits<gpu::mojom::GpuInfoDataView, gpu::GPUInfo>::Read(
out->jpeg_decode_accelerator_supported =
data.jpeg_decode_accelerator_supported();

#if defined(USE_X11) && !defined(OS_CHROMEOS)
#if defined(USE_X11)
out->system_visual = data.system_visual();
out->rgba_visual = data.rgba_visual();
#endif
Expand Down
4 changes: 2 additions & 2 deletions gpu/ipc/common/gpu_info_struct_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,14 @@ struct StructTraits<gpu::mojom::GpuInfoDataView, gpu::GPUInfo> {
}

static uint64_t system_visual(const gpu::GPUInfo& input) {
#if defined(USE_X11) && !defined(OS_CHROMEOS)
#if defined(USE_X11)
return input.system_visual;
#endif
return 0;
}

static uint64_t rgba_visual(const gpu::GPUInfo& input) {
#if defined(USE_X11) && !defined(OS_CHROMEOS)
#if defined(USE_X11)
return input.rgba_visual;
#endif
return 0;
Expand Down
2 changes: 1 addition & 1 deletion gpu/ipc/common/gpu_param_traits_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ IPC_STRUCT_TRAITS_BEGIN(gpu::GPUInfo)
IPC_STRUCT_TRAITS_MEMBER(video_decode_accelerator_capabilities)
IPC_STRUCT_TRAITS_MEMBER(video_encode_accelerator_supported_profiles)
IPC_STRUCT_TRAITS_MEMBER(jpeg_decode_accelerator_supported)
#if defined(USE_X11) && !defined(OS_CHROMEOS)
#if defined(USE_X11)
IPC_STRUCT_TRAITS_MEMBER(system_visual)
IPC_STRUCT_TRAITS_MEMBER(rgba_visual)
#endif
Expand Down
6 changes: 3 additions & 3 deletions gpu/ipc/common/struct_traits_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ TEST_F(StructTraitsTest, GpuInfo) {
const std::vector<gpu::VideoEncodeAcceleratorSupportedProfile>
video_encode_accelerator_supported_profiles;
const bool jpeg_decode_accelerator_supported = true;
#if defined(USE_X11) && !defined(OS_CHROMEOS)
#if defined(USE_X11)
const VisualID system_visual = 0x1234;
const VisualID rgba_visual = 0x5678;
#endif
Expand Down Expand Up @@ -213,7 +213,7 @@ TEST_F(StructTraitsTest, GpuInfo) {
input.video_encode_accelerator_supported_profiles =
video_encode_accelerator_supported_profiles;
input.jpeg_decode_accelerator_supported = jpeg_decode_accelerator_supported;
#if defined(USE_X11) && !defined(OS_CHROMEOS)
#if defined(USE_X11)
input.system_visual = system_visual;
input.rgba_visual = rgba_visual;
#endif
Expand Down Expand Up @@ -288,7 +288,7 @@ TEST_F(StructTraitsTest, GpuInfo) {
video_decode_accelerator_capabilities.supported_profiles.size());
EXPECT_EQ(output.video_encode_accelerator_supported_profiles.size(),
video_encode_accelerator_supported_profiles.size());
#if defined(USE_X11) && !defined(OS_CHROMEOS)
#if defined(USE_X11)
EXPECT_EQ(system_visual, output.system_visual);
EXPECT_EQ(rgba_visual, output.rgba_visual);
#endif
Expand Down
2 changes: 1 addition & 1 deletion gpu/tools/compositor_model_bench/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import("//build/config/ui.gni")

if (is_linux && !is_chromeos && current_cpu != "arm" && use_x11) {
if (is_linux && use_x11 && current_cpu != "arm") {
executable("compositor_model_bench") {
sources = [
"compositor_model_bench.cc",
Expand Down

0 comments on commit 5b4d98e

Please sign in to comment.