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

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: rebase 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
« no previous file with comments | « cc/layer.h ('k') | cc/layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer.cc
diff --git a/cc/layer.cc b/cc/layer.cc
index ddc02b4d5141994921251aada18b5e46a48fe75f..3519f144f605e870e8cb58da4056116333aa8142 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,15 @@ void Layer::setBackgroundColor(SkColor backgroundColor)
setNeedsCommit();
}
-gfx::Size Layer::contentBounds() const
+void Layer::calculateContentsScale(
+ float idealContentsScale,
+ float* contentsScaleX,
+ float* contentsScaleY,
+ gfx::Size* contentBounds)
{
- return bounds();
+ *contentsScaleX = 1;
+ *contentsScaleY = 1;
+ *contentBounds = bounds();
}
void Layer::setMasksToBounds(bool masksToBounds)
@@ -633,16 +646,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)
« no previous file with comments | « cc/layer.h ('k') | cc/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698