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

Unified Diff: cc/scrollbar_layer_impl.cc

Issue 11264056: cc: Use gfx:: Geometry types for positions, bounds, and related things. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ScaleAsVector Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/scrollbar_layer.cc ('k') | cc/single_thread_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scrollbar_layer_impl.cc
diff --git a/cc/scrollbar_layer_impl.cc b/cc/scrollbar_layer_impl.cc
index 180fd82b9eca965b0c6016f86c0d5e42bab0fe99..271ee26334e23413ab4f9ead0d04672019a6862b 100644
--- a/cc/scrollbar_layer_impl.cc
+++ b/cc/scrollbar_layer_impl.cc
@@ -66,10 +66,9 @@ void ScrollbarLayerImpl::setScrollbarData(WebScrollbar* scrollbar)
m_geometry->update(scrollbar);
}
-static FloatRect toUVRect(const WebRect& r, const IntRect& bounds)
+static gfx::RectF toUVRect(const gfx::Rect& r, const gfx::Rect& bounds)
{
- return FloatRect(static_cast<float>(r.x) / bounds.width(), static_cast<float>(r.y) / bounds.height(),
- static_cast<float>(r.width) / bounds.width(), static_cast<float>(r.height) / bounds.height());
+ return gfx::ScaleRect(r, 1.0 / bounds.width(), 1.0 / bounds.height());
}
IntRect ScrollbarLayerImpl::scrollbarLayerRectToContentRect(const WebRect& layerRect) const
@@ -85,9 +84,9 @@ void ScrollbarLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& append
{
bool premultipledAlpha = false;
bool flipped = false;
- FloatRect uvRect(0, 0, 1, 1);
- IntRect boundsRect(IntPoint(), bounds());
- IntRect contentBoundsRect(IntPoint(), contentBounds());
+ gfx::RectF uvRect(0, 0, 1, 1);
+ gfx::Rect boundsRect(gfx::Point(), bounds());
+ gfx::Rect contentBoundsRect(gfx::Point(), contentBounds());
SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQuadState());
appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData);
@@ -112,8 +111,8 @@ void ScrollbarLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& append
// Order matters here: since the back track texture is being drawn to the entire contents rect, we must append it after the thumb and
// fore track quads. The back track texture contains (and displays) the buttons.
- if (!contentBoundsRect.isEmpty())
- quadSink.append(TextureDrawQuad::create(sharedQuadState, IntRect(contentBoundsRect), m_backTrackResourceId, premultipledAlpha, uvRect, flipped).PassAs<DrawQuad>(), appendQuadsData);
+ if (!contentBoundsRect.IsEmpty())
+ quadSink.append(TextureDrawQuad::create(sharedQuadState, gfx::Rect(contentBoundsRect), m_backTrackResourceId, premultipledAlpha, uvRect, flipped).PassAs<DrawQuad>(), appendQuadsData);
}
void ScrollbarLayerImpl::didLoseContext()
« no previous file with comments | « cc/scrollbar_layer.cc ('k') | cc/single_thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698