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

Unified Diff: cc/test/tiled_layer_test_common.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/test/tiled_layer_test_common.cc
diff --git a/cc/test/tiled_layer_test_common.cc b/cc/test/tiled_layer_test_common.cc
index 80106383c051ff6ea28e5997f04f7bdf083630d8..90c8b90bbf5c33977fab9be87a07e0f122427a43 100644
--- a/cc/test/tiled_layer_test_common.cc
+++ b/cc/test/tiled_layer_test_common.cc
@@ -139,24 +139,22 @@ cc::LayerUpdater* FakeTiledLayer::updater() const
return m_fakeUpdater.get();
}
-gfx::Size FakeTiledLayerWithScaledBounds::contentBounds() const
+void FakeTiledLayerWithScaledBounds::setContentBounds(const gfx::Size& contentBounds)
{
- return m_forcedContentBounds;
+ m_forcedContentBounds = contentBounds;
+ m_drawProperties.content_bounds = m_forcedContentBounds;
}
-float FakeTiledLayerWithScaledBounds::contentsScaleX() const
+void FakeTiledLayerWithScaledBounds::updateContentsScale(float scale)
{
- return static_cast<float>(m_forcedContentBounds.width()) / bounds().width();
+ m_drawProperties.contents_scale_x = static_cast<float>(m_forcedContentBounds.width()) / bounds().width();
+ m_drawProperties.contents_scale_y = static_cast<float>(m_forcedContentBounds.height()) / bounds().height();
+ m_drawProperties.content_bounds = m_forcedContentBounds;
}
-float FakeTiledLayerWithScaledBounds::contentsScaleY() const
+void FakeTiledLayerWithScaledBounds::didUpdateBounds()
{
- return static_cast<float>(m_forcedContentBounds.height()) / bounds().height();
-}
-
-void FakeTiledLayerWithScaledBounds::setContentsScale(float)
-{
- NOTREACHED();
+ m_drawProperties.content_bounds = m_forcedContentBounds;
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698