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

Unified Diff: cc/layer.h

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/image_layer.cc ('k') | cc/layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer.h
diff --git a/cc/layer.h b/cc/layer.h
index 2be73c220a07f1db8c00243d3a95d9d446faa5cf..ede61205538f49bc29e046a2c7a9e14ccd8f34e0 100644
--- a/cc/layer.h
+++ b/cc/layer.h
@@ -84,8 +84,9 @@ public:
// A layer's bounds are in logical, non-page-scaled pixels (however, the
// root layer's bounds are in physical pixels).
void setBounds(const gfx::Size&);
+ // TODO(enne): remove this function: http://crbug.com/166023
+ virtual void didUpdateBounds();
const gfx::Size& bounds() const { return m_bounds; }
- virtual gfx::Size contentBounds() const;
void setMasksToBounds(bool);
bool masksToBounds() const { return m_masksToBounds; }
@@ -226,9 +227,14 @@ public:
// The contentsScale converts from logical, non-page-scaled pixels to target pixels.
// The contentsScale is 1 for the root layer as it is already in physical pixels.
// By default contentsScale is forced to be 1 except for subclasses of ContentsScalingLayer.
- virtual float contentsScaleX() const;
- virtual float contentsScaleY() const;
- virtual void setContentsScale(float contentsScale) { }
+ float contentsScaleX() const { return m_drawProperties.contents_scale_x; }
+ float contentsScaleY() const { return m_drawProperties.contents_scale_y; }
+ gfx::Size contentBounds() const { return m_drawProperties.content_bounds; }
+ virtual void calculateContentsScale(
+ float idealContentsScale,
+ float* contentsScaleX,
+ float* contentsScaleY,
+ gfx::Size* contentBounds);
// The scale at which contents should be rastered, to match the scale at
// which they will drawn to the screen. This scale is a component of the
« no previous file with comments | « cc/image_layer.cc ('k') | cc/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698