Index: cc/layers/painted_scrollbar_layer.cc |
diff --git a/cc/layers/painted_scrollbar_layer.cc b/cc/layers/painted_scrollbar_layer.cc |
index 4466d58a3de7ac579aeb084aa4cd89287b5c7745..71a37d48883f8f07d592ff561e288e344917ed65 100644 |
--- a/cc/layers/painted_scrollbar_layer.cc |
+++ b/cc/layers/painted_scrollbar_layer.cc |
@@ -33,11 +33,11 @@ scoped_refptr<PaintedScrollbarLayer> PaintedScrollbarLayer::Create( |
new PaintedScrollbarLayer(scrollbar.Pass(), scroll_layer_id)); |
} |
-PaintedScrollbarLayer::PaintedScrollbarLayer( |
- scoped_ptr<Scrollbar> scrollbar, |
- int scroll_layer_id) |
+PaintedScrollbarLayer::PaintedScrollbarLayer(scoped_ptr<Scrollbar> scrollbar, |
+ int scroll_layer_id) |
: scrollbar_(scrollbar.Pass()), |
scroll_layer_id_(scroll_layer_id), |
+ clip_layer_id_(Layer::INVALID_ID), |
thumb_thickness_(scrollbar_->ThumbThickness()), |
thumb_length_(scrollbar_->ThumbLength()), |
is_overlay_(scrollbar_->IsOverlay()), |
@@ -52,11 +52,19 @@ int PaintedScrollbarLayer::ScrollLayerId() const { |
return scroll_layer_id_; |
} |
-void PaintedScrollbarLayer::SetScrollLayerId(int id) { |
- if (id == scroll_layer_id_) |
+void PaintedScrollbarLayer::SetScrollLayer(int layer_id) { |
+ if (layer_id == scroll_layer_id_) |
+ return; |
+ |
+ scroll_layer_id_ = layer_id; |
+ SetNeedsFullTreeSync(); |
+} |
+ |
+void PaintedScrollbarLayer::SetClipLayer(int layer_id) { |
+ if (layer_id == clip_layer_id_) |
return; |
- scroll_layer_id_ = id; |
+ clip_layer_id_ = layer_id; |
SetNeedsFullTreeSync(); |
} |
@@ -109,6 +117,8 @@ void PaintedScrollbarLayer::CalculateContentsScale( |
void PaintedScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { |
ContentsScalingLayer::PushPropertiesTo(layer); |
+ PushScrollClipPropertiesTo(layer); |
+ |
PaintedScrollbarLayerImpl* scrollbar_layer = |
static_cast<PaintedScrollbarLayerImpl*>(layer); |
@@ -136,6 +146,14 @@ ScrollbarLayerInterface* PaintedScrollbarLayer::ToScrollbarLayer() { |
return this; |
} |
+void PaintedScrollbarLayer::PushScrollClipPropertiesTo(LayerImpl* layer) { |
+ PaintedScrollbarLayerImpl* scrollbar_layer = |
+ static_cast<PaintedScrollbarLayerImpl*>(layer); |
+ |
+ scrollbar_layer->SetScrollLayerById(scroll_layer_id_); |
+ scrollbar_layer->SetClipLayerById(clip_layer_id_); |
+} |
+ |
void PaintedScrollbarLayer::SetLayerTreeHost(LayerTreeHost* host) { |
// When the LTH is set to null or has changed, then this layer should remove |
// all of its associated resources. |