OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <map> | 5 #include <map> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "cc/resources/picture_pile.h" | 8 #include "cc/resources/picture_pile.h" |
9 #include "cc/test/fake_content_layer_client.h" | 9 #include "cc/test/fake_content_layer_client.h" |
10 #include "cc/test/fake_rendering_stats_instrumentation.h" | 10 #include "cc/test/fake_rendering_stats_instrumentation.h" |
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 // Add a rect that doesn't cover the viewport completely, the solid state | 1449 // Add a rect that doesn't cover the viewport completely, the solid state |
1450 // will be false. | 1450 // will be false. |
1451 gfx::Rect smallRect = visible_rect; | 1451 gfx::Rect smallRect = visible_rect; |
1452 smallRect.Inset(10, 10, 10, 10); | 1452 smallRect.Inset(10, 10, 10, 10); |
1453 client_.add_draw_rect(smallRect, paint); | 1453 client_.add_draw_rect(smallRect, paint); |
1454 Region invalidation(visible_rect); | 1454 Region invalidation(visible_rect); |
1455 UpdateAndExpandInvalidation(&invalidation, tiling_size, visible_rect); | 1455 UpdateAndExpandInvalidation(&invalidation, tiling_size, visible_rect); |
1456 EXPECT_FALSE(pile_.is_solid_color()); | 1456 EXPECT_FALSE(pile_.is_solid_color()); |
1457 } | 1457 } |
1458 | 1458 |
| 1459 TEST_F(PicturePileTest, SetEmptyBounds) { |
| 1460 EXPECT_TRUE(pile_.is_solid_color()); |
| 1461 EXPECT_FALSE(pile_.tiling_size().IsEmpty()); |
| 1462 EXPECT_FALSE(pile_.picture_map().empty()); |
| 1463 EXPECT_TRUE(pile_.HasRecordings()); |
| 1464 pile_.SetEmptyBounds(); |
| 1465 EXPECT_FALSE(pile_.is_solid_color()); |
| 1466 EXPECT_TRUE(pile_.tiling_size().IsEmpty()); |
| 1467 EXPECT_TRUE(pile_.picture_map().empty()); |
| 1468 EXPECT_FALSE(pile_.HasRecordings()); |
| 1469 } |
| 1470 |
1459 } // namespace | 1471 } // namespace |
1460 } // namespace cc | 1472 } // namespace cc |
OLD | NEW |