Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: cc/scrollbar_layer.cc

Issue 11550035: Implement pinch-zoom scaling for main-frame scrollbars and pinch-zoom overlay scrollbars. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix impl-side painting issues. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698