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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "cc/layers/append_quads_data.h" | 9 #include "cc/layers/append_quads_data.h" |
10 #include "cc/layers/picture_layer.h" | 10 #include "cc/layers/picture_layer.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 active_pile->RemoveRecordingAt(0, 0); | 208 active_pile->RemoveRecordingAt(0, 0); |
209 active_pile->AddRecordingAt(0, 0); | 209 active_pile->AddRecordingAt(0, 0); |
210 | 210 |
211 SkBitmap store; | 211 SkBitmap store; |
212 store.setConfig(SkBitmap::kNo_Config, 1000, 1000); | 212 store.setConfig(SkBitmap::kNo_Config, 1000, 1000); |
213 SkDevice device(store); | 213 SkDevice device(store); |
214 | 214 |
215 std::vector<SkRect>::const_iterator rect_iter = rects.begin(); | 215 std::vector<SkRect>::const_iterator rect_iter = rects.begin(); |
216 for (tile_iter = tiles.begin(); tile_iter < tiles.end(); tile_iter++) { | 216 for (tile_iter = tiles.begin(); tile_iter < tiles.end(); tile_iter++) { |
217 MockCanvas mock_canvas(&device); | 217 MockCanvas mock_canvas(&device); |
218 active_pile->Raster(&mock_canvas, | 218 active_pile->RasterDirect( |
219 (*tile_iter)->content_rect(), | 219 &mock_canvas, (*tile_iter)->content_rect(), 1.0f, NULL); |
220 1.0f, | |
221 NULL); | |
222 | 220 |
223 // This test verifies that when drawing the contents of a specific tile | 221 // This test verifies that when drawing the contents of a specific tile |
224 // at content scale 1.0, the playback canvas never receives content from | 222 // at content scale 1.0, the playback canvas never receives content from |
225 // neighboring tiles which indicates that the tile grid embedded in | 223 // neighboring tiles which indicates that the tile grid embedded in |
226 // SkPicture is perfectly aligned with the compositor's tiles. | 224 // SkPicture is perfectly aligned with the compositor's tiles. |
227 // Note: There are two rects: the initial clear and the explicitly | 225 EXPECT_EQ(1u, mock_canvas.rects_.size()); |
228 // recorded rect. We only care about the second one. | 226 EXPECT_RECT_EQ(*rect_iter, mock_canvas.rects_[0]); |
229 EXPECT_EQ(2u, mock_canvas.rects_.size()); | |
230 EXPECT_RECT_EQ(*rect_iter, mock_canvas.rects_[1]); | |
231 rect_iter++; | 227 rect_iter++; |
232 } | 228 } |
233 } | 229 } |
234 | 230 |
235 FakeImplProxy proxy_; | 231 FakeImplProxy proxy_; |
236 FakeLayerTreeHostImpl host_impl_; | 232 FakeLayerTreeHostImpl host_impl_; |
237 int id_; | 233 int id_; |
238 TestablePictureLayerImpl* pending_layer_; | 234 TestablePictureLayerImpl* pending_layer_; |
239 TestablePictureLayerImpl* active_layer_; | 235 TestablePictureLayerImpl* active_layer_; |
240 | 236 |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 AppendQuadsData data; | 848 AppendQuadsData data; |
853 data.allow_tile_draw_quads = false; | 849 data.allow_tile_draw_quads = false; |
854 active_layer_->AppendQuads(&quad_culler, &data); | 850 active_layer_->AppendQuads(&quad_culler, &data); |
855 | 851 |
856 ASSERT_EQ(1U, quad_culler.quad_list().size()); | 852 ASSERT_EQ(1U, quad_culler.quad_list().size()); |
857 EXPECT_EQ(DrawQuad::PICTURE_CONTENT, quad_culler.quad_list()[0]->material); | 853 EXPECT_EQ(DrawQuad::PICTURE_CONTENT, quad_culler.quad_list()[0]->material); |
858 } | 854 } |
859 | 855 |
860 } // namespace | 856 } // namespace |
861 } // namespace cc | 857 } // namespace cc |
OLD | NEW |