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

Unified Diff: cc/scrollbar_layer.cc

Issue 11276060: Pass accurate contentsScale to LayerImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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.cc
diff --git a/cc/scrollbar_layer.cc b/cc/scrollbar_layer.cc
index 1a107bd810ef9b4d50c844266016a588d0882b2f..50c06a1d84dda1f5a7d26693a9ede7c4235b32b4 100644
--- a/cc/scrollbar_layer.cc
+++ b/cc/scrollbar_layer.cc
@@ -43,7 +43,7 @@ ScrollbarLayer::~ScrollbarLayer()
void ScrollbarLayer::pushPropertiesTo(LayerImpl* layer)
{
- Layer::pushPropertiesTo(layer);
+ ContentsScalingLayer::pushPropertiesTo(layer);
ScrollbarLayerImpl* scrollbarLayer = static_cast<ScrollbarLayerImpl*>(layer);
@@ -131,16 +131,6 @@ private:
DISALLOW_COPY_AND_ASSIGN(ScrollbarBackgroundPainter);
};
-bool ScrollbarLayer::needsContentsScale() const
-{
- return true;
-}
-
-IntSize ScrollbarLayer::contentBounds() const
-{
- return IntSize(lroundf(bounds().width() * contentsScale()), lroundf(bounds().height() * contentsScale()));
-}
-
class ScrollbarThumbPainter : public LayerPainter {
public:
static scoped_ptr<ScrollbarThumbPainter> create(WebKit::WebScrollbar* scrollbar, WebKit::WebScrollbarThemePainter painter, WebKit::WebScrollbarThemeGeometry* geometry)
@@ -183,7 +173,7 @@ void ScrollbarLayer::setLayerTreeHost(LayerTreeHost* host)
m_thumb.reset();
}
- Layer::setLayerTreeHost(host);
+ ContentsScalingLayer::setLayerTreeHost(host);
}
void ScrollbarLayer::createUpdaterIfNeeded()
@@ -224,10 +214,8 @@ void ScrollbarLayer::updatePart(CachingBitmapContentLayerUpdater* painter, Layer
return;
// Paint and upload the entire part.
- float widthScale = static_cast<float>(contentBounds().width()) / bounds().width();
- float heightScale = static_cast<float>(contentBounds().height()) / bounds().height();
IntRect paintedOpaqueRect;
- painter->prepareToUpdate(rect, rect.size(), widthScale, heightScale, paintedOpaqueRect, stats);
+ painter->prepareToUpdate(rect, rect.size(), contentsScaleX(), contentsScaleY(), paintedOpaqueRect, stats);
if (!painter->pixelsDidChange() && texture->texture()->haveBackingTexture()) {
TRACE_EVENT_INSTANT0("cc","ScrollbarLayer::updatePart no texture upload needed");
return;

Powered by Google App Engine
This is Rietveld 408576698