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 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1425 client_.add_draw_rect(tiling_rect(), paint); | 1425 client_.add_draw_rect(tiling_rect(), paint); |
1426 client_.add_draw_rect(tiling_rect(), paint); | 1426 client_.add_draw_rect(tiling_rect(), paint); |
1427 client_.add_draw_rect(tiling_rect(), paint); | 1427 client_.add_draw_rect(tiling_rect(), paint); |
1428 client_.add_draw_rect(tiling_rect(), paint); | 1428 client_.add_draw_rect(tiling_rect(), paint); |
1429 client_.add_draw_rect(tiling_rect(), paint); | 1429 client_.add_draw_rect(tiling_rect(), paint); |
1430 Region invalidation5(tiling_rect()); | 1430 Region invalidation5(tiling_rect()); |
1431 UpdateAndExpandInvalidation(&invalidation5, tiling_size(), tiling_rect()); | 1431 UpdateAndExpandInvalidation(&invalidation5, tiling_size(), tiling_rect()); |
1432 EXPECT_FALSE(pile_.is_solid_color()); | 1432 EXPECT_FALSE(pile_.is_solid_color()); |
1433 } | 1433 } |
1434 | 1434 |
1435 TEST_F(PicturePileTest, NonSolidRectangleOnOffsetedLayerIsNonSolid) { | |
vmpstr
2014/10/29 21:41:58
Offset?
| |
1436 gfx::Rect tiling_rect(tiling_rect()); | |
1437 tiling_rect.Offset(gfx::Vector2d(10000, 0)); | |
1438 gfx::Size tiling_size(tiling_rect.x() + tiling_rect.width(), | |
vmpstr
2014/10/29 21:41:59
right, bottom? Also, why is the tiling size bigger
| |
1439 tiling_rect.y() + tiling_rect.height()); | |
1440 // |Setup()| will create pictures here that mess with the test, clear it! | |
1441 pile_.Clear(); | |
1442 | |
1443 SkPaint paint; | |
1444 paint.setColor(SK_ColorCYAN); | |
1445 | |
1446 // Add a rect that doesn't cover the viewport completely, the solid state | |
1447 // will be false. | |
1448 gfx::Rect smallRect = tiling_rect; | |
1449 smallRect.Inset(10, 10, 10, 10); | |
1450 client_.add_draw_rect(smallRect, paint); | |
1451 Region invalidation2(tiling_rect); | |
vmpstr
2014/10/29 21:41:59
just invalidation.
| |
1452 UpdateAndExpandInvalidation(&invalidation2, tiling_size, tiling_rect); | |
1453 EXPECT_FALSE(pile_.is_solid_color()); | |
1454 } | |
1455 | |
1435 } // namespace | 1456 } // namespace |
1436 } // namespace cc | 1457 } // namespace cc |
OLD | NEW |