diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-07 20:31:45 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-07 20:31:45 +0000 |
commit | 586d51edafeeed9705656ac871fcd3d7653e4456 (patch) | |
tree | 7eab0309c1bca3a7a22f45540504acc962f503d7 /cc/layer_impl.h | |
parent | 59ba87e3cb9b408e9c0f33e9b5ebdcd5aaf959a1 (diff) | |
download | chromium_src-586d51edafeeed9705656ac871fcd3d7653e4456.zip chromium_src-586d51edafeeed9705656ac871fcd3d7653e4456.tar.gz chromium_src-586d51edafeeed9705656ac871fcd3d7653e4456.tar.bz2 |
cc: Pass LayerTreeHostImpl to LayerImpl constructor
In order to allow for LayerImpl to notify its host when one of its property
changes, it needs to more robustly have its host set (which is not the case in
most tests). To avoid a recursive pass when adding children or after layer
synchronization, instead just pass it to the constructor of LayerImpl, since a
given LayerImpl will never move from one host to another.
NOTRY=true
BUG=none
Review URL: https://chromiumcodereview.appspot.com/11472021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171830 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layer_impl.h')
-rw-r--r-- | cc/layer_impl.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cc/layer_impl.h b/cc/layer_impl.h index 76a3e38..e155e49 100644 --- a/cc/layer_impl.h +++ b/cc/layer_impl.h @@ -42,9 +42,9 @@ class CC_EXPORT LayerImpl { public: typedef ScopedPtrVector<LayerImpl> LayerList; - static scoped_ptr<LayerImpl> create(int id) + static scoped_ptr<LayerImpl> create(LayerTreeHostImpl* hostImpl, int id) { - return make_scoped_ptr(new LayerImpl(id)); + return make_scoped_ptr(new LayerImpl(hostImpl, id)); } virtual ~LayerImpl(); @@ -72,7 +72,6 @@ public: bool replicaHasMask() const { return m_replicaLayer && (m_maskLayer || m_replicaLayer->m_maskLayer); } LayerTreeHostImpl* layerTreeHostImpl() const { return m_layerTreeHostImpl; } - void setLayerTreeHostImpl(LayerTreeHostImpl* hostImpl); scoped_ptr<SharedQuadState> createSharedQuadState() const; // willDraw must be called before appendQuads. If willDraw is called, @@ -276,7 +275,7 @@ public: gfx::Rect layerRectToContentRect(const gfx::RectF& layerRect) const; protected: - explicit LayerImpl(int); + LayerImpl(LayerTreeHostImpl* hostImpl, int); // Get the color and size of the layer's debug border. virtual void getDebugBorderProperties(SkColor*, float* width) const; |