| Index: cc/layer_impl.cc
|
| diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
|
| index 34441b5d6ca263d8865db73e8cfad584a386da29..243a60d35b19443c481e660440db1d7d7fed0877 100644
|
| --- a/cc/layer_impl.cc
|
| +++ b/cc/layer_impl.cc
|
| @@ -67,6 +67,8 @@ void LayerImpl::addChild(scoped_ptr<LayerImpl> child)
|
| {
|
| child->setParent(this);
|
| m_children.append(child.Pass());
|
| + if (m_layerTreeHostImpl)
|
| + m_layerTreeHostImpl->setNeedsUpdateLayers();
|
| }
|
|
|
| void LayerImpl::removeFromParent()
|
| @@ -80,6 +82,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->setNeedsUpdateLayers();
|
| return;
|
| }
|
| }
|
| @@ -94,6 +98,8 @@ void LayerImpl::removeAllChildren()
|
| void LayerImpl::clearChildList()
|
| {
|
| m_children.clear();
|
| + if (m_layerTreeHostImpl)
|
| + m_layerTreeHostImpl->setNeedsUpdateLayers();
|
| }
|
|
|
| void LayerImpl::createRenderSurface()
|
| @@ -116,6 +122,17 @@ int LayerImpl::descendantsDrawContent()
|
| return result;
|
| }
|
|
|
| +void LayerImpl::setLayerTreeHostImpl(LayerTreeHostImpl* hostImpl)
|
| +{
|
| + if (m_layerTreeHostImpl == hostImpl)
|
| + return;
|
| +
|
| + m_layerTreeHostImpl = hostImpl;
|
| +
|
| + if (m_layerTreeHostImpl)
|
| + m_layerTreeHostImpl->setNeedsUpdateLayers();
|
| +}
|
| +
|
| scoped_ptr<SharedQuadState> LayerImpl::createSharedQuadState() const
|
| {
|
| scoped_ptr<SharedQuadState> state = SharedQuadState::Create();
|
| @@ -375,16 +392,31 @@ bool LayerImpl::layerSurfacePropertyChanged() const
|
| return false;
|
| }
|
|
|
| -void LayerImpl::noteLayerPropertyChangedForSubtree()
|
| +void LayerImpl::noteLayerSurfacePropertyChanged()
|
| +{
|
| + m_layerSurfacePropertyChanged = true;
|
| + if (m_layerTreeHostImpl)
|
| + m_layerTreeHostImpl->setNeedsUpdateLayers();
|
| +}
|
| +
|
| +void LayerImpl::noteLayerPropertyChanged()
|
| {
|
| m_layerPropertyChanged = true;
|
| + if (m_layerTreeHostImpl)
|
| + m_layerTreeHostImpl->setNeedsUpdateLayers();
|
| +}
|
| +
|
| +void LayerImpl::noteLayerPropertyChangedForSubtree()
|
| +{
|
| + noteLayerPropertyChanged();
|
| noteLayerPropertyChangedForDescendants();
|
| }
|
|
|
| void LayerImpl::noteLayerPropertyChangedForDescendants()
|
| {
|
| - for (size_t i = 0; i < m_children.size(); ++i)
|
| + for (size_t i = 0; i < m_children.size(); ++i) {
|
| m_children[i]->noteLayerPropertyChangedForSubtree();
|
| + }
|
| }
|
|
|
| const char* LayerImpl::layerTypeAsString() const
|
| @@ -452,7 +484,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 +517,7 @@ void LayerImpl::setDrawsContent(bool drawsContent)
|
| return;
|
|
|
| m_drawsContent = drawsContent;
|
| - m_layerPropertyChanged = true;
|
| + noteLayerPropertyChanged();
|
| }
|
|
|
| void LayerImpl::setAnchorPoint(const gfx::PointF& anchorPoint)
|
| @@ -512,7 +544,7 @@ void LayerImpl::setBackgroundColor(SkColor backgroundColor)
|
| return;
|
|
|
| m_backgroundColor = backgroundColor;
|
| - m_layerPropertyChanged = true;
|
| + noteLayerPropertyChanged();
|
| }
|
|
|
| void LayerImpl::setFilters(const WebKit::WebFilterOperations& filters)
|
| @@ -531,7 +563,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 +600,7 @@ void LayerImpl::setOpacity(float opacity)
|
| return;
|
|
|
| m_opacity = opacity;
|
| - m_layerSurfacePropertyChanged = true;
|
| + noteLayerSurfacePropertyChanged();
|
| }
|
|
|
| bool LayerImpl::opacityIsAnimating() const
|
| @@ -610,7 +642,7 @@ void LayerImpl::setTransform(const gfx::Transform& transform)
|
| return;
|
|
|
| m_transform = transform;
|
| - m_layerSurfacePropertyChanged = true;
|
| + noteLayerSurfacePropertyChanged();
|
| }
|
|
|
| bool LayerImpl::transformIsAnimating() const
|
| @@ -624,7 +656,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 +666,7 @@ void LayerImpl::setContentsScale(float contentsScaleX, float contentsScaleY)
|
|
|
| m_contentsScaleX = contentsScaleX;
|
| m_contentsScaleY = contentsScaleY;
|
| - m_layerPropertyChanged = true;
|
| + noteLayerPropertyChanged();
|
| }
|
|
|
| void LayerImpl::setScrollOffset(gfx::Vector2d scrollOffset)
|
|
|