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

Side by Side Diff: cc/layers/layer_unittest.cc

Issue 5831706594508800: cc: Cleanup Layer::SetNeedsDisplayInRect (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/nine_patch_layer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/layers/layer.h" 5 #include "cc/layers/layer.h"
6 6
7 #include "cc/animation/keyframed_animation_curve.h" 7 #include "cc/animation/keyframed_animation_curve.h"
8 #include "cc/base/math_util.h" 8 #include "cc/base/math_util.h"
9 #include "cc/layers/layer_impl.h" 9 #include "cc/layers/layer_impl.h"
10 #include "cc/resources/layer_painter.h" 10 #include "cc/resources/layer_painter.h"
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 EXPECT_TRUE(test_layer->NeedsDisplayForTesting()); 503 EXPECT_TRUE(test_layer->NeedsDisplayForTesting());
504 test_layer->ResetNeedsDisplayForTesting(); 504 test_layer->ResetNeedsDisplayForTesting();
505 505
506 // Case 2: SetNeedsDisplay() without the dirty rect arg. 506 // Case 2: SetNeedsDisplay() without the dirty rect arg.
507 test_layer->ResetNeedsDisplayForTesting(); 507 test_layer->ResetNeedsDisplayForTesting();
508 EXPECT_FALSE(test_layer->NeedsDisplayForTesting()); 508 EXPECT_FALSE(test_layer->NeedsDisplayForTesting());
509 EXPECT_SET_NEEDS_UPDATE(1, test_layer->SetNeedsDisplay()); 509 EXPECT_SET_NEEDS_UPDATE(1, test_layer->SetNeedsDisplay());
510 EXPECT_TRUE(test_layer->NeedsDisplayForTesting()); 510 EXPECT_TRUE(test_layer->NeedsDisplayForTesting());
511 test_layer->ResetNeedsDisplayForTesting(); 511 test_layer->ResetNeedsDisplayForTesting();
512 512
513 // Case 3: SetNeedsDisplay() with a non-drawable layer 513 // Case 3: SetNeedsDisplay() with an empty rect.
514 test_layer->ResetNeedsDisplayForTesting();
515 EXPECT_FALSE(test_layer->NeedsDisplayForTesting());
516 EXPECT_SET_NEEDS_COMMIT(0, test_layer->SetNeedsDisplayRect(gfx::Rect()));
517 EXPECT_FALSE(test_layer->NeedsDisplayForTesting());
518
519 // Case 4: SetNeedsDisplay() with a non-drawable layer
514 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetIsDrawable(false)); 520 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetIsDrawable(false));
515 test_layer->ResetNeedsDisplayForTesting(); 521 test_layer->ResetNeedsDisplayForTesting();
516 EXPECT_FALSE(test_layer->NeedsDisplayForTesting()); 522 EXPECT_FALSE(test_layer->NeedsDisplayForTesting());
517 EXPECT_SET_NEEDS_UPDATE(0, test_layer->SetNeedsDisplayRect(dirty1)); 523 EXPECT_SET_NEEDS_UPDATE(0, test_layer->SetNeedsDisplayRect(dirty1));
518 EXPECT_TRUE(test_layer->NeedsDisplayForTesting()); 524 EXPECT_TRUE(test_layer->NeedsDisplayForTesting());
519 } 525 }
520 526
521 TEST_F(LayerTest, CheckPropertyChangeCausesCorrectBehavior) { 527 TEST_F(LayerTest, CheckPropertyChangeCausesCorrectBehavior) {
522 scoped_refptr<Layer> test_layer = Layer::Create(); 528 scoped_refptr<Layer> test_layer = Layer::Create();
523 EXPECT_SET_NEEDS_FULL_TREE_SYNC( 529 EXPECT_SET_NEEDS_FULL_TREE_SYNC(
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 << "Flags: " << contents_opaque << ", " << layer_opaque << ", " 1013 << "Flags: " << contents_opaque << ", " << layer_opaque << ", "
1008 << host_opaque << "\n"; 1014 << host_opaque << "\n";
1009 } 1015 }
1010 } 1016 }
1011 } 1017 }
1012 } 1018 }
1013 } 1019 }
1014 1020
1015 } // namespace 1021 } // namespace
1016 } // namespace cc 1022 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/nine_patch_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698