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.h" | 5 #include "cc/scrollbar_layer.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "cc/caching_bitmap_content_layer_updater.h" | 9 #include "cc/caching_bitmap_content_layer_updater.h" |
10 #include "cc/layer_painter.h" | 10 #include "cc/layer_painter.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 m_scrollLayerId = id; | 58 m_scrollLayerId = id; |
59 setNeedsFullTreeSync(); | 59 setNeedsFullTreeSync(); |
60 } | 60 } |
61 | 61 |
62 WebKit::WebScrollbar::Orientation ScrollbarLayer::orientation() const | 62 WebKit::WebScrollbar::Orientation ScrollbarLayer::orientation() const |
63 { | 63 { |
64 return m_scrollbar->orientation(); | 64 return m_scrollbar->orientation(); |
65 } | 65 } |
66 | 66 |
| 67 bool ScrollbarLayer::isOverlay() const |
| 68 { |
| 69 return m_scrollbar->isOverlay(); |
| 70 } |
| 71 |
67 int ScrollbarLayer::maxTextureSize() { | 72 int ScrollbarLayer::maxTextureSize() { |
68 DCHECK(layerTreeHost()); | 73 DCHECK(layerTreeHost()); |
69 return layerTreeHost()->rendererCapabilities().maxTextureSize; | 74 return layerTreeHost()->rendererCapabilities().maxTextureSize; |
70 } | 75 } |
71 | 76 |
72 float ScrollbarLayer::clampScaleToMaxTextureSize(float scale) { | 77 float ScrollbarLayer::clampScaleToMaxTextureSize(float scale) { |
73 if (layerTreeHost()->settings().solidColorScrollbars) | 78 if (layerTreeHost()->settings().solidColorScrollbars) |
74 return scale; | 79 return scale; |
75 | 80 |
76 // If the scaled contentBounds() is bigger than the max texture size of the | 81 // If the scaled contentBounds() is bigger than the max texture size of the |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 gfx::Rect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); | 351 gfx::Rect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); |
347 m_thumbSize = thumbRect.size(); | 352 m_thumbSize = thumbRect.size(); |
348 gfx::Rect originThumbRect = scrollbarLayerRectToContentRect(gfx::Rect(thumbR
ect.size())); | 353 gfx::Rect originThumbRect = scrollbarLayerRectToContentRect(gfx::Rect(thumbR
ect.size())); |
349 if (!originThumbRect.IsEmpty()) | 354 if (!originThumbRect.IsEmpty()) |
350 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue,
stats); | 355 updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue,
stats); |
351 | 356 |
352 m_dirtyRect = gfx::RectF(); | 357 m_dirtyRect = gfx::RectF(); |
353 } | 358 } |
354 | 359 |
355 } // namespace cc | 360 } // namespace cc |
OLD | NEW |