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

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: Rebase to r248052. 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
« no previous file with comments | « cc/layers/painted_scrollbar_layer.h ('k') | cc/layers/painted_scrollbar_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « cc/layers/painted_scrollbar_layer.h ('k') | cc/layers/painted_scrollbar_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698