summaryrefslogtreecommitdiffstats
path: root/cc/scrollbar_layer_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/scrollbar_layer_impl.cc')
-rw-r--r--cc/scrollbar_layer_impl.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/cc/scrollbar_layer_impl.cc b/cc/scrollbar_layer_impl.cc
index 180fd82..271ee26 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()