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 "cc/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <limits> | 10 #include <limits> |
(...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1602 SetupTrees(pending_raster_source, active_raster_source); | 1602 SetupTrees(pending_raster_source, active_raster_source); |
1603 | 1603 |
1604 active_layer()->draw_properties().visible_layer_rect = visible_rect; | 1604 active_layer()->draw_properties().visible_layer_rect = visible_rect; |
1605 | 1605 |
1606 AppendQuadsData data; | 1606 AppendQuadsData data; |
1607 active_layer()->WillDraw(DRAW_MODE_SOFTWARE, nullptr); | 1607 active_layer()->WillDraw(DRAW_MODE_SOFTWARE, nullptr); |
1608 active_layer()->AppendQuads(render_pass.get(), &data); | 1608 active_layer()->AppendQuads(render_pass.get(), &data); |
1609 active_layer()->DidDraw(nullptr); | 1609 active_layer()->DidDraw(nullptr); |
1610 | 1610 |
1611 Region remaining = visible_rect; | 1611 Region remaining = visible_rect; |
1612 for (const auto& quad : render_pass->quad_list) { | 1612 for (auto* quad : render_pass->quad_list) { |
1613 EXPECT_TRUE(visible_rect.Contains(quad->rect)); | 1613 EXPECT_TRUE(visible_rect.Contains(quad->rect)); |
1614 EXPECT_TRUE(remaining.Contains(quad->rect)); | 1614 EXPECT_TRUE(remaining.Contains(quad->rect)); |
1615 remaining.Subtract(quad->rect); | 1615 remaining.Subtract(quad->rect); |
1616 } | 1616 } |
1617 | 1617 |
1618 EXPECT_TRUE(remaining.IsEmpty()); | 1618 EXPECT_TRUE(remaining.IsEmpty()); |
1619 } | 1619 } |
1620 | 1620 |
1621 TEST_F(PictureLayerImplTest, TileScalesWithSolidColorRasterSource) { | 1621 TEST_F(PictureLayerImplTest, TileScalesWithSolidColorRasterSource) { |
1622 gfx::Size layer_bounds(200, 200); | 1622 gfx::Size layer_bounds(200, 200); |
(...skipping 3378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5001 EXPECT_FLOAT_EQ(expected_contents_scale, | 5001 EXPECT_FLOAT_EQ(expected_contents_scale, |
5002 pending_layer_ptr->picture_layer_tiling_set() | 5002 pending_layer_ptr->picture_layer_tiling_set() |
5003 ->FindTilingWithResolution(HIGH_RESOLUTION) | 5003 ->FindTilingWithResolution(HIGH_RESOLUTION) |
5004 ->contents_scale()) | 5004 ->contents_scale()) |
5005 << "ideal_contents_scale: " << ideal_contents_scale; | 5005 << "ideal_contents_scale: " << ideal_contents_scale; |
5006 } | 5006 } |
5007 } | 5007 } |
5008 | 5008 |
5009 } // namespace | 5009 } // namespace |
5010 } // namespace cc | 5010 } // namespace cc |
OLD | NEW |