diff options
author | halliwell <halliwell@chromium.org> | 2016-03-04 16:33:04 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-05 00:34:34 +0000 |
commit | a6d32d34472ff1f70298a8a3d56602d4e25d2174 (patch) | |
tree | 64b3ff8f961055fe4808f75fc5c14aa6dba5d689 | |
parent | 890a0f656b932681ffa69d6f702b4dda676cf7bf (diff) | |
download | chromium_src-a6d32d34472ff1f70298a8a3d56602d4e25d2174.zip chromium_src-a6d32d34472ff1f70298a8a3d56602d4e25d2174.tar.gz chromium_src-a6d32d34472ff1f70298a8a3d56602d4e25d2174.tar.bz2 |
[Chromecast] Use cast ozone platforms for audio builds
This eliminates need for disable_display logic in a few places:
* logic for when to build Cast Ozone
* logic for --ozone-platform switches
Cast Ozone recently had headless mode added based on --disable-gpu
switch. Rather than require all audio builds, tests etc to use this
switch, just enable headless mode for DISABLE_DISPLAY builds.
BUG=internal b/27268814
Review URL: https://codereview.chromium.org/1739353002
Cr-Commit-Position: refs/heads/master@{#379413}
-rw-r--r-- | build/common.gypi | 27 | ||||
-rw-r--r-- | ui/ozone/ozone.gni | 26 | ||||
-rw-r--r-- | ui/ozone/platform/cast/BUILD.gn | 4 | ||||
-rw-r--r-- | ui/ozone/platform/cast/cast.gypi | 5 | ||||
-rw-r--r-- | ui/ozone/platform/cast/ozone_platform_cast.cc | 9 |
5 files changed, 38 insertions, 33 deletions
diff --git a/build/common.gypi b/build/common.gypi index 5265f00..4b337f9 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -2388,24 +2388,17 @@ 'ozone_platform_headless%': 1, 'conditions': [ ['chromecast==1', { + 'ozone_platform_cast%': 1, 'conditions': [ - ['disable_display==0', { - # Enable the Cast ozone platform on all A/V Cast builds. - 'ozone_platform_cast%': 1, - - # For desktop Chromecast builds, override the default "headless" - # platform with --ozone-platform=egltest - # TODO(slan|halliwell): Make the default platform "cast" on - # desktop too. - 'conditions': [ - ['is_cast_desktop_build==1', { - 'ozone_platform_egltest%': 1, - 'ozone_platform_ozonex%': 1, - }, { - # On device builds, enable "cast" as the default platform. - 'ozone_platform%': 'cast', - }], - ], + # For desktop non-audio Chromecast builds, run with + # --ozone-platform=egltest + # TODO(slan|halliwell): Make the default platform "cast" on + # desktop non-audio builds too. + ['is_cast_desktop_build==1 and disable_display==0', { + 'ozone_platform_egltest%': 1, + 'ozone_platform_ozonex%': 1, + }, { + 'ozone_platform%': 'cast', }], ], }, { # chromecast!=1 diff --git a/ui/ozone/ozone.gni b/ui/ozone/ozone.gni index 31e6dbf..2287c1e 100644 --- a/ui/ozone/ozone.gni +++ b/ui/ozone/ozone.gni @@ -37,22 +37,18 @@ declare_args() { ozone_platform_headless = true if (is_chromecast) { - if (!disable_display) { - # Enable the Cast ozone platform on all A/V Cast builds. - ozone_platform_cast = true + # Enable the Cast ozone platform on all A/V Cast builds. + ozone_platform_cast = true - # For desktop Chromecast builds, override the default "headless" - # platform with --ozone-platform=egltest - # TODO(halliwell): Create a libcast_graphics implementation for desktop - # using X11, and disable these two platforms. "cast" platform should be - # the default on every A/V build. - if (is_cast_desktop_build) { - ozone_platform_egltest = true - ozone_platform_ozonex = true - } else { - # On device builds, enable "cast" as the default platform. - ozone_platform = "cast" - } + # For visual desktop Chromecast builds, override the default "headless" + # platform with --ozone-platform=egltest + # TODO(halliwell): Create a libcast_graphics implementation for desktop + # using X11, and disable these two platforms. + if (is_cast_desktop_build && !disable_display) { + ozone_platform_egltest = true + ozone_platform_ozonex = true + } else { + ozone_platform = "cast" } } else if (is_chromeos) { ozone_platform_gbm = true diff --git a/ui/ozone/platform/cast/BUILD.gn b/ui/ozone/platform/cast/BUILD.gn index 0a548e4..53de77f 100644 --- a/ui/ozone/platform/cast/BUILD.gn +++ b/ui/ozone/platform/cast/BUILD.gn @@ -37,6 +37,10 @@ source_set("cast") { # do not want to statically link against EGL library. libs = [ "dl" ] + if (disable_display) { + defines = [ "DISABLE_DISPLAY" ] + } + deps = [ "//base", "//chromecast/graphics:libcast_graphics_1.0", diff --git a/ui/ozone/platform/cast/cast.gypi b/ui/ozone/platform/cast/cast.gypi index ce3a62d..ae875b4 100644 --- a/ui/ozone/platform/cast/cast.gypi +++ b/ui/ozone/platform/cast/cast.gypi @@ -30,6 +30,11 @@ 'include_dirs': [ '<(DEPTH)/third_party/khronos', ], + 'conditions': [ + ['disable_display==1', { + 'defines': ['DISABLE_DISPLAY'], + }], + ], 'sources': [ 'client_native_pixmap_factory_cast.cc', diff --git a/ui/ozone/platform/cast/ozone_platform_cast.cc b/ui/ozone/platform/cast/ozone_platform_cast.cc index 5091c93..75e05c3 100644 --- a/ui/ozone/platform/cast/ozone_platform_cast.cc +++ b/ui/ozone/platform/cast/ozone_platform_cast.cc @@ -85,8 +85,15 @@ class OzonePlatformCast : public OzonePlatform { gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); // Enable dummy software rendering support if GPU process disabled + // or if we're an audio-only build. // Note: switch is kDisableGpu from content/public/common/content_switches.h - if (base::CommandLine::ForCurrentProcess()->HasSwitch("disable-gpu")) + bool enable_dummy_software_rendering = true; +#if !defined(DISABLE_DISPLAY) + enable_dummy_software_rendering = + base::CommandLine::ForCurrentProcess()->HasSwitch("disable-gpu"); +#endif + + if (enable_dummy_software_rendering) surface_factory_.reset(new SurfaceFactoryCast()); } void InitializeGPU() override { |