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

Unified Diff: cc/layer_impl.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_impl.cc
diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
index 3ee3c751f95685c4665c6cf0562db23b2ed1e755..751e7bf0a0e0b3750d082e1440240780f6036f7e 100644
--- a/cc/layer_impl.cc
+++ b/cc/layer_impl.cc
@@ -29,8 +29,6 @@ LayerImpl::LayerImpl(LayerTreeImpl* treeImpl, int id)
, m_layerTreeImpl(treeImpl)
, m_anchorPoint(0.5, 0.5)
, m_anchorPointZ(0)
- , m_contentsScaleX(1.0)
- , m_contentsScaleY(1.0)
, m_scrollable(false)
, m_shouldScrollOnMainThread(false)
, m_haveWheelEventHandlers(false)
@@ -661,20 +659,20 @@ bool LayerImpl::transformIsAnimating() const
void LayerImpl::setContentBounds(const gfx::Size& contentBounds)
danakj 2012/12/14 20:37:23 Random thought: What do you think of a setDrawProp
enne (OOO) 2012/12/14 22:06:05 I'm not sure. I think I'd prefer to punt on a pus
{
- if (m_contentBounds == contentBounds)
+ if (this->contentBounds() == contentBounds)
return;
- m_contentBounds = contentBounds;
+ m_drawProperties.content_bounds = contentBounds;
noteLayerPropertyChanged();
}
void LayerImpl::setContentsScale(float contentsScaleX, float contentsScaleY)
{
- if (m_contentsScaleX == contentsScaleX && m_contentsScaleY == contentsScaleY)
+ if (this->contentsScaleX() == contentsScaleX && this->contentsScaleY() == contentsScaleY)
return;
- m_contentsScaleX = contentsScaleX;
- m_contentsScaleY = contentsScaleY;
+ m_drawProperties.contents_scale_x = contentsScaleX;
+ m_drawProperties.contents_scale_y = contentsScaleY;
noteLayerPropertyChanged();
}

Powered by Google App Engine
This is Rietveld 408576698