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

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: rebase with TOT, addressed comments 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 "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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 testLayer->setLayerTreeHost(m_layerTreeHost.get()); 479 testLayer->setLayerTreeHost(m_layerTreeHost.get());
480 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setIsDrawable(tru e)); 480 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setIsDrawable(tru e));
481 481
482 scoped_refptr<Layer> dummyLayer = Layer::create(); // just a dummy layer for this test case. 482 scoped_refptr<Layer> dummyLayer = Layer::create(); // just a dummy layer for this test case.
483 483
484 // sanity check of initial test condition 484 // sanity check of initial test condition
485 EXPECT_FALSE(testLayer->needsDisplay()); 485 EXPECT_FALSE(testLayer->needsDisplay());
486 486
487 // Test properties that should not call needsDisplay and needsCommit when ch anged. 487 // Test properties that should not call needsDisplay and needsCommit when ch anged.
488 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setVisibleContent Rect(gfx::Rect(0, 0, 40, 50))); 488 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->setUseLCDText(tru e)); 489 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setCanUseLCDText( true));
490 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawOpacity(0. 5)); 490 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawOpacity(0. 5));
491 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setRenderTarget(0 )); 491 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setRenderTarget(0 ));
492 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawTransform( WebTransformationMatrix())); 492 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawTransform( WebTransformationMatrix()));
493 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setScreenSpaceTra nsform(WebTransformationMatrix())); 493 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setScreenSpaceTra nsform(WebTransformationMatrix()));
494 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawableConten tRect(gfx::Rect(4, 5, 6, 7))); 494 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawableConten tRect(gfx::Rect(4, 5, 6, 7)));
495 EXPECT_FALSE(testLayer->needsDisplay()); 495 EXPECT_FALSE(testLayer->needsDisplay());
496 496
497 // Next, test properties that should call setNeedsCommit (but not setNeedsDi splay) 497 // Next, test properties that should call setNeedsCommit (but not setNeedsDi splay)
498 // All properties need to be set to new values in order for setNeedsCommit t o be called. 498 // All properties need to be set to new values in order for setNeedsCommit t o be called.
499 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setAnchorPoint(gf x::PointF(1.23f, 4.56f))); 499 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
790 scoped_refptr<MockLayer> layer(new MockLayer); 790 scoped_refptr<MockLayer> layer(new MockLayer);
791 EXPECT_FALSE(layer->needsDisplay()); 791 EXPECT_FALSE(layer->needsDisplay());
792 layer->setBounds(gfx::Size(0, 10)); 792 layer->setBounds(gfx::Size(0, 10));
793 EXPECT_FALSE(layer->needsDisplay()); 793 EXPECT_FALSE(layer->needsDisplay());
794 layer->setBounds(gfx::Size(10, 10)); 794 layer->setBounds(gfx::Size(10, 10));
795 EXPECT_TRUE(layer->needsDisplay()); 795 EXPECT_TRUE(layer->needsDisplay());
796 } 796 }
797 797
798 } // namespace 798 } // namespace
799 } // namespace cc 799 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698