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

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: some missed intstuff Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: cc/scrollbar_layer_impl.cc
diff --git a/cc/scrollbar_layer_impl.cc b/cc/scrollbar_layer_impl.cc
index fcb8f38265b5b4b7b56aaed89d681fdb430565ad..b3d8899af65e5a7bba3b3764956c68690af416ef 100644
--- a/cc/scrollbar_layer_impl.cc
+++ b/cc/scrollbar_layer_impl.cc
@@ -66,19 +66,18 @@ 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());
}
void ScrollbarLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuadsData)
{
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);
@@ -103,8 +102,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()
« cc/layer_tiling_data.cc ('K') | « 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