Index: cc/layers/painted_scrollbar_layer.h |
diff --git a/cc/layers/painted_scrollbar_layer.h b/cc/layers/painted_scrollbar_layer.h |
index ae2b125e785a4f2117a349c55798cfd20472a2d6..950c165c3417099ef5918597fb0dfa629f6f5ceb 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/layer.h" |
+#include "cc/layers/contents_scaling_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 @@ |
class ScrollbarThemeComposite; |
class CC_EXPORT PaintedScrollbarLayer : public ScrollbarLayerInterface, |
- public Layer { |
+ public ContentsScalingLayer { |
public: |
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
@@ -41,10 +41,10 @@ |
void SetLayerTreeHost(LayerTreeHost* host) override; |
void PushPropertiesTo(LayerImpl* layer) override; |
void PushScrollClipPropertiesTo(LayerImpl* layer) override; |
- |
- const gfx::Size& internal_content_bounds() const { |
- return internal_content_bounds_; |
- } |
+ void CalculateContentsScale(float ideal_contents_scale, |
+ float* contents_scale_x, |
+ float* contents_scale_y, |
+ gfx::Size* content_bounds) override; |
protected: |
PaintedScrollbarLayer(scoped_ptr<Scrollbar> scrollbar, int scroll_layer_id); |
@@ -57,20 +57,17 @@ |
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> |
- bool UpdateProperty(T value, T* prop) { |
+ template<typename T> void UpdateProperty(T value, T* prop) { |
if (*prop == value) |
- return false; |
+ return; |
*prop = value; |
SetNeedsPushProperties(); |
- return true; |
} |
int MaxTextureSize(); |
@@ -83,9 +80,6 @@ |
scoped_ptr<Scrollbar> scrollbar_; |
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. |