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

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: Fix image layers 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
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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 EXPECT_TRUE(test_layer->NeedsDisplayForTesting()); 502 EXPECT_TRUE(test_layer->NeedsDisplayForTesting());
503 test_layer->ResetNeedsDisplayForTesting(); 503 test_layer->ResetNeedsDisplayForTesting();
504 504
505 // Case 2: SetNeedsDisplay() without the dirty rect arg. 505 // Case 2: SetNeedsDisplay() without the dirty rect arg.
506 test_layer->ResetNeedsDisplayForTesting(); 506 test_layer->ResetNeedsDisplayForTesting();
507 EXPECT_FALSE(test_layer->NeedsDisplayForTesting()); 507 EXPECT_FALSE(test_layer->NeedsDisplayForTesting());
508 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetNeedsDisplay()); 508 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetNeedsDisplay());
509 EXPECT_TRUE(test_layer->NeedsDisplayForTesting()); 509 EXPECT_TRUE(test_layer->NeedsDisplayForTesting());
510 test_layer->ResetNeedsDisplayForTesting(); 510 test_layer->ResetNeedsDisplayForTesting();
511 511
512 // Case 3: SetNeedsDisplay() with a non-drawable layer 512 // Case 3: SetNeedsDisplay() with an empty rect.
513 test_layer->ResetNeedsDisplayForTesting();
514 EXPECT_FALSE(test_layer->NeedsDisplayForTesting());
515 EXPECT_SET_NEEDS_COMMIT(0, test_layer->SetNeedsDisplayRect(gfx::Rect()));
516 EXPECT_FALSE(test_layer->NeedsDisplayForTesting());
517
518 // Case 4: SetNeedsDisplay() with a non-drawable layer
513 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetIsDrawable(false)); 519 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetIsDrawable(false));
514 test_layer->ResetNeedsDisplayForTesting(); 520 test_layer->ResetNeedsDisplayForTesting();
515 EXPECT_FALSE(test_layer->NeedsDisplayForTesting()); 521 EXPECT_FALSE(test_layer->NeedsDisplayForTesting());
516 EXPECT_SET_NEEDS_COMMIT(0, test_layer->SetNeedsDisplayRect(dirty1)); 522 EXPECT_SET_NEEDS_COMMIT(0, test_layer->SetNeedsDisplayRect(dirty1));
517 EXPECT_TRUE(test_layer->NeedsDisplayForTesting()); 523 EXPECT_TRUE(test_layer->NeedsDisplayForTesting());
518 } 524 }
519 525
520 TEST_F(LayerTest, CheckPropertyChangeCausesCorrectBehavior) { 526 TEST_F(LayerTest, CheckPropertyChangeCausesCorrectBehavior) {
521 scoped_refptr<Layer> test_layer = Layer::Create(); 527 scoped_refptr<Layer> test_layer = Layer::Create();
522 EXPECT_SET_NEEDS_FULL_TREE_SYNC( 528 EXPECT_SET_NEEDS_FULL_TREE_SYNC(
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 << "Flags: " << contents_opaque << ", " << layer_opaque << ", " 1012 << "Flags: " << contents_opaque << ", " << layer_opaque << ", "
1007 << host_opaque << "\n"; 1013 << host_opaque << "\n";
1008 } 1014 }
1009 } 1015 }
1010 } 1016 }
1011 } 1017 }
1012 } 1018 }
1013 1019
1014 } // namespace 1020 } // namespace
1015 } // namespace cc 1021 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698