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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 EXPECT_EQ(1, pile_->tiling().num_tiles_x()); | 122 EXPECT_EQ(1, pile_->tiling().num_tiles_x()); |
123 EXPECT_EQ(1, pile_->tiling().num_tiles_y()); | 123 EXPECT_EQ(1, pile_->tiling().num_tiles_y()); |
124 | 124 |
125 TestPicturePile::PictureInfo& picture_info = | 125 TestPicturePile::PictureInfo& picture_info = |
126 pile_->picture_map().find(TestPicturePile::PictureMapKey(0, 0))->second; | 126 pile_->picture_map().find(TestPicturePile::PictureMapKey(0, 0))->second; |
127 EXPECT_TRUE(!!picture_info.GetPicture()); | 127 EXPECT_TRUE(!!picture_info.GetPicture()); |
128 | 128 |
129 int expected_inflation = pile_->buffer_pixels(); | 129 int expected_inflation = pile_->buffer_pixels(); |
130 | 130 |
131 Picture* base_picture = picture_info.GetPicture(); | 131 const Picture* base_picture = picture_info.GetPicture(); |
132 gfx::Rect base_picture_rect(pile_->tiling_size()); | 132 gfx::Rect base_picture_rect(pile_->tiling_size()); |
133 base_picture_rect.Inset(-expected_inflation, -expected_inflation); | 133 base_picture_rect.Inset(-expected_inflation, -expected_inflation); |
134 EXPECT_EQ(base_picture_rect.ToString(), | 134 EXPECT_EQ(base_picture_rect.ToString(), |
135 base_picture->LayerRect().ToString()); | 135 base_picture->LayerRect().ToString()); |
136 } | 136 } |
137 | 137 |
138 TEST_F(PicturePileTest, InvalidateOnTileBoundaryInflated) { | 138 TEST_F(PicturePileTest, InvalidateOnTileBoundaryInflated) { |
139 gfx::Size new_tiling_size = | 139 gfx::Size new_tiling_size = |
140 gfx::ToCeiledSize(gfx::ScaleSize(pile_->tiling_size(), 2.f)); | 140 gfx::ToCeiledSize(gfx::ScaleSize(pile_->tiling_size(), 2.f)); |
141 // This creates initial pictures. | 141 // This creates initial pictures. |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 } | 998 } |
999 } | 999 } |
1000 | 1000 |
1001 // No invalidation when shrinking. | 1001 // No invalidation when shrinking. |
1002 EXPECT_EQ(Region().ToString(), invalidation.ToString()); | 1002 EXPECT_EQ(Region().ToString(), invalidation.ToString()); |
1003 invalidation.Clear(); | 1003 invalidation.Clear(); |
1004 } | 1004 } |
1005 | 1005 |
1006 } // namespace | 1006 } // namespace |
1007 } // namespace cc | 1007 } // namespace cc |
OLD | NEW |