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

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: Rebased 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
« no previous file with comments | « cc/layer_tree_host_unittest.cc ('k') | cc/render_surface_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_unittest.cc
diff --git a/cc/layer_unittest.cc b/cc/layer_unittest.cc
index e2cb6b2f099e1a404cc42df660d931e7263a6b38..a4a07251667a92c122c1188e91559fd750804e15 100644
--- a/cc/layer_unittest.cc
+++ b/cc/layer_unittest.cc
@@ -549,56 +549,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()
« no previous file with comments | « cc/layer_tree_host_unittest.cc ('k') | cc/render_surface_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698