OLD | NEW |
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 CC_LAYERS_SCROLLBAR_LAYER_H_ | 5 #ifndef CC_LAYERS_SCROLLBAR_LAYER_H_ |
6 #define CC_LAYERS_SCROLLBAR_LAYER_H_ | 6 #define CC_LAYERS_SCROLLBAR_LAYER_H_ |
7 | 7 |
8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
9 #include "cc/layers/contents_scaling_layer.h" | 9 #include "cc/layers/contents_scaling_layer.h" |
10 #include "cc/layers/scrollbar_theme_painter.h" | 10 #include "cc/layers/scrollbar_theme_painter.h" |
11 #include "cc/resources/layer_updater.h" | 11 #include "cc/resources/layer_updater.h" |
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebScrollbar.h" | 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebScrollbar.h" |
13 #include "third_party/WebKit/Source/Platform/chromium/public/WebScrollbarThemeGe
ometry.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebScrollbarThemeGe
ometry.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 class CachingBitmapContentLayerUpdater; | 16 class CachingBitmapContentLayerUpdater; |
17 class ResourceUpdateQueue; | 17 class ResourceUpdateQueue; |
18 class Scrollbar; | 18 class Scrollbar; |
19 class ScrollbarThemeComposite; | 19 class ScrollbarThemeComposite; |
20 | 20 |
21 class CC_EXPORT ScrollbarLayer : public ContentsScalingLayer { | 21 class CC_EXPORT ScrollbarLayer : public ContentsScalingLayer { |
22 public: | 22 public: |
23 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) | 23 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) |
24 OVERRIDE; | 24 OVERRIDE; |
25 | 25 |
26 static scoped_refptr<ScrollbarLayer> Create( | 26 static scoped_refptr<ScrollbarLayer> Create( |
27 scoped_ptr<WebKit::WebScrollbar>, | 27 scoped_ptr<WebKit::WebScrollbar> scrollbar, |
28 scoped_ptr<ScrollbarThemePainter>, | 28 scoped_ptr<ScrollbarThemePainter> painter, |
29 scoped_ptr<WebKit::WebScrollbarThemeGeometry>, | 29 scoped_ptr<WebKit::WebScrollbarThemeGeometry> geometry, |
30 int scrollLayerId); | 30 int scroll_layer_id); |
31 | 31 |
32 int scroll_layer_id() const { return scroll_layer_id_; } | 32 int scroll_layer_id() const { return scroll_layer_id_; } |
33 void SetScrollLayerId(int id); | 33 void SetScrollLayerId(int id); |
34 | 34 |
35 virtual bool OpacityCanAnimateOnImplThread() const OVERRIDE; | 35 virtual bool OpacityCanAnimateOnImplThread() const OVERRIDE; |
36 | 36 |
37 WebKit::WebScrollbar::Orientation Orientation() const; | 37 WebKit::WebScrollbar::Orientation Orientation() const; |
38 | 38 |
39 // Layer interface | 39 // Layer interface |
40 virtual void SetTexturePriorities(const PriorityCalculator& priority_calc) | 40 virtual void SetTexturePriorities(const PriorityCalculator& priority_calc) |
41 OVERRIDE; | 41 OVERRIDE; |
42 virtual void Update(ResourceUpdateQueue* queue, | 42 virtual void Update(ResourceUpdateQueue* queue, |
43 const OcclusionTracker* occlusion, | 43 const OcclusionTracker* occlusion, |
44 RenderingStats* stats) OVERRIDE; | 44 RenderingStats* stats) OVERRIDE; |
45 virtual void SetLayerTreeHost(LayerTreeHost* host) OVERRIDE; | 45 virtual void SetLayerTreeHost(LayerTreeHost* host) OVERRIDE; |
46 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; | 46 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; |
47 virtual void CalculateContentsScale(float ideal_contents_scale, | 47 virtual void CalculateContentsScale(float ideal_contents_scale, |
48 bool animating_transform_to_screen, | 48 bool animating_transform_to_screen, |
49 float* contents_scale_x, | 49 float* contents_scale_x, |
50 float* contents_scale_y, | 50 float* contents_scale_y, |
51 gfx::Size* contentBounds) OVERRIDE; | 51 gfx::Size* content_bounds) OVERRIDE; |
52 | 52 |
53 virtual ScrollbarLayer* ToScrollbarLayer() OVERRIDE; | 53 virtual ScrollbarLayer* ToScrollbarLayer() OVERRIDE; |
54 | 54 |
55 protected: | 55 protected: |
56 ScrollbarLayer( | 56 ScrollbarLayer( |
57 scoped_ptr<WebKit::WebScrollbar>, | 57 scoped_ptr<WebKit::WebScrollbar> scrollbar, |
58 scoped_ptr<ScrollbarThemePainter>, | 58 scoped_ptr<ScrollbarThemePainter> painter, |
59 scoped_ptr<WebKit::WebScrollbarThemeGeometry>, | 59 scoped_ptr<WebKit::WebScrollbarThemeGeometry> geometry, |
60 int scrollLayerId); | 60 int scroll_layer_id); |
61 virtual ~ScrollbarLayer(); | 61 virtual ~ScrollbarLayer(); |
62 | 62 |
63 private: | 63 private: |
64 void UpdatePart(CachingBitmapContentLayerUpdater* painter, | 64 void UpdatePart(CachingBitmapContentLayerUpdater* painter, |
65 LayerUpdater::Resource* resource, | 65 LayerUpdater::Resource* resource, |
66 gfx::Rect rect, | 66 gfx::Rect rect, |
67 ResourceUpdateQueue* queue, | 67 ResourceUpdateQueue* queue, |
68 RenderingStats* stats); | 68 RenderingStats* stats); |
69 void CreateUpdaterIfNeeded(); | 69 void CreateUpdaterIfNeeded(); |
70 gfx::Rect ScrollbarLayerRectToContentRect(gfx::Rect layer_rect) const; | 70 gfx::Rect ScrollbarLayerRectToContentRect(gfx::Rect layer_rect) const; |
(...skipping 19 matching lines...) Expand all Loading... |
90 | 90 |
91 // All the parts of the scrollbar except the thumb | 91 // All the parts of the scrollbar except the thumb |
92 scoped_ptr<LayerUpdater::Resource> back_track_; | 92 scoped_ptr<LayerUpdater::Resource> back_track_; |
93 scoped_ptr<LayerUpdater::Resource> fore_track_; | 93 scoped_ptr<LayerUpdater::Resource> fore_track_; |
94 scoped_ptr<LayerUpdater::Resource> thumb_; | 94 scoped_ptr<LayerUpdater::Resource> thumb_; |
95 }; | 95 }; |
96 | 96 |
97 } // namespace cc | 97 } // namespace cc |
98 | 98 |
99 #endif // CC_LAYERS_SCROLLBAR_LAYER_H_ | 99 #endif // CC_LAYERS_SCROLLBAR_LAYER_H_ |
OLD | NEW |