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

Unified Diff: cc/layers/painted_scrollbar_layer.h

Issue 18341009: Refactor cc scrollbar layers to separate solid-color vs desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to account for re-naming to PaintedScrollbarLayer. Created 7 years, 4 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
Index: cc/layers/painted_scrollbar_layer.h
diff --git a/cc/layers/painted_scrollbar_layer.h b/cc/layers/painted_scrollbar_layer.h
index 48fb3765e502037c4ec90683f0f83c531270dfa8..3ffb5f1ea2913c5a684b7a3c43de48cdff79c43d 100644
--- a/cc/layers/painted_scrollbar_layer.h
+++ b/cc/layers/painted_scrollbar_layer.h
@@ -8,6 +8,7 @@
#include "cc/base/cc_export.h"
#include "cc/input/scrollbar.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"
#include "cc/resources/scoped_ui_resource.h"
@@ -15,7 +16,8 @@
namespace cc {
class ScrollbarThemeComposite;
-class CC_EXPORT PaintedScrollbarLayer : public ContentsScalingLayer {
+class CC_EXPORT PaintedScrollbarLayer : public ScrollbarLayerInterface,
+ public ContentsScalingLayer {
public:
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
OVERRIDE;
@@ -24,12 +26,14 @@ class CC_EXPORT PaintedScrollbarLayer : public ContentsScalingLayer {
scoped_ptr<Scrollbar> scrollbar,
int scroll_layer_id);
- int scroll_layer_id() const { return scroll_layer_id_; }
- void SetScrollLayerId(int id);
-
virtual bool OpacityCanAnimateOnImplThread() const OVERRIDE;
+ virtual ScrollbarLayerInterface* ToScrollbarLayer() OVERRIDE;
+
+ // ScrollbarLayerInterface
+ virtual int ScrollLayerId() const OVERRIDE;
+ virtual void SetScrollLayerId(int id) OVERRIDE;
- ScrollbarOrientation Orientation() const;
+ virtual ScrollbarOrientation orientation() const OVERRIDE;
// Layer interface
virtual bool Update(ResourceUpdateQueue* queue,
@@ -44,8 +48,6 @@ class CC_EXPORT PaintedScrollbarLayer : public ContentsScalingLayer {
float* contents_scale_y,
gfx::Size* content_bounds) OVERRIDE;
- virtual PaintedScrollbarLayer* ToScrollbarLayer() OVERRIDE;
-
protected:
PaintedScrollbarLayer(scoped_ptr<Scrollbar> scrollbar, int scroll_layer_id);
virtual ~PaintedScrollbarLayer();
@@ -70,11 +72,11 @@ class CC_EXPORT PaintedScrollbarLayer : public ContentsScalingLayer {
ScrollbarPart part);
scoped_ptr<Scrollbar> scrollbar_;
+ int scroll_layer_id_;
int thumb_thickness_;
enne (OOO) 2013/08/28 18:22:08 Can you initialize these in the ctor?
wjmaclean 2013/08/28 20:51:46 Done.
int thumb_length_;
gfx::Rect track_rect_;
- int scroll_layer_id_;
scoped_ptr<ScopedUIResource> track_resource_;
scoped_ptr<ScopedUIResource> thumb_resource_;

Powered by Google App Engine
This is Rietveld 408576698