Index: cc/scrollbar_layer.cc |
diff --git a/cc/scrollbar_layer.cc b/cc/scrollbar_layer.cc |
index 50eadb7a279892bdb8b167f196edeecf79a19738..61ba98901b79b4caf468b93c4744422a26d5f6dd 100644 |
--- a/cc/scrollbar_layer.cc |
+++ b/cc/scrollbar_layer.cc |
@@ -12,6 +12,7 @@ |
#include "cc/layer_tree_host.h" |
#include "cc/scrollbar_layer_impl.h" |
#include "cc/texture_update_queue.h" |
+#include "ui/gfx/size_conversions.h" |
#include <public/WebRect.h> |
using WebKit::WebRect; |
@@ -135,9 +136,9 @@ bool ScrollbarLayer::needsContentsScale() const |
return true; |
} |
-IntSize ScrollbarLayer::contentBounds() const |
+gfx::Size ScrollbarLayer::contentBounds() const |
{ |
- return IntSize(lroundf(bounds().width() * contentsScale()), lroundf(bounds().height() * contentsScale())); |
+ return gfx::ToRoundedSize(bounds().Scale(contentsScale())); |
} |
class ScrollbarThumbPainter : public LayerPainter { |
@@ -208,13 +209,13 @@ void ScrollbarLayer::createUpdaterIfNeeded() |
m_thumb = m_thumbUpdater->createResource(layerTreeHost()->contentsTextureManager()); |
} |
-void ScrollbarLayer::updatePart(CachingBitmapCanvasLayerUpdater* painter, LayerUpdater::Resource* texture, const IntRect& rect, TextureUpdateQueue& queue, RenderingStats& stats) |
+void ScrollbarLayer::updatePart(CachingBitmapCanvasLayerUpdater* painter, LayerUpdater::Resource* texture, const gfx::Rect& rect, TextureUpdateQueue& queue, RenderingStats& stats) |
{ |
// Skip painting and uploading if there are no invalidations and |
// we already have valid texture data. |
if (texture->texture()->haveBackingTexture() |
&& texture->texture()->size() == rect.size() |
- && m_updateRect.isEmpty()) |
+ && m_updateRect.IsEmpty()) |
return; |
// We should always have enough memory for UI. |
@@ -239,7 +240,7 @@ void ScrollbarLayer::updatePart(CachingBitmapCanvasLayerUpdater* painter, LayerU |
void ScrollbarLayer::setTexturePriorities(const PriorityCalculator&) |
{ |
- if (contentBounds().isEmpty()) |
+ if (contentBounds().IsEmpty()) |
return; |
createUpdaterIfNeeded(); |
@@ -254,7 +255,7 @@ void ScrollbarLayer::setTexturePriorities(const PriorityCalculator&) |
m_foreTrack->texture()->setRequestPriority(PriorityCalculator::uiPriority(drawsToRoot)); |
} |
if (m_thumb) { |
- IntSize thumbSize = layerRectToContentRect(m_geometry->thumbRect(m_scrollbar.get())).size(); |
+ gfx::Size thumbSize = layerRectToContentRect(m_geometry->thumbRect(m_scrollbar.get())).size(); |
m_thumb->texture()->setDimensions(thumbSize, m_textureFormat); |
m_thumb->texture()->setRequestPriority(PriorityCalculator::uiPriority(drawsToRoot)); |
} |
@@ -262,21 +263,21 @@ void ScrollbarLayer::setTexturePriorities(const PriorityCalculator&) |
void ScrollbarLayer::update(TextureUpdateQueue& queue, const OcclusionTracker*, RenderingStats& stats) |
{ |
- if (contentBounds().isEmpty()) |
+ if (contentBounds().IsEmpty()) |
return; |
createUpdaterIfNeeded(); |
- IntPoint scrollbarOrigin(m_scrollbar->location().x, m_scrollbar->location().y); |
- IntRect contentRect = layerRectToContentRect(WebKit::WebRect(scrollbarOrigin.x(), scrollbarOrigin.y(), bounds().width(), bounds().height())); |
+ gfx::Point scrollbarOrigin(m_scrollbar->location()); |
+ gfx::Rect contentRect = layerRectToContentRect(gfx::Rect(scrollbarOrigin, bounds())); |
updatePart(m_backTrackUpdater.get(), m_backTrack.get(), contentRect, queue, stats); |
if (m_foreTrack && m_foreTrackUpdater) |
updatePart(m_foreTrackUpdater.get(), m_foreTrack.get(), contentRect, queue, stats); |
// Consider the thumb to be at the origin when painting. |
WebKit::WebRect thumbRect = m_geometry->thumbRect(m_scrollbar.get()); |
- IntRect originThumbRect = layerRectToContentRect(WebKit::WebRect(0, 0, thumbRect.width, thumbRect.height)); |
- if (!originThumbRect.isEmpty()) |
+ gfx::Rect originThumbRect = layerRectToContentRect(gfx::Rect(0, 0, thumbRect.width, thumbRect.height)); |
+ if (!originThumbRect.IsEmpty()) |
updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, queue, stats); |
} |