| 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 #if USE(ACCELERATED_COMPOSITING) | 9 #if USE(ACCELERATED_COMPOSITING) |
| 10 | 10 |
| 11 #include "LayerChromium.h" | 11 #include "LayerChromium.h" |
| 12 #include "LayerTextureUpdater.h" | 12 #include "LayerTextureUpdater.h" |
| 13 #include <public/WebScrollbar.h> | 13 #include <public/WebScrollbar.h> |
| 14 #include <public/WebScrollbarThemeGeometry.h> | 14 #include <public/WebScrollbarThemeGeometry.h> |
| 15 #include <public/WebScrollbarThemePainter.h> | 15 #include <public/WebScrollbarThemePainter.h> |
| 16 | 16 |
| 17 namespace cc { | 17 namespace cc { |
| 18 | 18 |
| 19 class Scrollbar; | 19 class Scrollbar; |
| 20 class ScrollbarThemeComposite; | 20 class ScrollbarThemeComposite; |
| 21 class CCTextureUpdateQueue; | 21 class CCTextureUpdateQueue; |
| 22 | 22 |
| 23 class ScrollbarLayerChromium : public LayerChromium { | 23 class ScrollbarLayerChromium : public LayerChromium { |
| 24 public: | 24 public: |
| 25 virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl() OVERRIDE; | 25 virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl() OVERRIDE; |
| 26 |
| 26 static PassRefPtr<ScrollbarLayerChromium> create(PassOwnPtr<WebKit::WebScrol
lbar>, WebKit::WebScrollbarThemePainter, PassOwnPtr<WebKit::WebScrollbarThemeGeo
metry>, int scrollLayerId); | 27 static PassRefPtr<ScrollbarLayerChromium> create(PassOwnPtr<WebKit::WebScrol
lbar>, WebKit::WebScrollbarThemePainter, PassOwnPtr<WebKit::WebScrollbarThemeGeo
metry>, int scrollLayerId); |
| 27 | 28 |
| 29 virtual ~ScrollbarLayerChromium(); |
| 30 |
| 28 // LayerChromium interface | 31 // LayerChromium interface |
| 29 virtual void setTexturePriorities(const CCPriorityCalculator&) OVERRIDE; | 32 virtual void setTexturePriorities(const CCPriorityCalculator&) OVERRIDE; |
| 30 virtual void update(CCTextureUpdateQueue&, const CCOcclusionTracker*, CCRend
eringStats&) OVERRIDE; | 33 virtual void update(CCTextureUpdateQueue&, const CCOcclusionTracker*, CCRend
eringStats&) OVERRIDE; |
| 31 virtual void setLayerTreeHost(CCLayerTreeHost*) OVERRIDE; | 34 virtual void setLayerTreeHost(CCLayerTreeHost*) OVERRIDE; |
| 32 virtual void pushPropertiesTo(CCLayerImpl*) OVERRIDE; | 35 virtual void pushPropertiesTo(CCLayerImpl*) OVERRIDE; |
| 33 | 36 |
| 34 int scrollLayerId() const { return m_scrollLayerId; } | 37 int scrollLayerId() const { return m_scrollLayerId; } |
| 35 void setScrollLayerId(int id) { m_scrollLayerId = id; } | 38 void setScrollLayerId(int id) { m_scrollLayerId = id; } |
| 36 | 39 |
| 37 virtual ScrollbarLayerChromium* toScrollbarLayerChromium() OVERRIDE { return
this; } | 40 virtual ScrollbarLayerChromium* toScrollbarLayerChromium() OVERRIDE; |
| 38 | 41 |
| 39 protected: | 42 protected: |
| 40 ScrollbarLayerChromium(PassOwnPtr<WebKit::WebScrollbar>, WebKit::WebScrollba
rThemePainter, PassOwnPtr<WebKit::WebScrollbarThemeGeometry>, int scrollLayerId)
; | 43 ScrollbarLayerChromium(PassOwnPtr<WebKit::WebScrollbar>, WebKit::WebScrollba
rThemePainter, PassOwnPtr<WebKit::WebScrollbarThemeGeometry>, int scrollLayerId)
; |
| 41 | 44 |
| 42 private: | 45 private: |
| 43 void updatePart(LayerTextureUpdater*, LayerTextureUpdater::Texture*, const I
ntRect&, CCTextureUpdateQueue&, CCRenderingStats&); | 46 void updatePart(LayerTextureUpdater*, LayerTextureUpdater::Texture*, const I
ntRect&, CCTextureUpdateQueue&, CCRenderingStats&); |
| 44 void createTextureUpdaterIfNeeded(); | 47 void createTextureUpdaterIfNeeded(); |
| 45 | 48 |
| 46 OwnPtr<WebKit::WebScrollbar> m_scrollbar; | 49 OwnPtr<WebKit::WebScrollbar> m_scrollbar; |
| 47 WebKit::WebScrollbarThemePainter m_painter; | 50 WebKit::WebScrollbarThemePainter m_painter; |
| 48 OwnPtr<WebKit::WebScrollbarThemeGeometry> m_geometry; | 51 OwnPtr<WebKit::WebScrollbarThemeGeometry> m_geometry; |
| 49 int m_scrollLayerId; | 52 int m_scrollLayerId; |
| 50 | 53 |
| 51 GC3Denum m_textureFormat; | 54 GC3Denum m_textureFormat; |
| 52 | 55 |
| 53 RefPtr<LayerTextureUpdater> m_backTrackUpdater; | 56 RefPtr<LayerTextureUpdater> m_backTrackUpdater; |
| 54 RefPtr<LayerTextureUpdater> m_foreTrackUpdater; | 57 RefPtr<LayerTextureUpdater> m_foreTrackUpdater; |
| 55 RefPtr<LayerTextureUpdater> m_thumbUpdater; | 58 RefPtr<LayerTextureUpdater> m_thumbUpdater; |
| 56 | 59 |
| 57 // All the parts of the scrollbar except the thumb | 60 // All the parts of the scrollbar except the thumb |
| 58 OwnPtr<LayerTextureUpdater::Texture> m_backTrack; | 61 OwnPtr<LayerTextureUpdater::Texture> m_backTrack; |
| 59 OwnPtr<LayerTextureUpdater::Texture> m_foreTrack; | 62 OwnPtr<LayerTextureUpdater::Texture> m_foreTrack; |
| 60 OwnPtr<LayerTextureUpdater::Texture> m_thumb; | 63 OwnPtr<LayerTextureUpdater::Texture> m_thumb; |
| 61 }; | 64 }; |
| 62 | 65 |
| 63 } | 66 } |
| 64 #endif // USE(ACCELERATED_COMPOSITING) | 67 #endif // USE(ACCELERATED_COMPOSITING) |
| 65 | 68 |
| 66 #endif | 69 #endif |
| OLD | NEW |