OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/layer.h" | 7 #include "cc/layer.h" |
8 | 8 |
9 #include "cc/keyframed_animation_curve.h" | 9 #include "cc/keyframed_animation_curve.h" |
10 #include "cc/layer_impl.h" | 10 #include "cc/layer_impl.h" |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 testLayer->setLayerTreeHost(m_layerTreeHost.get()); | 481 testLayer->setLayerTreeHost(m_layerTreeHost.get()); |
482 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setIsDrawable(tru
e)); | 482 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setIsDrawable(tru
e)); |
483 | 483 |
484 scoped_refptr<Layer> dummyLayer = Layer::create(); // just a dummy layer for
this test case. | 484 scoped_refptr<Layer> dummyLayer = Layer::create(); // just a dummy layer for
this test case. |
485 | 485 |
486 // sanity check of initial test condition | 486 // sanity check of initial test condition |
487 EXPECT_FALSE(testLayer->needsDisplay()); | 487 EXPECT_FALSE(testLayer->needsDisplay()); |
488 | 488 |
489 // Test properties that should not call needsDisplay and needsCommit when ch
anged. | 489 // Test properties that should not call needsDisplay and needsCommit when ch
anged. |
490 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setVisibleContent
Rect(gfx::Rect(0, 0, 40, 50))); | 490 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setVisibleContent
Rect(gfx::Rect(0, 0, 40, 50))); |
491 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setUseLCDText(tru
e)); | 491 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setCanUseLCDText(
true)); |
492 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawOpacity(0.
5)); | 492 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawOpacity(0.
5)); |
493 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setRenderTarget(0
)); | 493 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setRenderTarget(0
)); |
494 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawTransform(
WebTransformationMatrix())); | 494 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawTransform(
WebTransformationMatrix())); |
495 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setScreenSpaceTra
nsform(WebTransformationMatrix())); | 495 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setScreenSpaceTra
nsform(WebTransformationMatrix())); |
496 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawableConten
tRect(gfx::Rect(4, 5, 6, 7))); | 496 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawableConten
tRect(gfx::Rect(4, 5, 6, 7))); |
497 EXPECT_FALSE(testLayer->needsDisplay()); | 497 EXPECT_FALSE(testLayer->needsDisplay()); |
498 | 498 |
499 // Next, test properties that should call setNeedsCommit (but not setNeedsDi
splay) | 499 // Next, test properties that should call setNeedsCommit (but not setNeedsDi
splay) |
500 // All properties need to be set to new values in order for setNeedsCommit t
o be called. | 500 // All properties need to be set to new values in order for setNeedsCommit t
o be called. |
501 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setAnchorPoint(gf
x::PointF(1.23f, 4.56f))); | 501 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setAnchorPoint(gf
x::PointF(1.23f, 4.56f))); |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 scoped_refptr<MockLayer> layer(new MockLayer); | 792 scoped_refptr<MockLayer> layer(new MockLayer); |
793 EXPECT_FALSE(layer->needsDisplay()); | 793 EXPECT_FALSE(layer->needsDisplay()); |
794 layer->setBounds(gfx::Size(0, 10)); | 794 layer->setBounds(gfx::Size(0, 10)); |
795 EXPECT_FALSE(layer->needsDisplay()); | 795 EXPECT_FALSE(layer->needsDisplay()); |
796 layer->setBounds(gfx::Size(10, 10)); | 796 layer->setBounds(gfx::Size(10, 10)); |
797 EXPECT_TRUE(layer->needsDisplay()); | 797 EXPECT_TRUE(layer->needsDisplay()); |
798 } | 798 } |
799 | 799 |
800 | 800 |
801 } // anonymous namespace | 801 } // anonymous namespace |
OLD | NEW |