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

Unified Diff: cc/layers/painted_scrollbar_layer.h

Issue 913393004: Revert of cc: Make PaintedScrollbarLayer not use ContentsScalingLayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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/layer_impl.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 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.
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/painted_scrollbar_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698