Index: cc/layers/solid_color_scrollbar_layer.cc |
diff --git a/cc/layers/solid_color_scrollbar_layer.cc b/cc/layers/solid_color_scrollbar_layer.cc |
index d9ed922e5d893e9744d23ad38ca2d98f0a91126e..bbcf104e26111d9bf516442a7a40a1525397b4e1 100644 |
--- a/cc/layers/solid_color_scrollbar_layer.cc |
+++ b/cc/layers/solid_color_scrollbar_layer.cc |
@@ -21,20 +21,21 @@ scoped_refptr<SolidColorScrollbarLayer> SolidColorScrollbarLayer::Create( |
ScrollbarOrientation orientation, |
int thumb_thickness, |
bool is_left_side_vertical_scrollbar, |
- int scroll_layer_id) { |
+ Layer* scroll_layer) { |
return make_scoped_refptr(new SolidColorScrollbarLayer( |
orientation, |
thumb_thickness, |
is_left_side_vertical_scrollbar, |
- scroll_layer_id)); |
+ scroll_layer)); |
} |
SolidColorScrollbarLayer::SolidColorScrollbarLayer( |
ScrollbarOrientation orientation, |
int thumb_thickness, |
bool is_left_side_vertical_scrollbar, |
- int scroll_layer_id) |
- : scroll_layer_id_(scroll_layer_id), |
+ Layer* scroll_layer) |
+ : scroll_layer_(scroll_layer), |
+ clip_layer_(NULL), |
orientation_(orientation), |
thumb_thickness_(thumb_thickness), |
is_left_side_vertical_scrollbar_(is_left_side_vertical_scrollbar) {} |
@@ -45,19 +46,39 @@ ScrollbarLayerInterface* SolidColorScrollbarLayer::ToScrollbarLayer() { |
return this; |
} |
+void SolidColorScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { |
+ Layer::PushPropertiesTo(layer); |
+ |
+ SolidColorScrollbarLayerImpl* scrollbar_layer = |
+ static_cast<SolidColorScrollbarLayerImpl*>(layer); |
+ |
+ scrollbar_layer->SetScrollLayerById(scroll_layer_ ? scroll_layer_->id() |
+ : Layer::INVALID_ID); |
+ scrollbar_layer->SetClipLayerById(clip_layer_ ? clip_layer_->id() |
+ : Layer::INVALID_ID); |
+} |
+ |
bool SolidColorScrollbarLayer::OpacityCanAnimateOnImplThread() const { |
return true; |
} |
int SolidColorScrollbarLayer::ScrollLayerId() const { |
- return scroll_layer_id_; |
+ return scroll_layer_->id(); |
+} |
+ |
+void SolidColorScrollbarLayer::SetScrollLayer(scoped_refptr<Layer> layer) { |
+ if (layer == scroll_layer_) |
+ return; |
+ |
+ scroll_layer_ = layer; |
+ SetNeedsFullTreeSync(); |
} |
-void SolidColorScrollbarLayer::SetScrollLayerId(int id) { |
- if (id == scroll_layer_id_) |
+void SolidColorScrollbarLayer::SetClipLayer(scoped_refptr<Layer> layer) { |
+ if (layer == clip_layer_) |
return; |
- scroll_layer_id_ = id; |
+ clip_layer_ = layer; |
SetNeedsFullTreeSync(); |
} |