Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Unified Diff: cc/layers/painted_scrollbar_layer.cc

Issue 23983047: Pinch/Zoom Infrastructure & Plumbing CL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use layer ids instead of pointers for registering scroll/clip layers. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..ceee25e677926b220cde7a1db983d32117516db3 100644
--- a/cc/layers/painted_scrollbar_layer.cc
+++ b/cc/layers/painted_scrollbar_layer.cc
@@ -38,6 +38,7 @@ PaintedScrollbarLayer::PaintedScrollbarLayer(
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 +53,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_ = id;
+ scroll_layer_id_ = layer_id;
+ SetNeedsFullTreeSync();
+}
+
+void PaintedScrollbarLayer::SetClipLayer(int layer_id) {
+ if (layer_id == clip_layer_id_)
+ return;
+
+ clip_layer_id_ = layer_id;
SetNeedsFullTreeSync();
}
@@ -109,6 +118,8 @@ void PaintedScrollbarLayer::CalculateContentsScale(
void PaintedScrollbarLayer::PushPropertiesTo(LayerImpl* layer) {
ContentsScalingLayer::PushPropertiesTo(layer);
+ PushScrollClipPropertiesTo(layer);
+
PaintedScrollbarLayerImpl* scrollbar_layer =
static_cast<PaintedScrollbarLayerImpl*>(layer);
@@ -136,6 +147,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.

Powered by Google App Engine
This is Rietveld 408576698