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

Unified Diff: cc/layers/painted_scrollbar_layer.h

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/nine_patch_layer_impl_unittest.cc ('k') | cc/layers/painted_scrollbar_layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « cc/layers/nine_patch_layer_impl_unittest.cc ('k') | cc/layers/painted_scrollbar_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698