| 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_SCROLLBAR_LAYER_H_ | 5 #ifndef CC_SCROLLBAR_LAYER_H_ |
| 6 #define CC_SCROLLBAR_LAYER_H_ | 6 #define CC_SCROLLBAR_LAYER_H_ |
| 7 | 7 |
| 8 #include "cc/cc_export.h" | 8 #include "cc/cc_export.h" |
| 9 #include "cc/contents_scaling_layer.h" | 9 #include "cc/contents_scaling_layer.h" |
| 10 #include "cc/layer_updater.h" | 10 #include "cc/layer_updater.h" |
| 11 #include "cc/scrollbar_theme_painter.h" | 11 #include "cc/scrollbar_theme_painter.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>, |
| 28 scoped_ptr<ScrollbarThemePainter>, | 28 scoped_ptr<ScrollbarThemePainter>, |
| 29 scoped_ptr<WebKit::WebScrollbarThemeGeometry>, | 29 scoped_ptr<WebKit::WebScrollbarThemeGeometry>, |
| 30 int scrollLayerId); | 30 int scrollLayerId); |
| 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 WebKit::WebScrollbar::Orientation Orientation() const; | 35 WebKit::WebScrollbar::Orientation Orientation() const; |
| 36 | 36 |
| 37 // Layer interface | 37 // Layer interface |
| 38 virtual void setTexturePriorities(const PriorityCalculator& priority_calc) | 38 virtual void SetTexturePriorities(const PriorityCalculator& priority_calc) |
| 39 OVERRIDE; | 39 OVERRIDE; |
| 40 virtual void update(ResourceUpdateQueue& queue, | 40 virtual void Update(ResourceUpdateQueue* queue, |
| 41 const OcclusionTracker* occlusion, | 41 const OcclusionTracker* occlusion, |
| 42 RenderingStats* stats) OVERRIDE; | 42 RenderingStats* stats) OVERRIDE; |
| 43 virtual void setLayerTreeHost(LayerTreeHost* host) OVERRIDE; | 43 virtual void SetLayerTreeHost(LayerTreeHost* host) OVERRIDE; |
| 44 virtual void pushPropertiesTo(LayerImpl* layer) OVERRIDE; | 44 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; |
| 45 virtual void calculateContentsScale(float ideal_contents_scale, | 45 virtual void CalculateContentsScale(float ideal_contents_scale, |
| 46 bool animating_transform_to_screen, | 46 bool animating_transform_to_screen, |
| 47 float* contents_scale_x, | 47 float* contents_scale_x, |
| 48 float* contents_scale_y, | 48 float* contents_scale_y, |
| 49 gfx::Size* contentBounds) OVERRIDE; | 49 gfx::Size* contentBounds) OVERRIDE; |
| 50 | 50 |
| 51 virtual ScrollbarLayer* toScrollbarLayer() OVERRIDE; | 51 virtual ScrollbarLayer* ToScrollbarLayer() OVERRIDE; |
| 52 | 52 |
| 53 protected: | 53 protected: |
| 54 ScrollbarLayer( | 54 ScrollbarLayer( |
| 55 scoped_ptr<WebKit::WebScrollbar>, | 55 scoped_ptr<WebKit::WebScrollbar>, |
| 56 scoped_ptr<ScrollbarThemePainter>, | 56 scoped_ptr<ScrollbarThemePainter>, |
| 57 scoped_ptr<WebKit::WebScrollbarThemeGeometry>, | 57 scoped_ptr<WebKit::WebScrollbarThemeGeometry>, |
| 58 int scrollLayerId); | 58 int scrollLayerId); |
| 59 virtual ~ScrollbarLayer(); | 59 virtual ~ScrollbarLayer(); |
| 60 | 60 |
| 61 private: | 61 private: |
| (...skipping 26 matching lines...) Expand all Loading... |
| 88 | 88 |
| 89 // All the parts of the scrollbar except the thumb | 89 // All the parts of the scrollbar except the thumb |
| 90 scoped_ptr<LayerUpdater::Resource> back_track_; | 90 scoped_ptr<LayerUpdater::Resource> back_track_; |
| 91 scoped_ptr<LayerUpdater::Resource> fore_track_; | 91 scoped_ptr<LayerUpdater::Resource> fore_track_; |
| 92 scoped_ptr<LayerUpdater::Resource> thumb_; | 92 scoped_ptr<LayerUpdater::Resource> thumb_; |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 } // namespace cc | 95 } // namespace cc |
| 96 | 96 |
| 97 #endif // CC_SCROLLBAR_LAYER_H_ | 97 #endif // CC_SCROLLBAR_LAYER_H_ |
| OLD | NEW |