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

Unified Diff: cc/layer_tree_host_common_unittest.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_tree_host_common.cc ('k') | cc/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_common_unittest.cc
diff --git a/cc/layer_tree_host_common_unittest.cc b/cc/layer_tree_host_common_unittest.cc
index 15776469e6911b7405d9179195c8d3e60451b0b2..91a6e6288cb8acec664e4014a4a5aeed28b5b6ed 100644
--- a/cc/layer_tree_host_common_unittest.cc
+++ b/cc/layer_tree_host_common_unittest.cc
@@ -2408,12 +2408,6 @@ TEST(LayerTreeHostCommonTest, verifyDrawableAndVisibleContentRectsInHighDPI)
setLayerPropertiesForTesting(child3.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(125, 125), gfx::Size(50, 50), false);
const double deviceScaleFactor = 2;
- root->setContentsScale(deviceScaleFactor);
- renderSurface1->setContentsScale(deviceScaleFactor);
- renderSurface2->setContentsScale(deviceScaleFactor);
- child1->setContentsScale(deviceScaleFactor);
- child2->setContentsScale(deviceScaleFactor);
- child3->setContentsScale(deviceScaleFactor);
root->setMasksToBounds(true);
renderSurface1->setForceRenderSurface(true);
@@ -3978,9 +3972,18 @@ class NoScaleContentLayer : public ContentLayer
public:
static scoped_refptr<NoScaleContentLayer> create(ContentLayerClient* client) { return make_scoped_refptr(new NoScaleContentLayer(client)); }
- virtual gfx::Size contentBounds() const OVERRIDE { return bounds(); }
- virtual float contentsScaleX() const OVERRIDE { return 1.0; }
- virtual float contentsScaleY() const OVERRIDE { return 1.0; }
+ virtual void calculateContentsScale(
+ float idealContentsScale,
+ float* contentsScaleX,
+ float* contentsScaleY,
+ gfx::Size* contentBounds) OVERRIDE
+ {
+ Layer::calculateContentsScale(
+ idealContentsScale,
+ contentsScaleX,
+ contentsScaleY,
+ contentBounds);
+ }
protected:
explicit NoScaleContentLayer(ContentLayerClient* client) : ContentLayer(client) { }
@@ -4534,11 +4537,6 @@ TEST(LayerTreeHostCommonTest, verifyRenderSurfaceTransformsInHighDPI)
int dummyMaxTextureSize = 512;
const double deviceScaleFactor = 1.5;
- parent->setContentsScale(deviceScaleFactor);
- child->setContentsScale(deviceScaleFactor);
- duplicateChildNonOwner->setContentsScale(deviceScaleFactor);
- replica->setContentsScale(deviceScaleFactor);
-
LayerTreeHostCommon::calculateDrawProperties(parent.get(), parent->bounds(), deviceScaleFactor, 1, dummyMaxTextureSize, false, renderSurfaceLayerList);
// We should have two render surfaces. The root's render surface and child's
@@ -4617,11 +4615,6 @@ TEST(LayerTreeHostCommonTest, verifyRenderSurfaceTransformsInHighDPIAccurateScal
int dummyMaxTextureSize = 512;
const float deviceScaleFactor = 1.7f;
- parent->setContentsScale(deviceScaleFactor);
- child->setContentsScale(deviceScaleFactor);
- duplicateChildNonOwner->setContentsScale(deviceScaleFactor);
- replica->setContentsScale(deviceScaleFactor);
-
LayerTreeHostCommon::calculateDrawProperties(parent.get(), parent->bounds(), deviceScaleFactor, 1, dummyMaxTextureSize, false, renderSurfaceLayerList);
// We should have two render surfaces. The root's render surface and child's
« no previous file with comments | « cc/layer_tree_host_common.cc ('k') | cc/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698