Enable DirectComposition by default. (issue 1578453003 by jbauman@chromium.org)

519 views
Skip to first unread message

jba...@chromium.org

unread,
Jan 12, 2016, 3:48:12 PM1/12/16
to k...@chromium.org, chromium...@chromium.org, kalyan.k...@intel.com, ozone-...@chromium.org
Reviewers: Ken Russell
CL: https://codereview.chromium.org/1578453003/

Description:
Enable DirectComposition by default.

Chrome will now use DirectComposition where supported (Win8+ with d3d11
rendering). --disable-direct-composition can be specified to disable it,
and a
disable_direct_composition driver bug workaround type has been added.

BUG=524838

Base URL: https://chromium.googlesource.com/chromium/src.git@master

Affected files (+20, -15 lines):
M content/browser/gpu/gpu_data_manager_impl_private.cc
M gpu/config/gpu_driver_bug_workaround_type.h
M ui/gl/gl_surface_egl.cc
M ui/gl/gl_switches.h
M ui/gl/gl_switches.cc


Index: content/browser/gpu/gpu_data_manager_impl_private.cc
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc
b/content/browser/gpu/gpu_data_manager_impl_private.cc
index
bb8e0337f57c2a20f0e9ca5e00961204f1f58e62..5a639c87381726c4ab536c9ed2d045abd7babdf2
100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -659,6 +659,9 @@ void GpuDataManagerImplPrivate::AppendGpuCommandLine(
switches::kSwiftShaderPath);
if (gpu_driver_bugs_.find(gpu::DISABLE_D3D11) != gpu_driver_bugs_.end())
command_line->AppendSwitch(switches::kDisableD3D11);
+ if (gpu_driver_bugs_.find(gpu::DISABLE_DIRECT_COMPOSITION) !=
+ gpu_driver_bugs_.end())
+ command_line->AppendSwitch(switches::kDisableDirectComposition);
if (use_swiftshader_) {
command_line->AppendSwitchASCII(switches::kUseGL, "swiftshader");
if (swiftshader_path.empty())
Index: gpu/config/gpu_driver_bug_workaround_type.h
diff --git a/gpu/config/gpu_driver_bug_workaround_type.h
b/gpu/config/gpu_driver_bug_workaround_type.h
index
864627c44bafe61f0b23867cfebaba9362bac203..b861d9100535dda5a04cd1a1cb796fdffa4d2c0f
100644
--- a/gpu/config/gpu_driver_bug_workaround_type.h
+++ b/gpu/config/gpu_driver_bug_workaround_type.h
@@ -148,6 +148,8 @@
unbind_egl_context_to_flush_driver_caches) \
GPU_OP(SET_ZERO_LEVEL_BEFORE_GENERATING_MIPMAP, \
set_zero_level_before_generating_mipmap) \
+ GPU_OP(DISABLE_DIRECT_COMPOSITION, \
+ disable_direct_composition) \

namespace gpu {

Index: ui/gl/gl_surface_egl.cc
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index
f748cfcc887978ae79d0a6dcbb212ffb41fb5af8..79a2cd38ed70b9a01f3c0ad27c2f80e12a33c284
100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -392,8 +392,8 @@ bool GLSurfaceEGL::InitializeOneOff() {
g_use_direct_composition =
HasEGLExtension("EGL_ANGLE_direct_composition") &&
HasEGLExtension("EGL_ANGLE_flexible_surface_compatibility") &&
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kUseDirectComposition);
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableDirectComposition);

// TODO(oet...@nvidia.com): Surfaceless is disabled on Android as a
temporary
// workaround, since code written for Android WebView takes different
paths
Index: ui/gl/gl_switches.cc
diff --git a/ui/gl/gl_switches.cc b/ui/gl/gl_switches.cc
index
5327dd5c0ed08a7ff4b15cfafebc8b16eb9c98a8..b4f26257efa348c33900a083b56898ec60b857fd
100644
--- a/ui/gl/gl_switches.cc
+++ b/ui/gl/gl_switches.cc
@@ -66,8 +66,8 @@ const char kSwiftShaderPath[]
= "swiftshader-path";
// context will never be lost in any situations, say, a GPU reset.
const char kGpuNoContextLost[] = "gpu-no-context-lost";

-// Turns on the use of DirectComposition to draw to the screen.
-const char kUseDirectComposition[] = "use-direct-composition";
+// Disables the use of DirectComposition to draw to the screen.
+const char kDisableDirectComposition[] = "disable-direct-composition";

// Indicates whether the dual GPU switching is supported or not.
const char kSupportsDualGpus[] = "supports-dual-gpus";
@@ -97,16 +97,16 @@ const char kDisableGLExtensions[]
= "disable-gl-extensions";
// GpuProcessHost to the GPU Process. Add your switch to this list if you
need
// to read it in the GPU process, else don't add it.
const char* kGLSwitchesCopiedFromGpuProcessHost[] = {
- kDisableGpuVsync,
- kDisableD3D11,
- kEnableGPUServiceLogging,
- kEnableGPUServiceTracing,
- kEnableUnsafeES3APIs,
- kGpuNoContextLost,
- kDisableGLDrawingForTests,
- kOverrideUseGLWithOSMesaForTests,
- kUseANGLE,
- kUseDirectComposition,
+ kDisableGpuVsync,
+ kDisableD3D11,
+ kEnableGPUServiceLogging,
+ kEnableGPUServiceTracing,
+ kEnableUnsafeES3APIs,
+ kGpuNoContextLost,
+ kDisableGLDrawingForTests,
+ kOverrideUseGLWithOSMesaForTests,
+ kUseANGLE,
+ kDisableDirectComposition,
};
const int kGLSwitchesCopiedFromGpuProcessHostNumSwitches =
arraysize(kGLSwitchesCopiedFromGpuProcessHost);
Index: ui/gl/gl_switches.h
diff --git a/ui/gl/gl_switches.h b/ui/gl/gl_switches.h
index
ca317a2fb61982a5cdbcad7ba88664d1e89f428c..3c1eff74346e9d8417b08a8599d91214678d18d0
100644
--- a/ui/gl/gl_switches.h
+++ b/ui/gl/gl_switches.h
@@ -35,7 +35,7 @@ GL_EXPORT extern const char kDisableGpuVsync[];
GL_EXPORT extern const char kEnableGPUServiceLogging[];
GL_EXPORT extern const char kEnableGPUServiceTracing[];
GL_EXPORT extern const char kGpuNoContextLost[];
-GL_EXPORT extern const char kUseDirectComposition[];
+GL_EXPORT extern const char kDisableDirectComposition[];

GL_EXPORT extern const char kSupportsDualGpus[];



k...@chromium.org

unread,
Jan 12, 2016, 4:16:51 PM1/12/16
to jba...@chromium.org, chromium...@chromium.org, kalyan.k...@intel.com, ozone-...@chromium.org
If you think this is ready to ship, LGTM.


https://codereview.chromium.org/1578453003/

commit-bot@chromium.org via codereview.chromium.org

unread,
Jan 13, 2016, 3:08:47 PM1/13/16
to jba...@chromium.org, k...@chromium.org, commi...@chromium.org, chromium...@chromium.org, kalyan.k...@intel.com, ozone-...@chromium.org

commit-bot@chromium.org via codereview.chromium.org

unread,
Jan 13, 2016, 6:28:43 PM1/13/16
to jba...@chromium.org, k...@chromium.org, commi...@chromium.org, chromium...@chromium.org, kalyan.k...@intel.com, ozone-...@chromium.org
Try jobs failed on following builders:
linux_chromium_compile_dbg_ng on tryserver.chromium.linux (JOB_TIMED_OUT,
no
build URL)

https://codereview.chromium.org/1578453003/

commit-bot@chromium.org via codereview.chromium.org

unread,
Jan 13, 2016, 7:26:03 PM1/13/16
to jba...@chromium.org, k...@chromium.org, commi...@chromium.org, chromium...@chromium.org, kalyan.k...@intel.com, ozone-...@chromium.org

commit-bot@chromium.org via codereview.chromium.org

unread,
Jan 13, 2016, 9:39:52 PM1/13/16
to jba...@chromium.org, k...@chromium.org, commi...@chromium.org, chromium...@chromium.org, kalyan.k...@intel.com, ozone-...@chromium.org
Committed patchset #2 (id:20001)

https://codereview.chromium.org/1578453003/

commit-bot@chromium.org via codereview.chromium.org

unread,
Jan 13, 2016, 9:42:10 PM1/13/16
to jba...@chromium.org, k...@chromium.org, commi...@chromium.org, chromium...@chromium.org, kalyan.k...@intel.com, ozone-...@chromium.org
Patchset 2 (id:??) landed as
https://crrev.com/88b36341a5868273eeeb08d42047721e00f495d6
Cr-Commit-Position: refs/heads/master@{#369289}

https://codereview.chromium.org/1578453003/

z...@chromium.org

unread,
Jan 14, 2016, 1:38:47 PM1/14/16
to jba...@chromium.org, k...@chromium.org, chromium...@chromium.org, kalyan.k...@intel.com, ozone-...@chromium.org
A revert of this CL (patchset #2 id:20001) has been created in
https://codereview.chromium.org/1573913009/ by z...@chromium.org.

The reason for reverting is: This seems to break gles2_conform_test on win8
bots.

https://codereview.chromium.org/1578453003/
Reply all
Reply to author
Forward
0 new messages