| 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 | 5 |
| 6 #ifndef CC_SCROLLBAR_LAYER_H_ | 6 #ifndef CC_SCROLLBAR_LAYER_H_ |
| 7 #define CC_SCROLLBAR_LAYER_H_ | 7 #define CC_SCROLLBAR_LAYER_H_ |
| 8 | 8 |
| 9 #include "cc/cc_export.h" | 9 #include "cc/cc_export.h" |
| 10 #include "cc/contents_scaling_layer.h" | 10 #include "cc/contents_scaling_layer.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 scoped_ptr<WebKit::WebScrollbarThemeGeometry>, | 29 scoped_ptr<WebKit::WebScrollbarThemeGeometry>, |
| 30 int scrollLayerId); | 30 int scrollLayerId); |
| 31 | 31 |
| 32 int scrollLayerId() const { return m_scrollLayerId; } | 32 int scrollLayerId() const { return m_scrollLayerId; } |
| 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&) OVERRIDE; | 38 virtual void setTexturePriorities(const PriorityCalculator&) OVERRIDE; |
| 39 virtual void update(ResourceUpdateQueue&, const OcclusionTracker*, Rendering
Stats&) OVERRIDE; | 39 virtual void update(ResourceUpdateQueue&, const OcclusionTracker*, Rendering
Stats*) OVERRIDE; |
| 40 virtual void setLayerTreeHost(LayerTreeHost*) OVERRIDE; | 40 virtual void setLayerTreeHost(LayerTreeHost*) OVERRIDE; |
| 41 virtual void pushPropertiesTo(LayerImpl*) OVERRIDE; | 41 virtual void pushPropertiesTo(LayerImpl*) OVERRIDE; |
| 42 virtual void calculateContentsScale( | 42 virtual void calculateContentsScale( |
| 43 float idealContentsScale, | 43 float idealContentsScale, |
| 44 float* contentsScaleX, | 44 float* contentsScaleX, |
| 45 float* contentsScaleY, | 45 float* contentsScaleY, |
| 46 gfx::Size* contentBounds) OVERRIDE; | 46 gfx::Size* contentBounds) OVERRIDE; |
| 47 | 47 |
| 48 virtual ScrollbarLayer* toScrollbarLayer() OVERRIDE; | 48 virtual ScrollbarLayer* toScrollbarLayer() OVERRIDE; |
| 49 | 49 |
| 50 protected: | 50 protected: |
| 51 ScrollbarLayer( | 51 ScrollbarLayer( |
| 52 scoped_ptr<WebKit::WebScrollbar>, | 52 scoped_ptr<WebKit::WebScrollbar>, |
| 53 scoped_ptr<ScrollbarThemePainter>, | 53 scoped_ptr<ScrollbarThemePainter>, |
| 54 scoped_ptr<WebKit::WebScrollbarThemeGeometry>, | 54 scoped_ptr<WebKit::WebScrollbarThemeGeometry>, |
| 55 int scrollLayerId); | 55 int scrollLayerId); |
| 56 virtual ~ScrollbarLayer(); | 56 virtual ~ScrollbarLayer(); |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 void updatePart(CachingBitmapContentLayerUpdater*, LayerUpdater::Resource*,
const gfx::Rect&, ResourceUpdateQueue&, RenderingStats&); | 59 void updatePart(CachingBitmapContentLayerUpdater*, LayerUpdater::Resource*,
const gfx::Rect&, ResourceUpdateQueue&, RenderingStats*); |
| 60 void createUpdaterIfNeeded(); | 60 void createUpdaterIfNeeded(); |
| 61 gfx::Rect scrollbarLayerRectToContentRect(const gfx::Rect& layerRect) const; | 61 gfx::Rect scrollbarLayerRectToContentRect(const gfx::Rect& layerRect) const; |
| 62 | 62 |
| 63 bool isDirty() const { return !m_dirtyRect.IsEmpty(); } | 63 bool isDirty() const { return !m_dirtyRect.IsEmpty(); } |
| 64 | 64 |
| 65 int maxTextureSize(); | 65 int maxTextureSize(); |
| 66 float clampScaleToMaxTextureSize(float scale); | 66 float clampScaleToMaxTextureSize(float scale); |
| 67 | 67 |
| 68 scoped_ptr<WebKit::WebScrollbar> m_scrollbar; | 68 scoped_ptr<WebKit::WebScrollbar> m_scrollbar; |
| 69 scoped_ptr<ScrollbarThemePainter> m_painter; | 69 scoped_ptr<ScrollbarThemePainter> m_painter; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 80 scoped_refptr<CachingBitmapContentLayerUpdater> m_thumbUpdater; | 80 scoped_refptr<CachingBitmapContentLayerUpdater> m_thumbUpdater; |
| 81 | 81 |
| 82 // All the parts of the scrollbar except the thumb | 82 // All the parts of the scrollbar except the thumb |
| 83 scoped_ptr<LayerUpdater::Resource> m_backTrack; | 83 scoped_ptr<LayerUpdater::Resource> m_backTrack; |
| 84 scoped_ptr<LayerUpdater::Resource> m_foreTrack; | 84 scoped_ptr<LayerUpdater::Resource> m_foreTrack; |
| 85 scoped_ptr<LayerUpdater::Resource> m_thumb; | 85 scoped_ptr<LayerUpdater::Resource> m_thumb; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } | 88 } |
| 89 #endif // CC_SCROLLBAR_LAYER_H_ | 89 #endif // CC_SCROLLBAR_LAYER_H_ |
| OLD | NEW |