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 "cc/layer.h" | 5 #include "cc/layer.h" |
6 | 6 |
7 #include "cc/keyframed_animation_curve.h" | 7 #include "cc/keyframed_animation_curve.h" |
8 #include "cc/layer_impl.h" | 8 #include "cc/layer_impl.h" |
9 #include "cc/layer_painter.h" | 9 #include "cc/layer_painter.h" |
10 #include "cc/layer_tree_host.h" | 10 #include "cc/layer_tree_host.h" |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
526 | 526 |
527 // Next, test properties that should call setNeedsCommit (but not setNeedsDi splay) | 527 // Next, test properties that should call setNeedsCommit (but not setNeedsDi splay) |
528 // All properties need to be set to new values in order for setNeedsCommit t o be called. | 528 // All properties need to be set to new values in order for setNeedsCommit t o be called. |
529 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setAnchorPoint(gfx::PointF(1.23f, 4.56 f))); | 529 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setAnchorPoint(gfx::PointF(1.23f, 4.56 f))); |
530 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setAnchorPointZ(0.7f)); | 530 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setAnchorPointZ(0.7f)); |
531 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setBackgroundColor(SK_ColorLTGRAY)); | 531 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setBackgroundColor(SK_ColorLTGRAY)); |
532 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setMasksToBounds(true)); | 532 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setMasksToBounds(true)); |
533 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setOpacity(0.5)); | 533 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setOpacity(0.5)); |
534 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setContentsOpaque(true)); | 534 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setContentsOpaque(true)); |
535 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setPosition(gfx::PointF(4, 9))); | 535 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setPosition(gfx::PointF(4, 9))); |
536 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setSublayerTransform(MathUtil::createG fxTransform(0, 0, 0, 0, 0, 0))); | 536 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setSublayerTransform(gfx::Transform(0, 0, 0, 0, 0, 0))); |
danakj
2013/01/11 04:14:12
nit: 0.0s here
| |
537 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setScrollable(true)); | 537 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setScrollable(true)); |
538 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setShouldScrollOnMainThread(true)); | 538 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setShouldScrollOnMainThread(true)); |
539 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setNonFastScrollableRegion(gfx::Rect(1 , 1, 2, 2))); | 539 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setNonFastScrollableRegion(gfx::Rect(1 , 1, 2, 2))); |
540 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setHaveWheelEventHandlers(true)); | 540 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setHaveWheelEventHandlers(true)); |
541 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setTransform(MathUtil::createGfxTransf orm(0, 0, 0, 0, 0, 0))); | 541 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setTransform(gfx::Transform(0, 0, 0, 0 , 0, 0))); |
542 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setDoubleSided(false)); | 542 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setDoubleSided(false)); |
543 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setDebugName("Test Layer")); | 543 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setDebugName("Test Layer")); |
544 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setDrawCheckerboardForMissingTiles(!te stLayer->drawCheckerboardForMissingTiles())); | 544 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setDrawCheckerboardForMissingTiles(!te stLayer->drawCheckerboardForMissingTiles())); |
545 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setForceRenderSurface(true)); | 545 EXPECT_SET_NEEDS_COMMIT(1, testLayer->setForceRenderSurface(true)); |
546 | 546 |
547 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, testLayer->setMaskLayer(dummyLayer.get()) ); | 547 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, testLayer->setMaskLayer(dummyLayer.get()) ); |
548 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, testLayer->setReplicaLayer(dummyLayer.get ())); | 548 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, testLayer->setReplicaLayer(dummyLayer.get ())); |
549 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, testLayer->setScrollOffset(gfx::Vector2d( 10, 10))); | 549 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, testLayer->setScrollOffset(gfx::Vector2d( 10, 10))); |
550 | 550 |
551 // The above tests should not have caused a change to the needsDisplay flag. | 551 // The above tests should not have caused a change to the needsDisplay flag. |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
854 scoped_refptr<MockLayer> layer(new MockLayer); | 854 scoped_refptr<MockLayer> layer(new MockLayer); |
855 EXPECT_FALSE(layer->needsDisplay()); | 855 EXPECT_FALSE(layer->needsDisplay()); |
856 layer->setBounds(gfx::Size(0, 10)); | 856 layer->setBounds(gfx::Size(0, 10)); |
857 EXPECT_FALSE(layer->needsDisplay()); | 857 EXPECT_FALSE(layer->needsDisplay()); |
858 layer->setBounds(gfx::Size(10, 10)); | 858 layer->setBounds(gfx::Size(10, 10)); |
859 EXPECT_TRUE(layer->needsDisplay()); | 859 EXPECT_TRUE(layer->needsDisplay()); |
860 } | 860 } |
861 | 861 |
862 } // namespace | 862 } // namespace |
863 } // namespace cc | 863 } // namespace cc |
OLD | NEW |