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

Side by Side Diff: cc/scrollbar_animation_controller.h

Issue 11367080: cc: Remove all remaining use of WebCore Rect/Point/Size types from the compositor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move ui/gfx changes to cc/geometry.h Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CCScrollbarAnimationController_h 5 #ifndef CCScrollbarAnimationController_h
6 #define CCScrollbarAnimationController_h 6 #define CCScrollbarAnimationController_h
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/cc_export.h" 9 #include "cc/cc_export.h"
10 #include "FloatPoint.h" 10 #include "ui/gfx/size.h"
11 #include "IntSize.h" 11 #include "ui/gfx/vector2d.h"
12 12 #include "ui/gfx/vector2d_f.h"
13 namespace gfx {
14 class Size;
15 }
16 13
17 namespace cc { 14 namespace cc {
18 15
19 class LayerImpl; 16 class LayerImpl;
20 class ScrollbarLayerImpl; 17 class ScrollbarLayerImpl;
21 18
22 // This abstract class represents the compositor-side analogy of ScrollbarAnimat or. 19 // This abstract class represents the compositor-side analogy of ScrollbarAnimat or.
23 // Individual platforms should subclass it to provide specialized implementation . 20 // Individual platforms should subclass it to provide specialized implementation .
24 class CC_EXPORT ScrollbarAnimationController { 21 class CC_EXPORT ScrollbarAnimationController {
25 public: 22 public:
26 static scoped_ptr<ScrollbarAnimationController> create(LayerImpl* scrollLaye r); 23 static scoped_ptr<ScrollbarAnimationController> create(LayerImpl* scrollLaye r);
27 24
28 virtual ~ScrollbarAnimationController(); 25 virtual ~ScrollbarAnimationController();
29 26
30 virtual bool animate(double monotonicTime); 27 virtual bool animate(double monotonicTime);
31 void didPinchGestureBegin(); 28 void didPinchGestureBegin();
32 void didPinchGestureUpdate(); 29 void didPinchGestureUpdate();
33 void didPinchGestureEnd(); 30 void didPinchGestureEnd();
34 void updateScrollOffset(LayerImpl* scrollLayer); 31 void updateScrollOffset(LayerImpl* scrollLayer);
35 32
36 void setHorizontalScrollbarLayer(ScrollbarLayerImpl* layer) { m_horizontalSc rollbarLayer = layer; } 33 void setHorizontalScrollbarLayer(ScrollbarLayerImpl* layer) { m_horizontalSc rollbarLayer = layer; }
37 ScrollbarLayerImpl* horizontalScrollbarLayer() const { return m_horizontalSc rollbarLayer; } 34 ScrollbarLayerImpl* horizontalScrollbarLayer() const { return m_horizontalSc rollbarLayer; }
38 35
39 void setVerticalScrollbarLayer(ScrollbarLayerImpl* layer) { m_verticalScroll barLayer = layer; } 36 void setVerticalScrollbarLayer(ScrollbarLayerImpl* layer) { m_verticalScroll barLayer = layer; }
40 ScrollbarLayerImpl* verticalScrollbarLayer() const { return m_verticalScroll barLayer; } 37 ScrollbarLayerImpl* verticalScrollbarLayer() const { return m_verticalScroll barLayer; }
41 38
42 FloatPoint currentPos() const { return m_currentPos; } 39 gfx::Vector2dF currentOffset() const { return m_currentOffset; }
43 gfx::Size totalSize() const { return m_totalSize; } 40 gfx::Size totalSize() const { return m_totalSize; }
44 IntSize maximum() const { return m_maximum; } 41 gfx::Vector2d maximum() const { return m_maximum; }
45 42
46 virtual void didPinchGestureBeginAtTime(double monotonicTime) { } 43 virtual void didPinchGestureBeginAtTime(double monotonicTime) { }
47 virtual void didPinchGestureUpdateAtTime(double monotonicTime) { } 44 virtual void didPinchGestureUpdateAtTime(double monotonicTime) { }
48 virtual void didPinchGestureEndAtTime(double monotonicTime) { } 45 virtual void didPinchGestureEndAtTime(double monotonicTime) { }
49 virtual void updateScrollOffsetAtTime(LayerImpl* scrollLayer, double monoton icTime); 46 virtual void updateScrollOffsetAtTime(LayerImpl* scrollLayer, double monoton icTime);
50 47
51 protected: 48 protected:
52 explicit ScrollbarAnimationController(LayerImpl* scrollLayer); 49 explicit ScrollbarAnimationController(LayerImpl* scrollLayer);
53 50
54 private: 51 private:
55 static gfx::Size getScrollLayerBounds(const LayerImpl*); 52 static gfx::Size getScrollLayerBounds(const LayerImpl*);
56 53
57 // Beware of dangling pointer. Always update these during tree synchronizati on. 54 // Beware of dangling pointer. Always update these during tree synchronizati on.
58 ScrollbarLayerImpl* m_horizontalScrollbarLayer; 55 ScrollbarLayerImpl* m_horizontalScrollbarLayer;
59 ScrollbarLayerImpl* m_verticalScrollbarLayer; 56 ScrollbarLayerImpl* m_verticalScrollbarLayer;
60 57
61 FloatPoint m_currentPos; 58 gfx::Vector2dF m_currentOffset;
62 gfx::Size m_totalSize; 59 gfx::Size m_totalSize;
63 IntSize m_maximum; 60 gfx::Vector2d m_maximum;
64 }; 61 };
65 62
66 } // namespace cc 63 } // namespace cc
67 64
68 #endif // CCScrollbarAnimationController_h 65 #endif // CCScrollbarAnimationController_h
OLDNEW
« cc/proxy.h ('K') | « cc/proxy.h ('k') | cc/scrollbar_animation_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698