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

Issue 26023004: aura: Allow delegated frames to be used by more than one impl layer. (Closed)

Created:
7 years, 2 months ago by danakj
Modified:
7 years, 2 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, yusukes+watch_chromium.org, Ian Vollick, jam, penghuang+watch_chromium.org, sievers+watch_chromium.org, jbauman+watch_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, kalyank, piman+watch_chromium.org, cc-bugs_chromium.org, James Su, danakj+watch_chromium.org, miu+watch_chromium.org
Visibility:
Public.

Description

aura: Allow delegated frames to be used by more than one impl layer. Delegated frames can be used by multiple impl layers within a single compositor if they are given to different DelegatedRendererLayers which each send the frame to their impl layer. Also, they can be given to different DelegatedRendererLayers that live in different compositors. So we need something that outlives any DelegatedRendererLayer and will receive returned resources from the impl side of multiple compositors and know when to release resoures back to the child compositor, and how many resources to release. This patch introduces two new classes: DelegatedFrameProvider. This class holds a delegated frame and notifies a single DelegatedRendererLayer (the latest one to attach to it) about new frames so that it can grab them and display them. If a new DelegatedRendererLayer steals a DelegatedFrameProvider it will receive notifications in the future and the first layer will stop updating. DelegatedFrameResourceCollection. This class holds resources and ref counts on them to keep track of how many refs are being used by compositor instances, and how many refs have been received from the child compositor. Once a resource is not in use anymore by any compositors, all references passed from the child compositor will be made available via TakeUnusedResourcesForChildCompositor(). Tests: LayerTreeHostDelegatedTestTwoImplLayers LayerTreeHostDelegatedTestRemoveAndAddToTree LayerTreeHostDelegatedTestRemoveAndChangeResources R=piman,alexst@chromium.org BUG=263069 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=227807

Patch Set 1 #

Patch Set 2 : frameprovider: add missing files #

Patch Set 3 : frameprovider: nits #

Total comments: 11

Patch Set 4 : frameprovider: more tests #

Total comments: 2

Patch Set 5 : frameprovider: refcounts #

Patch Set 6 : frameprovider: fixleak #

Total comments: 2

Patch Set 7 : frameprovider: friend class #

Total comments: 2

Patch Set 8 : frameprovider: mainthreadreference #

Patch Set 9 : frameprovider: fix compositor_unittests #

Patch Set 10 : frameprovider: more tests #

Patch Set 11 : frameprovider: android #

Patch Set 12 : frameprovider: android2 #

Patch Set 13 : frameprovider: android3 #

Patch Set 14 : frameprovider: android4 #

Patch Set 15 : frameprovider: android5 #

Patch Set 16 : frameprovider: android6 #

Patch Set 17 : frameprovider: android7 #

Patch Set 18 : frameprovider: android8 #

Patch Set 19 : frameprovider: rebase #

Total comments: 2

Patch Set 20 : frameprovider: are_layers_attached checks #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1678 lines, -415 lines) Patch
M cc/cc.gyp View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M cc/cc_tests.gyp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
A cc/layers/delegated_frame_provider.h View 1 2 3 4 5 6 7 1 chunk +75 lines, -0 lines 0 comments Download
A cc/layers/delegated_frame_provider.cc View 1 2 3 4 5 6 7 1 chunk +110 lines, -0 lines 0 comments Download
A cc/layers/delegated_frame_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +334 lines, -0 lines 0 comments Download
A cc/layers/delegated_frame_resource_collection.h View 1 2 3 4 5 6 7 8 1 chunk +68 lines, -0 lines 0 comments Download
A cc/layers/delegated_frame_resource_collection.cc View 1 2 3 4 5 6 7 1 chunk +94 lines, -0 lines 0 comments Download
M cc/layers/delegated_renderer_layer.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +20 lines, -22 lines 0 comments Download
M cc/layers/delegated_renderer_layer.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +52 lines, -82 lines 0 comments Download
M cc/layers/delegated_renderer_layer_impl.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/delegated_renderer_layer_impl.cc View 1 2 3 4 5 6 7 7 chunks +17 lines, -22 lines 0 comments Download
M cc/resources/resource_provider.h View 1 chunk +1 line, -0 lines 0 comments Download
M cc/resources/resource_provider.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M cc/test/fake_delegated_renderer_layer.h View 1 chunk +6 lines, -3 lines 0 comments Download
M cc/test/fake_delegated_renderer_layer.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M cc/test/fake_delegated_renderer_layer_impl.cc View 1 2 3 4 5 6 7 4 chunks +7 lines, -4 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_context.cc View 1 2 3 4 5 6 7 3 chunks +19 lines, -1 line 0 comments Download
M cc/trees/layer_tree_host_unittest_delegated.cc View 1 2 3 4 5 6 7 8 9 64 chunks +628 lines, -194 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +9 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 11 chunks +96 lines, -26 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.h View 1 2 3 4 4 chunks +19 lines, -6 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.cc View 1 2 3 4 5 4 chunks +37 lines, -7 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_compositing_helper.h View 1 2 3 4 2 chunks +5 lines, -0 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_compositing_helper.cc View 1 2 3 4 5 6 7 3 chunks +27 lines, -10 lines 0 comments Download
M ui/compositor/layer.h View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -10 lines 0 comments Download
M ui/compositor/layer.cc View 1 chunk +8 lines, -17 lines 0 comments Download
M ui/compositor/layer_unittest.cc View 1 2 3 4 5 6 7 8 5 chunks +26 lines, -7 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
danakj
piman: please review alexst: please review content/renderer/browser_plugin I'm going to add a couple more unit ...
7 years, 2 months ago (2013-10-04 21:53:34 UTC) #1
danakj
Uploaded a version with ref-counted FrameProvider and ResourceCollection so more than one DRL can show ...
7 years, 2 months ago (2013-10-04 23:19:07 UTC) #2
alexst (slow to review)
https://codereview.chromium.org/26023004/diff/7001/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc File content/renderer/browser_plugin/browser_plugin_compositing_helper.cc (right): https://codereview.chromium.org/26023004/diff/7001/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc#newcode368 content/renderer/browser_plugin/browser_plugin_compositing_helper.cc:368: background_layer_->AddChild(delegated_layer_); I think if the frame_size changes, you will ...
7 years, 2 months ago (2013-10-04 23:23:56 UTC) #3
danakj
https://codereview.chromium.org/26023004/diff/7001/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc File content/renderer/browser_plugin/browser_plugin_compositing_helper.cc (right): https://codereview.chromium.org/26023004/diff/7001/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc#newcode368 content/renderer/browser_plugin/browser_plugin_compositing_helper.cc:368: background_layer_->AddChild(delegated_layer_); On 2013/10/04 23:23:56, alexst wrote: > I think ...
7 years, 2 months ago (2013-10-04 23:26:37 UTC) #4
alexst (slow to review)
https://codereview.chromium.org/26023004/diff/16001/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc File content/renderer/browser_plugin/browser_plugin_compositing_helper.cc (right): https://codereview.chromium.org/26023004/diff/16001/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc#newcode350 content/renderer/browser_plugin/browser_plugin_compositing_helper.cc:350: delegated_layer_.get()); One more comment, this is trouble here. delegated_layer_ ...
7 years, 2 months ago (2013-10-04 23:32:43 UTC) #5
piman
The patch looks really good. Do you think we should add unit tests for the ...
7 years, 2 months ago (2013-10-04 23:42:24 UTC) #6
danakj
I could add some unit tests for these classes directly, though judging from the number ...
7 years, 2 months ago (2013-10-07 21:57:38 UTC) #7
danakj
Added some cc/layers/delegated_frame_provider_unittest.cc tests for the DFP directly. I'll fix Android build tomorrow.
7 years, 2 months ago (2013-10-07 23:29:20 UTC) #8
piman
lgtm https://codereview.chromium.org/26023004/diff/6001/content/browser/renderer_host/render_widget_host_view_aura.cc File content/browser/renderer_host/render_widget_host_view_aura.cc (right): https://codereview.chromium.org/26023004/diff/6001/content/browser/renderer_host/render_widget_host_view_aura.cc#newcode1481 content/browser/renderer_host/render_widget_host_view_aura.cc:1481: // any resources from the old output surface ...
7 years, 2 months ago (2013-10-08 03:38:08 UTC) #9
alexst (slow to review)
LGTM!
7 years, 2 months ago (2013-10-08 12:43:36 UTC) #10
danakj
+sievers for content/browser/renderer_host/render_widget_host_view_android This code duplicates a lot of logic from RWHVAura, we should look ...
7 years, 2 months ago (2013-10-08 22:05:36 UTC) #11
no sievers
lgtm with 1 comment. https://codereview.chromium.org/26023004/diff/128001/content/browser/renderer_host/render_widget_host_view_android.cc File content/browser/renderer_host/render_widget_host_view_android.cc (right): https://codereview.chromium.org/26023004/diff/128001/content/browser/renderer_host/render_widget_host_view_android.cc#newcode702 content/browser/renderer_host/render_widget_host_view_android.cc:702: AttachLayers(); +dtrainor I think you ...
7 years, 2 months ago (2013-10-08 22:54:56 UTC) #12
danakj
https://codereview.chromium.org/26023004/diff/128001/content/browser/renderer_host/render_widget_host_view_android.cc File content/browser/renderer_host/render_widget_host_view_android.cc (right): https://codereview.chromium.org/26023004/diff/128001/content/browser/renderer_host/render_widget_host_view_android.cc#newcode702 content/browser/renderer_host/render_widget_host_view_android.cc:702: AttachLayers(); On 2013/10/08 22:54:56, sievers wrote: > +dtrainor > ...
7 years, 2 months ago (2013-10-09 15:44:29 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/26023004/137001
7 years, 2 months ago (2013-10-09 15:48:38 UTC) #14
commit-bot: I haz the power
7 years, 2 months ago (2013-10-09 21:03:47 UTC) #15
Message was sent while issue was closed.
Change committed as 227807

Powered by Google App Engine
This is Rietveld 408576698