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

Side by Side Diff: cc/layer_unittest.cc

Issue 11360093: Mark layers that can use LCD text based on layer transform and opacity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed unit tests Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 testLayer->setLayerTreeHost(m_layerTreeHost.get()); 480 testLayer->setLayerTreeHost(m_layerTreeHost.get());
481 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setIsDrawable(tru e)); 481 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setIsDrawable(tru e));
482 482
483 scoped_refptr<Layer> dummyLayer = Layer::create(); // just a dummy layer for this test case. 483 scoped_refptr<Layer> dummyLayer = Layer::create(); // just a dummy layer for this test case.
484 484
485 // sanity check of initial test condition 485 // sanity check of initial test condition
486 EXPECT_FALSE(testLayer->needsDisplay()); 486 EXPECT_FALSE(testLayer->needsDisplay());
487 487
488 // Test properties that should not call needsDisplay and needsCommit when ch anged. 488 // Test properties that should not call needsDisplay and needsCommit when ch anged.
489 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setVisibleContent Rect(gfx::Rect(0, 0, 40, 50))); 489 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->setUseLCDText(tru e)); 490 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setCanUseLCDText( true));
491 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawOpacity(0. 5)); 491 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawOpacity(0. 5));
492 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setRenderTarget(0 )); 492 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setRenderTarget(0 ));
493 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawTransform( WebTransformationMatrix())); 493 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawTransform( WebTransformationMatrix()));
494 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setScreenSpaceTra nsform(WebTransformationMatrix())); 494 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setScreenSpaceTra nsform(WebTransformationMatrix()));
495 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawableConten tRect(gfx::Rect(4, 5, 6, 7))); 495 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawableConten tRect(gfx::Rect(4, 5, 6, 7)));
496 EXPECT_FALSE(testLayer->needsDisplay()); 496 EXPECT_FALSE(testLayer->needsDisplay());
497 497
498 // Next, test properties that should call setNeedsCommit (but not setNeedsDi splay) 498 // Next, test properties that should call setNeedsCommit (but not setNeedsDi splay)
499 // All properties need to be set to new values in order for setNeedsCommit t o be called. 499 // All properties need to be set to new values in order for setNeedsCommit t o be called.
500 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setAnchorPoint(gf x::PointF(1.23f, 4.56f))); 500 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setAnchorPoint(gf x::PointF(1.23f, 4.56f)));
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 scoped_refptr<MockLayer> layer(new MockLayer); 793 scoped_refptr<MockLayer> layer(new MockLayer);
794 EXPECT_FALSE(layer->needsDisplay()); 794 EXPECT_FALSE(layer->needsDisplay());
795 layer->setBounds(gfx::Size(0, 10)); 795 layer->setBounds(gfx::Size(0, 10));
796 EXPECT_FALSE(layer->needsDisplay()); 796 EXPECT_FALSE(layer->needsDisplay());
797 layer->setBounds(gfx::Size(10, 10)); 797 layer->setBounds(gfx::Size(10, 10));
798 EXPECT_TRUE(layer->needsDisplay()); 798 EXPECT_TRUE(layer->needsDisplay());
799 } 799 }
800 800
801 801
802 } // anonymous namespace 802 } // anonymous namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698