OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * |
| 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions |
| 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the |
| 11 * documentation and/or other materials provided with the distribution. |
| 12 * |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y |
| 17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N |
| 20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 23 */ |
| 24 |
| 25 |
| 26 #ifndef ScrollbarLayerChromium_h |
| 27 #define ScrollbarLayerChromium_h |
| 28 |
| 29 #if USE(ACCELERATED_COMPOSITING) |
| 30 |
| 31 #include "LayerChromium.h" |
| 32 #include "LayerTextureUpdater.h" |
| 33 #include "ScrollTypes.h" |
| 34 |
| 35 namespace WebCore { |
| 36 |
| 37 class Scrollbar; |
| 38 class ScrollbarThemeComposite; |
| 39 class CCTextureUpdater; |
| 40 |
| 41 class ScrollbarLayerChromium : public LayerChromium { |
| 42 public: |
| 43 virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl(); |
| 44 static PassRefPtr<ScrollbarLayerChromium> create(Scrollbar*, int scrollLayer
Id); |
| 45 |
| 46 // LayerChromium interface |
| 47 virtual void update(CCTextureUpdater&, const CCOcclusionTracker*) OVERRIDE; |
| 48 virtual void setLayerTreeHost(CCLayerTreeHost*) OVERRIDE; |
| 49 virtual void pushPropertiesTo(CCLayerImpl*) OVERRIDE; |
| 50 |
| 51 int scrollLayerId() const { return m_scrollLayerId; } |
| 52 void setScrollLayerId(int id) { m_scrollLayerId = id; } |
| 53 |
| 54 virtual ScrollbarLayerChromium* toScrollbarLayerChromium() { return this; } |
| 55 |
| 56 protected: |
| 57 ScrollbarLayerChromium(Scrollbar*, int scrollLayerId); |
| 58 |
| 59 private: |
| 60 ScrollbarThemeComposite* theme() const; |
| 61 void updatePart(LayerTextureUpdater*, LayerTextureUpdater::Texture*, const I
ntRect&, CCTextureUpdater&); |
| 62 void createTextureUpdaterIfNeeded(); |
| 63 |
| 64 RefPtr<Scrollbar> m_scrollbar; |
| 65 int m_scrollLayerId; |
| 66 |
| 67 GC3Denum m_textureFormat; |
| 68 |
| 69 RefPtr<LayerTextureUpdater> m_backTrackUpdater; |
| 70 RefPtr<LayerTextureUpdater> m_foreTrackUpdater; |
| 71 RefPtr<LayerTextureUpdater> m_thumbUpdater; |
| 72 |
| 73 // All the parts of the scrollbar except the thumb |
| 74 OwnPtr<LayerTextureUpdater::Texture> m_backTrack; |
| 75 OwnPtr<LayerTextureUpdater::Texture> m_foreTrack; |
| 76 OwnPtr<LayerTextureUpdater::Texture> m_thumb; |
| 77 |
| 78 ScrollbarOverlayStyle m_scrollbarOverlayStyle; |
| 79 bool m_isScrollableAreaActive; |
| 80 bool m_isScrollViewScrollbar; |
| 81 |
| 82 ScrollbarOrientation m_orientation; |
| 83 |
| 84 ScrollbarControlSize m_controlSize; |
| 85 }; |
| 86 |
| 87 } |
| 88 #endif // USE(ACCELERATED_COMPOSITING) |
| 89 |
| 90 #endif |
OLD | NEW |