| OLD | NEW |
| 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 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1377 } | 1377 } |
| 1378 | 1378 |
| 1379 TEST_F(DamageTrackerTest, VerifyDamageForEmptyLayerList) { | 1379 TEST_F(DamageTrackerTest, VerifyDamageForEmptyLayerList) { |
| 1380 // Though it should never happen, its a good idea to verify that the damage | 1380 // Though it should never happen, its a good idea to verify that the damage |
| 1381 // tracker does not crash when it receives an empty layer_list. | 1381 // tracker does not crash when it receives an empty layer_list. |
| 1382 | 1382 |
| 1383 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_.active_tree(), 1); | 1383 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_.active_tree(), 1); |
| 1384 root->SetHasRenderSurface(true); | 1384 root->SetHasRenderSurface(true); |
| 1385 root->draw_properties().render_target = root.get(); | 1385 root->draw_properties().render_target = root.get(); |
| 1386 | 1386 |
| 1387 ASSERT_TRUE(root == root->render_target()); | 1387 ASSERT_EQ(root.get(), root->render_target()); |
| 1388 RenderSurfaceImpl* target_surface = root->render_surface(); | 1388 RenderSurfaceImpl* target_surface = root->render_surface(); |
| 1389 | 1389 |
| 1390 LayerImplList empty_list; | 1390 LayerImplList empty_list; |
| 1391 target_surface->damage_tracker()->UpdateDamageTrackingState( | 1391 target_surface->damage_tracker()->UpdateDamageTrackingState( |
| 1392 empty_list, | 1392 empty_list, |
| 1393 target_surface->OwningLayerId(), | 1393 target_surface->OwningLayerId(), |
| 1394 false, | 1394 false, |
| 1395 gfx::Rect(), | 1395 gfx::Rect(), |
| 1396 NULL, | 1396 NULL, |
| 1397 FilterOperations()); | 1397 FilterOperations()); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1466 gfx::Rect root_damage_rect = | 1466 gfx::Rect root_damage_rect = |
| 1467 root->render_surface()->damage_tracker()->current_damage_rect(); | 1467 root->render_surface()->damage_tracker()->current_damage_rect(); |
| 1468 gfx::Rect damage_we_care_about = gfx::Rect(i, i); | 1468 gfx::Rect damage_we_care_about = gfx::Rect(i, i); |
| 1469 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); | 1469 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); |
| 1470 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); | 1470 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); |
| 1471 } | 1471 } |
| 1472 } | 1472 } |
| 1473 | 1473 |
| 1474 } // namespace | 1474 } // namespace |
| 1475 } // namespace cc | 1475 } // namespace cc |
| OLD | NEW |