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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 rects.push_back(SkRect::MakeXYWH(rect.x(), rect.y(), 1, 1)); | 450 rects.push_back(SkRect::MakeXYWH(rect.x(), rect.y(), 1, 1)); |
451 } | 451 } |
452 | 452 |
453 // Force re-raster with newly injected content | 453 // Force re-raster with newly injected content |
454 active_recording_source->Rerecord(); | 454 active_recording_source->Rerecord(); |
455 | 455 |
456 scoped_refptr<FakeRasterSource> updated_active_raster_source = | 456 scoped_refptr<FakeRasterSource> updated_active_raster_source = |
457 FakeRasterSource::CreateFromRecordingSource(active_recording_source.get(), | 457 FakeRasterSource::CreateFromRecordingSource(active_recording_source.get(), |
458 false); | 458 false); |
459 | 459 |
| 460 RasterSource::PlaybackSettings playback_settings; |
| 461 playback_settings.playback_to_shared_canvas = true; |
460 std::vector<SkRect>::const_iterator rect_iter = rects.begin(); | 462 std::vector<SkRect>::const_iterator rect_iter = rects.begin(); |
461 for (tile_iter = tiles.begin(); tile_iter < tiles.end(); tile_iter++) { | 463 for (tile_iter = tiles.begin(); tile_iter < tiles.end(); tile_iter++) { |
462 MockCanvas mock_canvas(1000, 1000); | 464 MockCanvas mock_canvas(1000, 1000); |
463 const bool include_images = true; | 465 const gfx::Rect& content_rect = (*tile_iter)->content_rect(); |
464 updated_active_raster_source->PlaybackToSharedCanvas( | 466 updated_active_raster_source->PlaybackToCanvas( |
465 &mock_canvas, (*tile_iter)->content_rect(), 1.0f, include_images); | 467 &mock_canvas, content_rect, content_rect, 1.0f, playback_settings); |
466 | 468 |
467 // This test verifies that when drawing the contents of a specific tile | 469 // This test verifies that when drawing the contents of a specific tile |
468 // at content scale 1.0, the playback canvas never receives content from | 470 // at content scale 1.0, the playback canvas never receives content from |
469 // neighboring tiles which indicates that the tile grid embedded in | 471 // neighboring tiles which indicates that the tile grid embedded in |
470 // SkPicture is perfectly aligned with the compositor's tiles. | 472 // SkPicture is perfectly aligned with the compositor's tiles. |
471 EXPECT_EQ(1u, mock_canvas.rects_.size()); | 473 EXPECT_EQ(1u, mock_canvas.rects_.size()); |
472 EXPECT_EQ(*rect_iter, mock_canvas.rects_[0]); | 474 EXPECT_EQ(*rect_iter, mock_canvas.rects_[0]); |
473 rect_iter++; | 475 rect_iter++; |
474 } | 476 } |
475 } | 477 } |
(...skipping 4438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4914 // New low res tiling. | 4916 // New low res tiling. |
4915 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); | 4917 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); |
4916 | 4918 |
4917 // This tiling will be high res now, it won't contain low res content since it | 4919 // This tiling will be high res now, it won't contain low res content since it |
4918 // was all destroyed. | 4920 // was all destroyed. |
4919 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); | 4921 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); |
4920 } | 4922 } |
4921 | 4923 |
4922 } // namespace | 4924 } // namespace |
4923 } // namespace cc | 4925 } // namespace cc |
OLD | NEW |