Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Issue 2743663006: Allow switching DirectCompositionSurfaceWin between drawing modes. (Closed)

Created:
3 years, 9 months ago by jbauman
Modified:
3 years, 9 months ago
Reviewers:
danakj, sunnyps, dcheng
CC:
chromium-reviews, piman+watch_chromium.org, cc-bugs_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow switching DirectCompositionSurfaceWin between drawing modes. There are two ways to put the main page content into a DirectComposition surface. IDXGISwapChain has the advantage that it can be put into an overlay, saving power, but updates to it don't happen in sync with updates to the layer tree. This results in weird-looking lag when scrolling and makes transitions between layer structures look bad. IDCompositionSurface does have its contents synced with tree updates, but can't be put in an overlay. This wastes power on pages with canvas or software-decoded video that update often but can't be put in independent layers. To get the best of both worlds, add a new SetEnableDCLayersCHROMIUM GL command that can switch the backbuffers between the two modes. It will be enabled when an overlay is promoted for the first time and is disabled 60 frames after the last frame where an overlay is used. This hysteresis helps prevent unnecessary switches, which are expensive because they require reallocating the buffer, redrawing the entire frame, and (when switching to IDXGISwapChains) waiting for the contents to finish rendering on the GPU before swapping. BUG=678800 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;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 Review-Url: https://codereview.chromium.org/2743663006 Cr-Commit-Position: refs/heads/master@{#458664} Committed: https://chromium.googlesource.com/chromium/src/+/456e9b8f3bf0301b3d026953f6d23d1d626a07e6

Patch Set 1 #

Patch Set 2 : improve #

Patch Set 3 : more changes #

Patch Set 4 : improve creation #

Patch Set 5 : fix release current in resize #

Total comments: 6

Patch Set 6 : post-review changes #

Total comments: 1

Patch Set 7 : remove const #

Total comments: 7

Patch Set 8 : more changes #

Patch Set 9 : change comments #

Patch Set 10 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+564 lines, -109 lines) Patch
M cc/output/direct_renderer.h View 1 2 3 4 5 6 7 2 chunks +9 lines, -2 lines 0 comments Download
M cc/output/direct_renderer.cc View 1 2 3 4 5 6 7 6 chunks +28 lines, -4 lines 0 comments Download
M cc/output/gl_renderer.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M cc/output/gl_renderer.cc View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M cc/output/gl_renderer_unittest.cc View 1 2 3 4 5 5 chunks +107 lines, -6 lines 0 comments Download
M cc/output/output_surface.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M cc/output/software_renderer.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M cc/output/software_renderer.cc View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M cc/test/test_web_graphics_context_3d.h View 1 chunk +2 lines, -2 lines 0 comments Download
M gpu/GLES2/gl2chromium_autogen.h View 1 chunk +1 line, -0 lines 0 comments Download
M gpu/command_buffer/build_gles2_cmd_buffer.py View 1 chunk +4 lines, -0 lines 0 comments Download
M gpu/command_buffer/client/gles2_c_lib_autogen.h View 2 chunks +7 lines, -0 lines 0 comments Download
M gpu/command_buffer/client/gles2_cmd_helper_autogen.h View 1 chunk +8 lines, -0 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation_autogen.h View 1 chunk +2 lines, -0 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation_impl_autogen.h View 1 chunk +8 lines, -0 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation_unittest_autogen.h View 1 chunk +11 lines, -0 lines 0 comments Download
M gpu/command_buffer/client/gles2_interface_autogen.h View 1 chunk +1 line, -0 lines 0 comments Download
M gpu/command_buffer/client/gles2_interface_stub_autogen.h View 1 chunk +1 line, -0 lines 0 comments Download
M gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h View 1 chunk +1 line, -0 lines 0 comments Download
M gpu/command_buffer/client/gles2_trace_implementation_autogen.h View 1 chunk +1 line, -0 lines 0 comments Download
M gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h View 1 chunk +5 lines, -0 lines 0 comments Download
M gpu/command_buffer/cmd_buffer_functions.txt View 1 chunk +3 lines, -0 lines 0 comments Download
M gpu/command_buffer/common/capabilities.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M gpu/command_buffer/common/gles2_cmd_format_autogen.h View 1 chunk +33 lines, -0 lines 0 comments Download
M gpu/command_buffer/common/gles2_cmd_format_test_autogen.h View 1 chunk +11 lines, -0 lines 0 comments Download
M gpu/command_buffer/common/gles2_cmd_ids_autogen.h View 1 chunk +2 lines, -1 line 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.cc View 1 2 3 4 5 6 7 8 9 7 chunks +26 lines, -8 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_autogen.h View 1 chunk +11 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototypes.h View 1 chunk +1 line, -0 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers_autogen.cc View 1 chunk +14 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_4_autogen.h View 1 chunk +9 lines, -0 lines 0 comments Download
M gpu/ipc/common/gpu_command_buffer_traits_multi.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M gpu/ipc/service/direct_composition_surface_win.h View 1 2 3 4 5 6 7 8 9 4 chunks +13 lines, -2 lines 0 comments Download
M gpu/ipc/service/direct_composition_surface_win.cc View 1 2 3 4 5 6 7 8 9 9 chunks +110 lines, -41 lines 0 comments Download
M gpu/ipc/service/direct_composition_surface_win_unittest.cc View 1 2 3 4 5 4 chunks +95 lines, -32 lines 0 comments Download
M ui/gl/gl_surface.h View 3 chunks +5 lines, -2 lines 0 comments Download
M ui/gl/gl_surface.cc View 4 chunks +12 lines, -3 lines 0 comments Download
M ui/gl/gl_surface_stub.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_surface_stub.cc View 1 chunk +1 line, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 66 (49 generated)
jbauman
3 years, 9 months ago (2017-03-14 21:28:21 UTC) #24
sunnyps
https://codereview.chromium.org/2743663006/diff/80001/cc/output/gl_renderer_unittest.cc File cc/output/gl_renderer_unittest.cc (right): https://codereview.chromium.org/2743663006/diff/80001/cc/output/gl_renderer_unittest.cc#newcode1910 cc/output/gl_renderer_unittest.cc:1910: explicit PartialSwapMockGLES2Interface(bool support_set_draw_rectangle) nit: support_dc_layers? https://codereview.chromium.org/2743663006/diff/80001/gpu/ipc/service/direct_composition_surface_win.cc File gpu/ipc/service/direct_composition_surface_win.cc (right): ...
3 years, 9 months ago (2017-03-20 23:38:57 UTC) #29
jbauman
PTAL. On 2017/03/20 23:38:57, sunnyps wrote: > https://codereview.chromium.org/2743663006/diff/80001/cc/output/gl_renderer_unittest.cc > File cc/output/gl_renderer_unittest.cc (right): > > https://codereview.chromium.org/2743663006/diff/80001/cc/output/gl_renderer_unittest.cc#newcode1910 ...
3 years, 9 months ago (2017-03-21 00:05:33 UTC) #32
sunnyps
lgtm % nit https://codereview.chromium.org/2743663006/diff/100001/gpu/ipc/service/direct_composition_surface_win.h File gpu/ipc/service/direct_composition_surface_win.h (right): https://codereview.chromium.org/2743663006/diff/100001/gpu/ipc/service/direct_composition_surface_win.h#newcode59 gpu/ipc/service/direct_composition_surface_win.h:59: const base::win::ScopedComPtr<IDXGISwapChain1> swap_chain() const { nit: ...
3 years, 9 months ago (2017-03-21 00:19:00 UTC) #33
jbauman
danakj@: cc/ OWNERS review dcheng@: gpu\ipc\common\gpu_command_buffer_traits_multi.h IPC review Thanks.
3 years, 9 months ago (2017-03-21 00:45:18 UTC) #37
dcheng
ipc lgtm i don't really know what to do about the name; the style guide ...
3 years, 9 months ago (2017-03-21 07:10:48 UTC) #40
danakj
https://codereview.chromium.org/2743663006/diff/120001/cc/output/direct_renderer.cc File cc/output/direct_renderer.cc (right): https://codereview.chromium.org/2743663006/diff/120001/cc/output/direct_renderer.cc#newcode29 cc/output/direct_renderer.cc:29: static gfx::Transform OrthoProjectionMatrix(float left, nit: whitespace after namespace { ...
3 years, 9 months ago (2017-03-21 15:54:05 UTC) #41
jbauman
On 2017/03/21 15:54:05, danakj wrote: > https://codereview.chromium.org/2743663006/diff/120001/cc/output/direct_renderer.cc > File cc/output/direct_renderer.cc (right): > > https://codereview.chromium.org/2743663006/diff/120001/cc/output/direct_renderer.cc#newcode29 > ...
3 years, 9 months ago (2017-03-21 20:37:44 UTC) #44
danakj
Oh! My bad about the chromecast thing. Looks like this comment needs update since the ...
3 years, 9 months ago (2017-03-21 21:36:12 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2743663006/160001
3 years, 9 months ago (2017-03-21 22:12:09 UTC) #50
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/344772)
3 years, 9 months ago (2017-03-21 23:12:43 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2743663006/160001
3 years, 9 months ago (2017-03-22 00:54:38 UTC) #54
commit-bot: I haz the power
Failed to apply patch for gpu/ipc/service/direct_composition_surface_win.cc: While running git apply --index -p1; error: patch failed: ...
3 years, 9 months ago (2017-03-22 01:46:40 UTC) #56
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2743663006/180001
3 years, 9 months ago (2017-03-22 01:56:21 UTC) #59
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/345111)
3 years, 9 months ago (2017-03-22 03:33:27 UTC) #61
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2743663006/180001
3 years, 9 months ago (2017-03-22 07:03:26 UTC) #63
commit-bot: I haz the power
3 years, 9 months ago (2017-03-22 07:26:07 UTC) #66
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as
https://chromium.googlesource.com/chromium/src/+/456e9b8f3bf0301b3d026953f6d2...

Powered by Google App Engine
This is Rietveld 408576698