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 "cc/scrollbar_layer_impl.h" | 5 #include "cc/scrollbar_layer_impl.h" |
6 | 6 |
7 #include "cc/layer_tree_impl.h" | 7 #include "cc/layer_tree_impl.h" |
8 #include "cc/quad_sink.h" | 8 #include "cc/quad_sink.h" |
9 #include "cc/scrollbar_animation_controller.h" | 9 #include "cc/scrollbar_animation_controller.h" |
10 #include "cc/texture_draw_quad.h" | 10 #include "cc/texture_draw_quad.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 , m_scrollbarOverlayStyle(WebScrollbar::ScrollbarOverlayStyleDefault) | 34 , m_scrollbarOverlayStyle(WebScrollbar::ScrollbarOverlayStyleDefault) |
35 , m_orientation(WebScrollbar::Horizontal) | 35 , m_orientation(WebScrollbar::Horizontal) |
36 , m_controlSize(WebScrollbar::RegularScrollbar) | 36 , m_controlSize(WebScrollbar::RegularScrollbar) |
37 , m_pressedPart(WebScrollbar::NoPart) | 37 , m_pressedPart(WebScrollbar::NoPart) |
38 , m_hoveredPart(WebScrollbar::NoPart) | 38 , m_hoveredPart(WebScrollbar::NoPart) |
39 , m_isScrollableAreaActive(false) | 39 , m_isScrollableAreaActive(false) |
40 , m_isScrollViewScrollbar(false) | 40 , m_isScrollViewScrollbar(false) |
41 , m_enabled(false) | 41 , m_enabled(false) |
42 , m_isCustomScrollbar(false) | 42 , m_isCustomScrollbar(false) |
43 , m_isOverlayScrollbar(false) | 43 , m_isOverlayScrollbar(false) |
| 44 , m_isPinchZoomScrollbar(false) |
44 { | 45 { |
45 } | 46 } |
46 | 47 |
47 ScrollbarLayerImpl::~ScrollbarLayerImpl() | 48 ScrollbarLayerImpl::~ScrollbarLayerImpl() |
48 { | 49 { |
49 } | 50 } |
50 | 51 |
51 ScrollbarLayerImpl* ScrollbarLayerImpl::toScrollbarLayer() | 52 ScrollbarLayerImpl* ScrollbarLayerImpl::toScrollbarLayer() |
52 { | 53 { |
53 return this; | 54 return this; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 scrollbarLayer->setScrollbarData(&m_scrollbar); | 130 scrollbarLayer->setScrollbarData(&m_scrollbar); |
130 scrollbarLayer->setThumbSize(m_thumbSize); | 131 scrollbarLayer->setThumbSize(m_thumbSize); |
131 | 132 |
132 scrollbarLayer->setBackTrackResourceId(m_backTrackResourceId); | 133 scrollbarLayer->setBackTrackResourceId(m_backTrackResourceId); |
133 scrollbarLayer->setForeTrackResourceId(m_foreTrackResourceId); | 134 scrollbarLayer->setForeTrackResourceId(m_foreTrackResourceId); |
134 scrollbarLayer->setThumbResourceId(m_thumbResourceId); | 135 scrollbarLayer->setThumbResourceId(m_thumbResourceId); |
135 } | 136 } |
136 | 137 |
137 void ScrollbarLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& append
QuadsData) | 138 void ScrollbarLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& append
QuadsData) |
138 { | 139 { |
| 140 if (isPinchZoomScrollbar()) { |
| 141 LayerImpl* rootScrollLayer = layerTreeImpl()->RootScrollLayer(); |
| 142 LayerImpl* currentlyScrollingLayer = layerTreeImpl()->CurrentlyScrolling
Layer(); |
| 143 bool pinchZoomScrollbarShouldDraw = rootScrollLayer && |
| 144 rootScrollLayer == currentlyScrollin
gLayer && |
| 145 layerTreeImpl()->total_page_scale_fa
ctor() > 1; |
| 146 if (!pinchZoomScrollbarShouldDraw) |
| 147 return; |
| 148 } |
| 149 |
139 bool premultipledAlpha = false; | 150 bool premultipledAlpha = false; |
140 bool flipped = false; | 151 bool flipped = false; |
141 gfx::PointF uvTopLeft(0.f, 0.f); | 152 gfx::PointF uvTopLeft(0.f, 0.f); |
142 gfx::PointF uvBottomRight(1.f, 1.f); | 153 gfx::PointF uvBottomRight(1.f, 1.f); |
143 gfx::Rect boundsRect(gfx::Point(), bounds()); | 154 gfx::Rect boundsRect(gfx::Point(), bounds()); |
144 gfx::Rect contentBoundsRect(gfx::Point(), contentBounds()); | 155 gfx::Rect contentBoundsRect(gfx::Point(), contentBounds()); |
145 | 156 |
146 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); | 157 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); |
147 appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData); | 158 appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData); |
148 | 159 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 { | 283 { |
273 return m_owner->m_isCustomScrollbar; | 284 return m_owner->m_isCustomScrollbar; |
274 } | 285 } |
275 | 286 |
276 const char* ScrollbarLayerImpl::layerTypeAsString() const | 287 const char* ScrollbarLayerImpl::layerTypeAsString() const |
277 { | 288 { |
278 return "ScrollbarLayer"; | 289 return "ScrollbarLayer"; |
279 } | 290 } |
280 | 291 |
281 } // namespace cc | 292 } // namespace cc |
OLD | NEW |