summaryrefslogtreecommitdiffstats
path: root/cc/layers/layer_impl.h
diff options
context:
space:
mode:
authorvollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-19 19:13:22 +0000
committervollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-19 19:13:22 +0000
commit44d8e84c39855ae33772d3fa6ce35d6a5a936932 (patch)
treebc19a43d9962f50cbf047fad71aaac106ef502ce /cc/layers/layer_impl.h
parent03d7bea45a3d5dca915fd437e3b2625453aaf95a (diff)
downloadchromium_src-44d8e84c39855ae33772d3fa6ce35d6a5a936932.zip
chromium_src-44d8e84c39855ae33772d3fa6ce35d6a5a936932.tar.gz
chromium_src-44d8e84c39855ae33772d3fa6ce35d6a5a936932.tar.bz2
Only allocate temporary layer lists when sorting contributions.
Previously, I'd constructed temporary layer lists to hold the layer list contributions from children when I visited them out of order in CalcDrawProps. Unfortunately ~RenderSurfaceLayerList frees all the surfaces, so when the temporary lists were destroyed, the surfaces would be nuked. To work around this, I don't pass temporary lists to children, I just sort the "real" lists after the recursion. When doing this sorting I allocate a LayerList for Layers and a LayerImplList for LayerImpls. The types got a bit unwieldy when doing this, so I also put some handy typedefs in Layer and LayerImpl. This lets us cut down on the number of template parameters we use in LTHC. TEST=LayerTreeHostCommonTest.OutOfOrderClippingRequiresRSLLSorting R=danakj@chromium.org BUG=309381 Review URL: https://codereview.chromium.org/29653002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229619 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers/layer_impl.h')
-rw-r--r--cc/layers/layer_impl.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h
index 6513b32..2048840 100644
--- a/cc/layers/layer_impl.h
+++ b/cc/layers/layer_impl.h
@@ -59,6 +59,10 @@ enum DrawMode {
class CC_EXPORT LayerImpl : LayerAnimationValueObserver {
public:
+ typedef LayerImplList RenderSurfaceListType;
+ typedef LayerImplList LayerListType;
+ typedef RenderSurfaceImpl RenderSurfaceType;
+
static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, int id) {
return make_scoped_ptr(new LayerImpl(tree_impl, id));
}
@@ -267,10 +271,10 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver {
void CreateRenderSurface();
void ClearRenderSurface();
- DrawProperties<LayerImpl, RenderSurfaceImpl>& draw_properties() {
+ DrawProperties<LayerImpl>& draw_properties() {
return draw_properties_;
}
- const DrawProperties<LayerImpl, RenderSurfaceImpl>& draw_properties() const {
+ const DrawProperties<LayerImpl>& draw_properties() const {
return draw_properties_;
}
@@ -613,7 +617,7 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver {
// Group of properties that need to be computed based on the layer tree
// hierarchy before layers can be drawn.
- DrawProperties<LayerImpl, RenderSurfaceImpl> draw_properties_;
+ DrawProperties<LayerImpl> draw_properties_;
DISALLOW_COPY_AND_ASSIGN(LayerImpl);
};