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

Side by Side Diff: cc/trees/damage_tracker_unittest.cc

Issue 640203002: [C++11 Allowed Features] Declares a type-safe null pointer converting from NULL to nullptr [part-… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format fix. Created 6 years, 2 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
« no previous file with comments | « no previous file | cc/trees/layer_sorter.cc » ('j') | cc/trees/layer_tree_host_impl.h » ('J')
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/trees/damage_tracker.h" 5 #include "cc/trees/damage_tracker.h"
6 6
7 #include "cc/base/math_util.h" 7 #include "cc/base/math_util.h"
8 #include "cc/layers/layer_impl.h" 8 #include "cc/layers/layer_impl.h"
9 #include "cc/output/filter_operation.h" 9 #include "cc/output/filter_operation.h"
10 #include "cc/output/filter_operations.h" 10 #include "cc/output/filter_operations.h"
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 // leftover from the previous case. 726 // leftover from the previous case.
727 ClearDamageForAllSurfaces(root.get()); 727 ClearDamageForAllSurfaces(root.get());
728 EmulateDrawingOneFrame(root.get()); 728 EmulateDrawingOneFrame(root.get());
729 729
730 root_damage_rect = 730 root_damage_rect =
731 root->render_surface()->damage_tracker()->current_damage_rect(); 731 root->render_surface()->damage_tracker()->current_damage_rect();
732 EXPECT_TRUE(root_damage_rect.IsEmpty()); 732 EXPECT_TRUE(root_damage_rect.IsEmpty());
733 733
734 // Then, test removing child1. 734 // Then, test removing child1.
735 root->RemoveChild(child1); 735 root->RemoveChild(child1);
736 child1 = NULL; 736 child1 = nullptr;
737 EmulateDrawingOneFrame(root.get()); 737 EmulateDrawingOneFrame(root.get());
738 738
739 root_damage_rect = 739 root_damage_rect =
740 root->render_surface()->damage_tracker()->current_damage_rect(); 740 root->render_surface()->damage_tracker()->current_damage_rect();
741 EXPECT_EQ(gfx::Rect(100, 100, 30, 30).ToString(), 741 EXPECT_EQ(gfx::Rect(100, 100, 30, 30).ToString(),
742 root_damage_rect.ToString()); 742 root_damage_rect.ToString());
743 } 743 }
744 744
745 TEST_F(DamageTrackerTest, VerifyDamageForNewUnchangedLayer) { 745 TEST_F(DamageTrackerTest, VerifyDamageForNewUnchangedLayer) {
746 // If child2 is added to the layer tree, but it doesn't have any explicit 746 // If child2 is added to the layer tree, but it doesn't have any explicit
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
1381 1381
1382 ASSERT_TRUE(root == root->render_target()); 1382 ASSERT_TRUE(root == root->render_target());
1383 RenderSurfaceImpl* target_surface = root->render_surface(); 1383 RenderSurfaceImpl* target_surface = root->render_surface();
1384 1384
1385 LayerImplList empty_list; 1385 LayerImplList empty_list;
1386 target_surface->damage_tracker()->UpdateDamageTrackingState( 1386 target_surface->damage_tracker()->UpdateDamageTrackingState(
1387 empty_list, 1387 empty_list,
1388 target_surface->OwningLayerId(), 1388 target_surface->OwningLayerId(),
1389 false, 1389 false,
1390 gfx::Rect(), 1390 gfx::Rect(),
1391 NULL, 1391 nullptr,
1392 FilterOperations()); 1392 FilterOperations());
1393 1393
1394 gfx::Rect damage_rect = 1394 gfx::Rect damage_rect =
1395 target_surface->damage_tracker()->current_damage_rect(); 1395 target_surface->damage_tracker()->current_damage_rect();
1396 EXPECT_TRUE(damage_rect.IsEmpty()); 1396 EXPECT_TRUE(damage_rect.IsEmpty());
1397 } 1397 }
1398 1398
1399 TEST_F(DamageTrackerTest, VerifyDamageAccumulatesUntilReset) { 1399 TEST_F(DamageTrackerTest, VerifyDamageAccumulatesUntilReset) {
1400 // If damage is not cleared, it should accumulate. 1400 // If damage is not cleared, it should accumulate.
1401 1401
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 gfx::Rect root_damage_rect = 1462 gfx::Rect root_damage_rect =
1463 root->render_surface()->damage_tracker()->current_damage_rect(); 1463 root->render_surface()->damage_tracker()->current_damage_rect();
1464 gfx::Rect damage_we_care_about = gfx::Rect(i, i); 1464 gfx::Rect damage_we_care_about = gfx::Rect(i, i);
1465 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); 1465 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right());
1466 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); 1466 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom());
1467 } 1467 }
1468 } 1468 }
1469 1469
1470 } // namespace 1470 } // namespace
1471 } // namespace cc 1471 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_sorter.cc » ('j') | cc/trees/layer_tree_host_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698