Index: cc/layer_impl.cc |
diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc |
index 34441b5d6ca263d8865db73e8cfad584a386da29..00f14f0d3371888af8c37e15fb9727667ca7ea23 100644 |
--- a/cc/layer_impl.cc |
+++ b/cc/layer_impl.cc |
@@ -66,7 +66,11 @@ LayerImpl::~LayerImpl() |
void LayerImpl::addChild(scoped_ptr<LayerImpl> child) |
{ |
child->setParent(this); |
+ child->setLayerTreeHostImpl(layerTreeHostImpl()); |
m_children.append(child.Pass()); |
+ |
+ if (m_layerTreeHostImpl) |
+ m_layerTreeHostImpl->setNeedsUpdateDrawProperties(); |
} |
void LayerImpl::removeFromParent() |
@@ -80,6 +84,8 @@ void LayerImpl::removeFromParent() |
for (size_t i = 0; i < parent->m_children.size(); ++i) { |
if (parent->m_children[i] == this) { |
parent->m_children.remove(i); |
+ if (m_layerTreeHostImpl) |
+ m_layerTreeHostImpl->setNeedsUpdateDrawProperties(); |
return; |
} |
} |
@@ -94,6 +100,8 @@ void LayerImpl::removeAllChildren() |
void LayerImpl::clearChildList() |
{ |
m_children.clear(); |
+ if (m_layerTreeHostImpl) |
+ m_layerTreeHostImpl->setNeedsUpdateDrawProperties(); |
} |
void LayerImpl::createRenderSurface() |
@@ -116,6 +124,25 @@ int LayerImpl::descendantsDrawContent() |
return result; |
} |
+void LayerImpl::setLayerTreeHostImpl(LayerTreeHostImpl* hostImpl) |
+{ |
+ if (m_layerTreeHostImpl == hostImpl) |
+ return; |
+ |
+ m_layerTreeHostImpl = hostImpl; |
+ |
+ for (size_t i = 0; i < m_children.size(); ++i) |
+ m_children[i]->setLayerTreeHostImpl(hostImpl); |
+ |
+ if (m_maskLayer) |
+ m_maskLayer->setLayerTreeHostImpl(hostImpl); |
+ if (m_replicaLayer) |
+ m_replicaLayer->setLayerTreeHostImpl(hostImpl); |
+ |
+ if (m_layerTreeHostImpl) |
+ m_layerTreeHostImpl->setNeedsUpdateDrawProperties(); |
+} |
+ |
scoped_ptr<SharedQuadState> LayerImpl::createSharedQuadState() const |
{ |
scoped_ptr<SharedQuadState> state = SharedQuadState::Create(); |
@@ -375,9 +402,23 @@ bool LayerImpl::layerSurfacePropertyChanged() const |
return false; |
} |
-void LayerImpl::noteLayerPropertyChangedForSubtree() |
+void LayerImpl::noteLayerSurfacePropertyChanged() |
+{ |
+ m_layerSurfacePropertyChanged = true; |
+ if (m_layerTreeHostImpl) |
+ m_layerTreeHostImpl->setNeedsUpdateDrawProperties(); |
+} |
+ |
+void LayerImpl::noteLayerPropertyChanged() |
{ |
m_layerPropertyChanged = true; |
+ if (m_layerTreeHostImpl) |
+ m_layerTreeHostImpl->setNeedsUpdateDrawProperties(); |
+} |
+ |
+void LayerImpl::noteLayerPropertyChangedForSubtree() |
+{ |
+ noteLayerPropertyChanged(); |
noteLayerPropertyChangedForDescendants(); |
} |
@@ -452,7 +493,7 @@ void LayerImpl::setBounds(const gfx::Size& bounds) |
if (masksToBounds()) |
noteLayerPropertyChangedForSubtree(); |
else |
- m_layerPropertyChanged = true; |
+ noteLayerPropertyChanged(); |
} |
void LayerImpl::setMaskLayer(scoped_ptr<LayerImpl> maskLayer) |
@@ -485,7 +526,7 @@ void LayerImpl::setDrawsContent(bool drawsContent) |
return; |
m_drawsContent = drawsContent; |
- m_layerPropertyChanged = true; |
+ noteLayerPropertyChanged(); |
} |
void LayerImpl::setAnchorPoint(const gfx::PointF& anchorPoint) |
@@ -512,7 +553,7 @@ void LayerImpl::setBackgroundColor(SkColor backgroundColor) |
return; |
m_backgroundColor = backgroundColor; |
- m_layerPropertyChanged = true; |
+ noteLayerPropertyChanged(); |
} |
void LayerImpl::setFilters(const WebKit::WebFilterOperations& filters) |
@@ -531,7 +572,7 @@ void LayerImpl::setBackgroundFilters(const WebKit::WebFilterOperations& backgrou |
return; |
m_backgroundFilters = backgroundFilters; |
- m_layerPropertyChanged = true; |
+ noteLayerPropertyChanged(); |
} |
void LayerImpl::setFilter(const skia::RefPtr<SkImageFilter>& filter) |
@@ -568,7 +609,7 @@ void LayerImpl::setOpacity(float opacity) |
return; |
m_opacity = opacity; |
- m_layerSurfacePropertyChanged = true; |
+ noteLayerSurfacePropertyChanged(); |
} |
bool LayerImpl::opacityIsAnimating() const |
@@ -610,7 +651,7 @@ void LayerImpl::setTransform(const gfx::Transform& transform) |
return; |
m_transform = transform; |
- m_layerSurfacePropertyChanged = true; |
+ noteLayerSurfacePropertyChanged(); |
} |
bool LayerImpl::transformIsAnimating() const |
@@ -624,7 +665,7 @@ void LayerImpl::setContentBounds(const gfx::Size& contentBounds) |
return; |
m_contentBounds = contentBounds; |
- m_layerPropertyChanged = true; |
+ noteLayerPropertyChanged(); |
} |
void LayerImpl::setContentsScale(float contentsScaleX, float contentsScaleY) |
@@ -634,7 +675,7 @@ void LayerImpl::setContentsScale(float contentsScaleX, float contentsScaleY) |
m_contentsScaleX = contentsScaleX; |
m_contentsScaleY = contentsScaleY; |
- m_layerPropertyChanged = true; |
+ noteLayerPropertyChanged(); |
} |
void LayerImpl::setScrollOffset(gfx::Vector2d scrollOffset) |