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

Unified Diff: cc/layer.cc

Issue 11503005: cc: Refactor content scale/bounds into draw properties (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix shadowing Created 8 years 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/layer.cc
diff --git a/cc/layer.cc b/cc/layer.cc
index ddc02b4d5141994921251aada18b5e46a48fe75f..5c4ba531051f4f1308f80ef41e3576c570533fa2 100644
--- a/cc/layer.cc
+++ b/cc/layer.cc
@@ -216,12 +216,19 @@ void Layer::setBounds(const gfx::Size& size)
m_bounds = size;
+ didUpdateBounds();
+
if (firstResize)
setNeedsDisplay();
else
setNeedsCommit();
}
+void Layer::didUpdateBounds()
+{
+ m_drawProperties.content_bounds = bounds();
+}
+
Layer* Layer::rootLayer()
{
Layer* layer = this;
@@ -274,9 +281,11 @@ void Layer::setBackgroundColor(SkColor backgroundColor)
setNeedsCommit();
}
-gfx::Size Layer::contentBounds() const
+void Layer::updateContentsScale(float ideal_contents_scale)
{
- return bounds();
+ m_drawProperties.contents_scale_x = 1;
+ m_drawProperties.contents_scale_y = 1;
+ m_drawProperties.content_bounds = bounds();
}
void Layer::setMasksToBounds(bool masksToBounds)
@@ -633,16 +642,6 @@ void Layer::setDebugName(const std::string& debugName)
setNeedsCommit();
}
-float Layer::contentsScaleX() const
-{
- return 1.0;
-}
-
-float Layer::contentsScaleY() const
-{
- return 1.0;
-}
-
void Layer::setRasterScale(float scale)
{
if (m_rasterScale == scale)

Powered by Google App Engine
This is Rietveld 408576698