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

Unified Diff: cc/layer_unittest.cc

Issue 11276060: Pass accurate contentsScale to LayerImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months 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_unittest.cc
diff --git a/cc/layer_unittest.cc b/cc/layer_unittest.cc
index 60a05392008f49ec2aac456416fdd92e71200610..828d37ea6a8ac58e5906034142173e3a4b626a0a 100644
--- a/cc/layer_unittest.cc
+++ b/cc/layer_unittest.cc
@@ -552,56 +552,6 @@ TEST_F(LayerTest, verifyPushPropertiesAccumulatesUpdateRect)
EXPECT_FLOAT_RECT_EQ(FloatRect(FloatPoint(10, 10), FloatSize(5, 5)), implLayer->updateRect());
}
-class LayerWithContentScaling : public Layer {
-public:
- explicit LayerWithContentScaling()
- : Layer()
- {
- }
-
- virtual bool needsContentsScale() const OVERRIDE
- {
- return true;
- }
-
- virtual void setNeedsDisplayRect(const FloatRect& dirtyRect) OVERRIDE
- {
- m_lastNeedsDisplayRect = dirtyRect;
- Layer::setNeedsDisplayRect(dirtyRect);
- }
-
- void resetNeedsDisplay()
- {
- m_needsDisplay = false;
- }
-
- const FloatRect& lastNeedsDisplayRect() const { return m_lastNeedsDisplayRect; }
-
-private:
- virtual ~LayerWithContentScaling()
- {
- }
-
- FloatRect m_lastNeedsDisplayRect;
-};
-
-TEST_F(LayerTest, checkContentsScaleChangeTriggersNeedsDisplay)
-{
- scoped_refptr<LayerWithContentScaling> testLayer = make_scoped_refptr(new LayerWithContentScaling());
- testLayer->setIsDrawable(true);
- testLayer->setLayerTreeHost(m_layerTreeHost.get());
-
- IntSize testBounds = IntSize(320, 240);
- EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setBounds(testBounds));
-
- testLayer->resetNeedsDisplay();
- EXPECT_FALSE(testLayer->needsDisplay());
-
- EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setContentsScale(testLayer->contentsScale() + 1.f));
- EXPECT_TRUE(testLayer->needsDisplay());
- EXPECT_FLOAT_RECT_EQ(FloatRect(0, 0, 320, 240), testLayer->lastNeedsDisplayRect());
-}
-
class FakeLayerImplTreeHost : public LayerTreeHost {
public:
static scoped_ptr<FakeLayerImplTreeHost> create()

Powered by Google App Engine
This is Rietveld 408576698