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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 scoped_refptr<FakeRasterSource> updated_active_raster_source = | 332 scoped_refptr<FakeRasterSource> updated_active_raster_source = |
333 FakeRasterSource::CreateFromRecordingSource(active_recording_source.get(), | 333 FakeRasterSource::CreateFromRecordingSource(active_recording_source.get(), |
334 false); | 334 false); |
335 | 335 |
336 RasterSource::PlaybackSettings playback_settings; | 336 RasterSource::PlaybackSettings playback_settings; |
337 playback_settings.playback_to_shared_canvas = true; | 337 playback_settings.playback_to_shared_canvas = true; |
338 std::vector<SkRect>::const_iterator rect_iter = rects.begin(); | 338 std::vector<SkRect>::const_iterator rect_iter = rects.begin(); |
339 for (tile_iter = tiles.begin(); tile_iter < tiles.end(); tile_iter++) { | 339 for (tile_iter = tiles.begin(); tile_iter < tiles.end(); tile_iter++) { |
340 MockCanvas mock_canvas(1000, 1000); | 340 MockCanvas mock_canvas(1000, 1000); |
341 const gfx::Rect& content_rect = (*tile_iter)->content_rect(); | 341 const gfx::Rect& content_rect = (*tile_iter)->content_rect(); |
342 updated_active_raster_source->PlaybackToCanvas( | 342 updated_active_raster_source->RasterSource::PlaybackToCanvas( |
343 &mock_canvas, content_rect, content_rect, 1.0f, playback_settings); | 343 &mock_canvas, content_rect, content_rect, 1.0f, playback_settings); |
344 | 344 |
345 // This test verifies that when drawing the contents of a specific tile | 345 // This test verifies that when drawing the contents of a specific tile |
346 // at content scale 1.0, the playback canvas never receives content from | 346 // at content scale 1.0, the playback canvas never receives content from |
347 // neighboring tiles which indicates that the tile grid embedded in | 347 // neighboring tiles which indicates that the tile grid embedded in |
348 // SkPicture is perfectly aligned with the compositor's tiles. | 348 // SkPicture is perfectly aligned with the compositor's tiles. |
349 EXPECT_EQ(1u, mock_canvas.rects_.size()); | 349 EXPECT_EQ(1u, mock_canvas.rects_.size()); |
350 EXPECT_EQ(*rect_iter, mock_canvas.rects_[0]); | 350 EXPECT_EQ(*rect_iter, mock_canvas.rects_[0]); |
351 rect_iter++; | 351 rect_iter++; |
352 } | 352 } |
(...skipping 4409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4762 // New low res tiling. | 4762 // New low res tiling. |
4763 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); | 4763 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); |
4764 | 4764 |
4765 // This tiling will be high res now, it won't contain low res content since it | 4765 // This tiling will be high res now, it won't contain low res content since it |
4766 // was all destroyed. | 4766 // was all destroyed. |
4767 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); | 4767 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); |
4768 } | 4768 } |
4769 | 4769 |
4770 } // namespace | 4770 } // namespace |
4771 } // namespace cc | 4771 } // namespace cc |
OLD | NEW |