| 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 ScrollbarLayerChromium_h | 6 #ifndef ScrollbarLayerChromium_h |
| 7 #define ScrollbarLayerChromium_h | 7 #define ScrollbarLayerChromium_h |
| 8 | 8 |
| 9 #include "caching_bitmap_content_layer_updater.h" | 9 #include "caching_bitmap_content_layer_updater.h" |
| 10 #include "cc/layer.h" | 10 #include "cc/layer.h" |
| 11 #include <public/WebScrollbar.h> | 11 #include <public/WebScrollbar.h> |
| 12 #include <public/WebScrollbarThemeGeometry.h> | 12 #include <public/WebScrollbarThemeGeometry.h> |
| 13 #include <public/WebScrollbarThemePainter.h> | 13 #include <public/WebScrollbarThemePainter.h> |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 | 16 |
| 17 class ResourceUpdateQueue; |
| 17 class Scrollbar; | 18 class Scrollbar; |
| 18 class ScrollbarThemeComposite; | 19 class ScrollbarThemeComposite; |
| 19 class TextureUpdateQueue; | |
| 20 | 20 |
| 21 class ScrollbarLayer : public Layer { | 21 class ScrollbarLayer : public Layer { |
| 22 public: | 22 public: |
| 23 virtual scoped_ptr<LayerImpl> createLayerImpl() OVERRIDE; | 23 virtual scoped_ptr<LayerImpl> createLayerImpl() OVERRIDE; |
| 24 | 24 |
| 25 static scoped_refptr<ScrollbarLayer> create(scoped_ptr<WebKit::WebScrollbar>
, WebKit::WebScrollbarThemePainter, scoped_ptr<WebKit::WebScrollbarThemeGeometry
>, int scrollLayerId); | 25 static scoped_refptr<ScrollbarLayer> create(scoped_ptr<WebKit::WebScrollbar>
, WebKit::WebScrollbarThemePainter, scoped_ptr<WebKit::WebScrollbarThemeGeometry
>, int scrollLayerId); |
| 26 | 26 |
| 27 // Layer interface | 27 // Layer interface |
| 28 virtual bool needsContentsScale() const OVERRIDE; | 28 virtual bool needsContentsScale() const OVERRIDE; |
| 29 virtual IntSize contentBounds() const OVERRIDE; | 29 virtual IntSize contentBounds() const OVERRIDE; |
| 30 virtual void setTexturePriorities(const PriorityCalculator&) OVERRIDE; | 30 virtual void setTexturePriorities(const PriorityCalculator&) OVERRIDE; |
| 31 virtual void update(TextureUpdateQueue&, const OcclusionTracker*, RenderingS
tats&) OVERRIDE; | 31 virtual void update(ResourceUpdateQueue&, const OcclusionTracker*, Rendering
Stats&) OVERRIDE; |
| 32 virtual void setLayerTreeHost(LayerTreeHost*) OVERRIDE; | 32 virtual void setLayerTreeHost(LayerTreeHost*) OVERRIDE; |
| 33 virtual void pushPropertiesTo(LayerImpl*) OVERRIDE; | 33 virtual void pushPropertiesTo(LayerImpl*) OVERRIDE; |
| 34 | 34 |
| 35 int scrollLayerId() const { return m_scrollLayerId; } | 35 int scrollLayerId() const { return m_scrollLayerId; } |
| 36 void setScrollLayerId(int id) { m_scrollLayerId = id; } | 36 void setScrollLayerId(int id) { m_scrollLayerId = id; } |
| 37 | 37 |
| 38 virtual ScrollbarLayer* toScrollbarLayer() OVERRIDE; | 38 virtual ScrollbarLayer* toScrollbarLayer() OVERRIDE; |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 ScrollbarLayer(scoped_ptr<WebKit::WebScrollbar>, WebKit::WebScrollbarThemePa
inter, scoped_ptr<WebKit::WebScrollbarThemeGeometry>, int scrollLayerId); | 41 ScrollbarLayer(scoped_ptr<WebKit::WebScrollbar>, WebKit::WebScrollbarThemePa
inter, scoped_ptr<WebKit::WebScrollbarThemeGeometry>, int scrollLayerId); |
| 42 virtual ~ScrollbarLayer(); | 42 virtual ~ScrollbarLayer(); |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 void updatePart(CachingBitmapContentLayerUpdater*, LayerUpdater::Resource*,
const IntRect&, TextureUpdateQueue&, RenderingStats&); | 45 void updatePart(CachingBitmapContentLayerUpdater*, LayerUpdater::Resource*,
const IntRect&, ResourceUpdateQueue&, RenderingStats&); |
| 46 void createUpdaterIfNeeded(); | 46 void createUpdaterIfNeeded(); |
| 47 | 47 |
| 48 scoped_ptr<WebKit::WebScrollbar> m_scrollbar; | 48 scoped_ptr<WebKit::WebScrollbar> m_scrollbar; |
| 49 WebKit::WebScrollbarThemePainter m_painter; | 49 WebKit::WebScrollbarThemePainter m_painter; |
| 50 scoped_ptr<WebKit::WebScrollbarThemeGeometry> m_geometry; | 50 scoped_ptr<WebKit::WebScrollbarThemeGeometry> m_geometry; |
| 51 int m_scrollLayerId; | 51 int m_scrollLayerId; |
| 52 | 52 |
| 53 GLenum m_textureFormat; | 53 GLenum m_textureFormat; |
| 54 | 54 |
| 55 scoped_refptr<CachingBitmapContentLayerUpdater> m_backTrackUpdater; | 55 scoped_refptr<CachingBitmapContentLayerUpdater> m_backTrackUpdater; |
| 56 scoped_refptr<CachingBitmapContentLayerUpdater> m_foreTrackUpdater; | 56 scoped_refptr<CachingBitmapContentLayerUpdater> m_foreTrackUpdater; |
| 57 scoped_refptr<CachingBitmapContentLayerUpdater> m_thumbUpdater; | 57 scoped_refptr<CachingBitmapContentLayerUpdater> m_thumbUpdater; |
| 58 | 58 |
| 59 // All the parts of the scrollbar except the thumb | 59 // All the parts of the scrollbar except the thumb |
| 60 scoped_ptr<LayerUpdater::Resource> m_backTrack; | 60 scoped_ptr<LayerUpdater::Resource> m_backTrack; |
| 61 scoped_ptr<LayerUpdater::Resource> m_foreTrack; | 61 scoped_ptr<LayerUpdater::Resource> m_foreTrack; |
| 62 scoped_ptr<LayerUpdater::Resource> m_thumb; | 62 scoped_ptr<LayerUpdater::Resource> m_thumb; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } | 65 } |
| 66 #endif | 66 #endif |
| OLD | NEW |