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

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: 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 f3f9b4d0dab6c04adf7c6b032164eab4eb0c00ce..dd410defd952f4590d8e28574766dc89586d6d18 100644
--- a/cc/layer.cc
+++ b/cc/layer.cc
@@ -222,12 +222,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;
@@ -280,9 +287,12 @@ void Layer::setBackgroundColor(SkColor backgroundColor)
setNeedsCommit();
}
-gfx::Size Layer::contentBounds() const
+void Layer::setIdealContentsScale(float ideal_contents_scale)
{
- return bounds();
+ m_drawProperties.ideal_contents_scale = ideal_contents_scale;
+ m_drawProperties.contents_scale_x = 1;
+ m_drawProperties.contents_scale_y = 1;
+ m_drawProperties.content_bounds = bounds();
}
void Layer::setMasksToBounds(bool masksToBounds)
@@ -640,16 +650,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