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

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: 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 0d52ad0c819f844aecc7f0de7542408a5644b8f7..6a93b1f14481d143b72977c35f1f68545b9ac9ef 100644
--- a/cc/test/tiled_layer_test_common.cc
+++ b/cc/test/tiled_layer_test_common.cc
@@ -139,24 +139,23 @@ 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;
+ didUpdateBounds();
}
-float FakeTiledLayerWithScaledBounds::contentsScaleX() const
+void FakeTiledLayerWithScaledBounds::setIdealContentsScale(float scale)
{
- return static_cast<float>(m_forcedContentBounds.width()) / bounds().width();
+ m_drawProperties.ideal_contents_scale = scale;
+ 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();
+ didUpdateBounds();
}
-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