| 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_canvas_layer_texture_updater.h" | 9 #include "caching_bitmap_canvas_layer_texture_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 Scrollbar; | 17 class Scrollbar; |
| 18 class ScrollbarThemeComposite; | 18 class ScrollbarThemeComposite; |
| 19 class CCTextureUpdateQueue; | 19 class TextureUpdateQueue; |
| 20 | 20 |
| 21 class ScrollbarLayerChromium : public LayerChromium { | 21 class ScrollbarLayer : public Layer { |
| 22 public: | 22 public: |
| 23 virtual scoped_ptr<CCLayerImpl> createCCLayerImpl() OVERRIDE; | 23 virtual scoped_ptr<LayerImpl> createLayerImpl() OVERRIDE; |
| 24 | 24 |
| 25 static scoped_refptr<ScrollbarLayerChromium> create(scoped_ptr<WebKit::WebSc
rollbar>, WebKit::WebScrollbarThemePainter, scoped_ptr<WebKit::WebScrollbarTheme
Geometry>, int scrollLayerId); | 25 static scoped_refptr<ScrollbarLayer> create(scoped_ptr<WebKit::WebScrollbar>
, WebKit::WebScrollbarThemePainter, scoped_ptr<WebKit::WebScrollbarThemeGeometry
>, int scrollLayerId); |
| 26 | 26 |
| 27 // LayerChromium 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 CCPriorityCalculator&) OVERRIDE; | 30 virtual void setTexturePriorities(const PriorityCalculator&) OVERRIDE; |
| 31 virtual void update(CCTextureUpdateQueue&, const CCOcclusionTracker*, CCRend
eringStats&) OVERRIDE; | 31 virtual void update(TextureUpdateQueue&, const OcclusionTracker*, RenderingS
tats&) OVERRIDE; |
| 32 virtual void setLayerTreeHost(CCLayerTreeHost*) OVERRIDE; | 32 virtual void setLayerTreeHost(LayerTreeHost*) OVERRIDE; |
| 33 virtual void pushPropertiesTo(CCLayerImpl*) 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 ScrollbarLayerChromium* toScrollbarLayerChromium() OVERRIDE; | 38 virtual ScrollbarLayer* toScrollbarLayer() OVERRIDE; |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 ScrollbarLayerChromium(scoped_ptr<WebKit::WebScrollbar>, WebKit::WebScrollba
rThemePainter, scoped_ptr<WebKit::WebScrollbarThemeGeometry>, int scrollLayerId)
; | 41 ScrollbarLayer(scoped_ptr<WebKit::WebScrollbar>, WebKit::WebScrollbarThemePa
inter, scoped_ptr<WebKit::WebScrollbarThemeGeometry>, int scrollLayerId); |
| 42 virtual ~ScrollbarLayerChromium(); | 42 virtual ~ScrollbarLayer(); |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 void updatePart(CachingBitmapCanvasLayerTextureUpdater*, LayerTextureUpdater
::Texture*, const IntRect&, CCTextureUpdateQueue&, CCRenderingStats&); | 45 void updatePart(CachingBitmapCanvasLayerTextureUpdater*, LayerTextureUpdater
::Texture*, const IntRect&, TextureUpdateQueue&, RenderingStats&); |
| 46 void createTextureUpdaterIfNeeded(); | 46 void createTextureUpdaterIfNeeded(); |
| 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 GC3Denum m_textureFormat; | 53 GC3Denum m_textureFormat; |
| 54 | 54 |
| 55 scoped_refptr<CachingBitmapCanvasLayerTextureUpdater> m_backTrackUpdater; | 55 scoped_refptr<CachingBitmapCanvasLayerTextureUpdater> m_backTrackUpdater; |
| 56 scoped_refptr<CachingBitmapCanvasLayerTextureUpdater> m_foreTrackUpdater; | 56 scoped_refptr<CachingBitmapCanvasLayerTextureUpdater> m_foreTrackUpdater; |
| 57 scoped_refptr<CachingBitmapCanvasLayerTextureUpdater> m_thumbUpdater; | 57 scoped_refptr<CachingBitmapCanvasLayerTextureUpdater> 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<LayerTextureUpdater::Texture> m_backTrack; | 60 scoped_ptr<LayerTextureUpdater::Texture> m_backTrack; |
| 61 scoped_ptr<LayerTextureUpdater::Texture> m_foreTrack; | 61 scoped_ptr<LayerTextureUpdater::Texture> m_foreTrack; |
| 62 scoped_ptr<LayerTextureUpdater::Texture> m_thumb; | 62 scoped_ptr<LayerTextureUpdater::Texture> m_thumb; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } | 65 } |
| 66 #endif | 66 #endif |
| OLD | NEW |