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 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #if USE(ACCELERATED_COMPOSITING) | 7 #if USE(ACCELERATED_COMPOSITING) |
8 | 8 |
9 #include "CCScrollbarLayerImpl.h" | 9 #include "CCScrollbarLayerImpl.h" |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 , m_pressedPart(WebScrollbar::NoPart) | 34 , m_pressedPart(WebScrollbar::NoPart) |
35 , m_hoveredPart(WebScrollbar::NoPart) | 35 , m_hoveredPart(WebScrollbar::NoPart) |
36 , m_isScrollableAreaActive(false) | 36 , m_isScrollableAreaActive(false) |
37 , m_isScrollViewScrollbar(false) | 37 , m_isScrollViewScrollbar(false) |
38 , m_enabled(false) | 38 , m_enabled(false) |
39 , m_isCustomScrollbar(false) | 39 , m_isCustomScrollbar(false) |
40 , m_isOverlayScrollbar(false) | 40 , m_isOverlayScrollbar(false) |
41 { | 41 { |
42 } | 42 } |
43 | 43 |
44 void CCScrollbarLayerImpl::setScrollbarGeometry(PassOwnPtr<WebKit::WebScrollbarT
hemeGeometry> geometry) | 44 void CCScrollbarLayerImpl::setScrollbarGeometry(PassOwnPtr<CCScrollbarGeometryFi
xedThumb> geometry) |
45 { | 45 { |
46 m_geometry = geometry; | 46 m_geometry = geometry; |
47 } | 47 } |
48 | 48 |
49 void CCScrollbarLayerImpl::setScrollbarData(const WebScrollbar* scrollbar) | 49 void CCScrollbarLayerImpl::setScrollbarData(WebScrollbar* scrollbar) |
50 { | 50 { |
51 m_scrollbarOverlayStyle = scrollbar->scrollbarOverlayStyle(); | 51 m_scrollbarOverlayStyle = scrollbar->scrollbarOverlayStyle(); |
52 m_orientation = scrollbar->orientation(); | 52 m_orientation = scrollbar->orientation(); |
53 m_controlSize = scrollbar->controlSize(); | 53 m_controlSize = scrollbar->controlSize(); |
54 m_pressedPart = scrollbar->pressedPart(); | 54 m_pressedPart = scrollbar->pressedPart(); |
55 m_hoveredPart = scrollbar->hoveredPart(); | 55 m_hoveredPart = scrollbar->hoveredPart(); |
56 m_isScrollableAreaActive = scrollbar->isScrollableAreaActive(); | 56 m_isScrollableAreaActive = scrollbar->isScrollableAreaActive(); |
57 m_isScrollViewScrollbar = scrollbar->isScrollViewScrollbar(); | 57 m_isScrollViewScrollbar = scrollbar->isScrollViewScrollbar(); |
58 m_enabled = scrollbar->enabled(); | 58 m_enabled = scrollbar->enabled(); |
59 m_isCustomScrollbar = scrollbar->isCustomScrollbar(); | 59 m_isCustomScrollbar = scrollbar->isCustomScrollbar(); |
60 m_isOverlayScrollbar = scrollbar->isOverlay(); | 60 m_isOverlayScrollbar = scrollbar->isOverlay(); |
61 | 61 |
62 scrollbar->getTickmarks(m_tickmarks); | 62 scrollbar->getTickmarks(m_tickmarks); |
| 63 |
| 64 m_geometry->update(scrollbar); |
63 } | 65 } |
64 | 66 |
65 static FloatRect toUVRect(const WebRect& r, const IntRect& bounds) | 67 static FloatRect toUVRect(const WebRect& r, const IntRect& bounds) |
66 { | 68 { |
67 return FloatRect(static_cast<float>(r.x) / bounds.width(), static_cast<float
>(r.y) / bounds.height(), | 69 return FloatRect(static_cast<float>(r.x) / bounds.width(), static_cast<float
>(r.y) / bounds.height(), |
68 static_cast<float>(r.width) / bounds.width(), static_cast<f
loat>(r.height) / bounds.height()); | 70 static_cast<float>(r.width) / bounds.width(), static_cast<f
loat>(r.height) / bounds.height()); |
69 } | 71 } |
70 | 72 |
71 void CCScrollbarLayerImpl::appendQuads(CCQuadSink& quadSink, bool&) | 73 void CCScrollbarLayerImpl::appendQuads(CCQuadSink& quadSink, bool&) |
72 { | 74 { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 return m_owner->m_orientation; | 186 return m_owner->m_orientation; |
185 } | 187 } |
186 | 188 |
187 bool CCScrollbarLayerImpl::CCScrollbar::isCustomScrollbar() const | 189 bool CCScrollbarLayerImpl::CCScrollbar::isCustomScrollbar() const |
188 { | 190 { |
189 return m_owner->m_isCustomScrollbar; | 191 return m_owner->m_isCustomScrollbar; |
190 } | 192 } |
191 | 193 |
192 } | 194 } |
193 #endif // USE(ACCELERATED_COMPOSITING) | 195 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |