Index: cc/layers/painted_scrollbar_layer.h |
diff --git a/cc/layers/painted_scrollbar_layer.h b/cc/layers/painted_scrollbar_layer.h |
index 950c165c3417099ef5918597fb0dfa629f6f5ceb..ae2b125e785a4f2117a349c55798cfd20472a2d6 100644 |
--- a/cc/layers/painted_scrollbar_layer.h |
+++ b/cc/layers/painted_scrollbar_layer.h |
@@ -7,7 +7,7 @@ |
#include "cc/base/cc_export.h" |
#include "cc/input/scrollbar.h" |
-#include "cc/layers/contents_scaling_layer.h" |
+#include "cc/layers/layer.h" |
#include "cc/layers/scrollbar_layer_interface.h" |
#include "cc/layers/scrollbar_theme_painter.h" |
#include "cc/resources/layer_updater.h" |
@@ -17,7 +17,7 @@ namespace cc { |
class ScrollbarThemeComposite; |
class CC_EXPORT PaintedScrollbarLayer : public ScrollbarLayerInterface, |
- public ContentsScalingLayer { |
+ public Layer { |
public: |
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
@@ -41,10 +41,10 @@ class CC_EXPORT PaintedScrollbarLayer : public ScrollbarLayerInterface, |
void SetLayerTreeHost(LayerTreeHost* host) override; |
void PushPropertiesTo(LayerImpl* layer) override; |
void PushScrollClipPropertiesTo(LayerImpl* layer) override; |
- void CalculateContentsScale(float ideal_contents_scale, |
- float* contents_scale_x, |
- float* contents_scale_y, |
- gfx::Size* content_bounds) override; |
+ |
+ const gfx::Size& internal_content_bounds() const { |
+ return internal_content_bounds_; |
+ } |
protected: |
PaintedScrollbarLayer(scoped_ptr<Scrollbar> scrollbar, int scroll_layer_id); |
@@ -57,17 +57,20 @@ class CC_EXPORT PaintedScrollbarLayer : public ScrollbarLayerInterface, |
UIResourceId thumb_resource_id() { |
return thumb_resource_.get() ? thumb_resource_->id() : 0; |
} |
+ void UpdateInternalContentScale(); |
void UpdateThumbAndTrackGeometry(); |
private: |
gfx::Rect ScrollbarLayerRectToContentRect(const gfx::Rect& layer_rect) const; |
gfx::Rect OriginThumbRect() const; |
- template<typename T> void UpdateProperty(T value, T* prop) { |
+ template <typename T> |
+ bool UpdateProperty(T value, T* prop) { |
if (*prop == value) |
- return; |
+ return false; |
*prop = value; |
SetNeedsPushProperties(); |
+ return true; |
} |
int MaxTextureSize(); |
@@ -81,6 +84,9 @@ class CC_EXPORT PaintedScrollbarLayer : public ScrollbarLayerInterface, |
int scroll_layer_id_; |
int clip_layer_id_; |
+ float internal_contents_scale_; |
+ gfx::Size internal_content_bounds_; |
+ |
// Snapshot of properties taken in UpdateThumbAndTrackGeometry and used in |
// PushPropertiesTo. |
int thumb_thickness_; |