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

Issue 2193293004: cc: Make LayerTreeTests use a DelegatingRenderer and Display. (Closed)

Created:
4 years, 4 months ago by danakj
Modified:
4 years, 4 months ago
CC:
cc-bugs_chromium.org, chromium-reviews, darin-cc_chromium.org, jam, mlamouri+watch-content_chromium.org, piman+watch_chromium.org, piman, rjkroege
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

cc: Make LayerTreeTests use a DelegatingRenderer and Display. Wherein we rewrite a few thousand cc unit_tests to not use a DirectRenderer in LayerTreeHostImpl so that we can remove that possibility from the codebase. Currently some LayerTreeTests use a DirectRenderer in the LayerTreeHostImpl, which is the last case of this occuring. Instead give all LayerTreeTests a TestDelegatingOutputSurface (which means a DelegatingRenderer in LayerTreeHostImpl). TestDelegatingOutputSurface delegates drawing to a DirectRenderer via Display, which matches how things "really work" now. This means SwapBuffers hooks become async from operations on LayerTreeHostImpl, so we introduce 3 new hooks for tests: - DisplayReceivedCompositorFrameOnThread. - DisplayWillDrawAndSwapOnThread. - DisplayDidDrawAndSwapOnThread. None of these receive a LayerTreeHostImpl* since they are async from it and so using its state from the hook would be racey. These hooks come from the TestDelegatingOutputSurface instead of from the LayerTreeHostImpl. LayerTreeTest gets two methods that can be overridden to control the output surface: - CreateDelegatingOutputSurface makes a TestDelegatingOutputSurface so tests can control the arguments passed to its constructor, or the ContextProviders given to it. - CreateDisplayOutputSurface makes an OutputSurface subclass that will be owned by the Display and used by the DirectRenderer. This allows tests to control which ContextProvider it uses, and what subclass of OutputSurface to use, to allow mocking out things as desired. Now also with fixes for cc_perftests: The TestDelegatingOutputSurface was not honoring disable_display_vsync so they were not saturating the thread, making them take much longer than 5s to do 5s of thread work, and they'd time out. Also the TetureMailbox doesn't get released to the main thread immediately after commit anymore, as you need to wait for the mailbox to be given to the Display (DisplayReceivedCompositorFrame is the hook for that fwiw). So we wait for the mailbox to actually return before ending the test to avoid a crash. R=enne BUG=606056 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel Committed: https://crrev.com/cae1058e62b7960796709512c4e1e650b6389c0f Committed: https://crrev.com/014316e35eb9a90a024302daa3a6c3ca3983a8bd Cr-Original-Commit-Position: refs/heads/master@{#409270} Cr-Commit-Position: refs/heads/master@{#409845}

Patch Set 1 #

Patch Set 2 : display-layertreetest: self-nits #

Total comments: 1

Patch Set 3 : display-layertreetest: layouttests #

Patch Set 4 : display-layertreetest: android-and-contenttests #

Patch Set 5 : display-layertreetest: android-missing-move-for-compile #

Patch Set 6 : display-layertreetest: windows-pixeltests-default-renderer-settings #

Total comments: 4

Patch Set 7 : display-layertreetest: rebase #

Patch Set 8 : display-layertreetest: withperftestsfix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+731 lines, -583 lines) Patch
M android_webview/browser/surfaces_instance.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M cc/BUILD.gn View 1 chunk +0 lines, -2 lines 0 comments Download
M cc/cc_tests.gyp View 1 chunk +0 lines, -2 lines 0 comments Download
M cc/layers/surface_layer_unittest.cc View 3 chunks +3 lines, -13 lines 0 comments Download
M cc/layers/texture_layer_unittest.cc View 1 5 chunks +30 lines, -24 lines 0 comments Download
M cc/output/delegating_renderer_unittest.cc View 3 chunks +18 lines, -49 lines 0 comments Download
M cc/output/renderer_unittest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M cc/surfaces/display.h View 2 chunks +3 lines, -2 lines 0 comments Download
M cc/surfaces/display.cc View 2 chunks +3 lines, -0 lines 0 comments Download
M cc/surfaces/display_client.h View 2 chunks +5 lines, -0 lines 0 comments Download
M cc/surfaces/display_unittest.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M cc/surfaces/surface_display_output_surface.h View 1 chunk +4 lines, -1 line 0 comments Download
M cc/surfaces/surface_display_output_surface.cc View 2 chunks +14 lines, -2 lines 0 comments Download
D cc/test/failure_output_surface.h View 1 chunk +0 lines, -25 lines 0 comments Download
D cc/test/failure_output_surface.cc View 1 chunk +0 lines, -18 lines 0 comments Download
M cc/test/fake_output_surface.h View 1 chunk +2 lines, -3 lines 0 comments Download
M cc/test/layer_tree_pixel_test.h View 1 1 chunk +5 lines, -2 lines 0 comments Download
M cc/test/layer_tree_pixel_test.cc View 1 2 3 4 5 2 chunks +35 lines, -26 lines 0 comments Download
M cc/test/layer_tree_test.h View 1 7 chunks +32 lines, -17 lines 0 comments Download
M cc/test/layer_tree_test.cc View 1 10 chunks +68 lines, -59 lines 0 comments Download
M cc/test/test_context_provider.h View 3 chunks +7 lines, -4 lines 0 comments Download
M cc/test/test_context_provider.cc View 4 chunks +27 lines, -9 lines 0 comments Download
M cc/test/test_delegating_output_surface.h View 1 4 chunks +23 lines, -3 lines 0 comments Download
M cc/test/test_delegating_output_surface.cc View 1 2 3 4 5 6 7 7 chunks +33 lines, -8 lines 0 comments Download
M cc/test/test_hooks.h View 3 chunks +17 lines, -7 lines 0 comments Download
M cc/test/test_web_graphics_context_3d.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host_impl_unittest.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M cc/trees/layer_tree_host_perftest.cc View 1 2 3 4 5 6 7 6 chunks +25 lines, -17 lines 0 comments Download
M cc/trees/layer_tree_host_unittest.cc View 1 2 3 4 5 6 20 chunks +154 lines, -134 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_context.cc View 1 11 chunks +48 lines, -43 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_copyrequest.cc View 10 chunks +123 lines, -96 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_damage.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/android/synchronous_compositor_output_surface.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/gpu/render_widget_compositor_unittest.cc View 1 2 3 2 chunks +15 lines, -11 lines 0 comments Download
M content/test/layouttest_support.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M services/ui/surfaces/display_compositor.h View 1 chunk +3 lines, -0 lines 0 comments Download
M services/ui/surfaces/display_compositor.cc View 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 65 (45 generated)
danakj
4 years, 4 months ago (2016-07-30 00:51:59 UTC) #4
danakj
https://codereview.chromium.org/2193293004/diff/20001/cc/trees/layer_tree_host_unittest.cc File cc/trees/layer_tree_host_unittest.cc (right): https://codereview.chromium.org/2193293004/diff/20001/cc/trees/layer_tree_host_unittest.cc#newcode2645 cc/trees/layer_tree_host_unittest.cc:2645: class OnDrawOutputSurface : public TestDelegatingOutputSurface { This is the ...
4 years, 4 months ago (2016-07-30 00:54:24 UTC) #5
danakj
+fsamuel for mus
4 years, 4 months ago (2016-07-30 00:59:06 UTC) #7
danakj
+piman for trivial change in content/../layouttest_support
4 years, 4 months ago (2016-07-30 01:06:53 UTC) #15
danakj
+boliu for the webview bits (just extending the DisplayClient stubs)
4 years, 4 months ago (2016-07-30 01:47:57 UTC) #24
danakj
On 2016/07/30 01:47:57, danakj wrote: > +boliu for the webview bits (just extending the DisplayClient ...
4 years, 4 months ago (2016-07-30 01:48:45 UTC) #27
Fady Samuel
lgtm
4 years, 4 months ago (2016-07-30 01:51:14 UTC) #28
boliu
rs lgtm
4 years, 4 months ago (2016-08-01 16:18:04 UTC) #39
piman
lgtm
4 years, 4 months ago (2016-08-02 02:53:42 UTC) #40
enne (OOO)
https://codereview.chromium.org/2193293004/diff/120001/cc/surfaces/surface_display_output_surface.h File cc/surfaces/surface_display_output_surface.h (right): https://codereview.chromium.org/2193293004/diff/120001/cc/surfaces/surface_display_output_surface.h#newcode60 cc/surfaces/surface_display_output_surface.h:60: void DisplayDidDrawAndSwap() override; Also in a cut down in ...
4 years, 4 months ago (2016-08-02 17:23:41 UTC) #41
danakj
https://codereview.chromium.org/2193293004/diff/120001/cc/surfaces/surface_display_output_surface.h File cc/surfaces/surface_display_output_surface.h (right): https://codereview.chromium.org/2193293004/diff/120001/cc/surfaces/surface_display_output_surface.h#newcode60 cc/surfaces/surface_display_output_surface.h:60: void DisplayDidDrawAndSwap() override; On 2016/08/02 17:23:40, enne wrote: > ...
4 years, 4 months ago (2016-08-02 17:28:40 UTC) #42
enne (OOO)
Ok ok! I understand now why you need these. lgtm
4 years, 4 months ago (2016-08-02 17:50:41 UTC) #43
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/2193293004/120001
4 years, 4 months ago (2016-08-02 17:53:43 UTC) #46
commit-bot: I haz the power
Committed patchset #6 (id:120001)
4 years, 4 months ago (2016-08-02 19:27:07 UTC) #48
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/cae1058e62b7960796709512c4e1e650b6389c0f Cr-Commit-Position: refs/heads/master@{#409270}
4 years, 4 months ago (2016-08-02 19:28:52 UTC) #50
petrcermak
A revert of this CL (patchset #6 id:120001) has been created in https://codereview.chromium.org/2208693003/ by petrcermak@chromium.org. ...
4 years, 4 months ago (2016-08-04 09:33:13 UTC) #51
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/2193293004/160001
4 years, 4 months ago (2016-08-04 17:33:41 UTC) #58
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/2193293004/160001
4 years, 4 months ago (2016-08-04 17:35:03 UTC) #61
commit-bot: I haz the power
Committed patchset #8 (id:160001)
4 years, 4 months ago (2016-08-04 18:40:45 UTC) #63
commit-bot: I haz the power
4 years, 4 months ago (2016-08-04 18:42:36 UTC) #65
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/014316e35eb9a90a024302daa3a6c3ca3983a8bd
Cr-Commit-Position: refs/heads/master@{#409845}

Powered by Google App Engine
This is Rietveld 408576698