Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 1799883002: cc: Refactor SkipImageCanvas and create it during playback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 // Force re-raster with newly injected content 452 // Force re-raster with newly injected content
453 active_recording_source->Rerecord(); 453 active_recording_source->Rerecord();
454 454
455 scoped_refptr<FakeDisplayListRasterSource> updated_active_raster_source = 455 scoped_refptr<FakeDisplayListRasterSource> updated_active_raster_source =
456 FakeDisplayListRasterSource::CreateFromRecordingSource( 456 FakeDisplayListRasterSource::CreateFromRecordingSource(
457 active_recording_source.get(), false); 457 active_recording_source.get(), false);
458 458
459 std::vector<SkRect>::const_iterator rect_iter = rects.begin(); 459 std::vector<SkRect>::const_iterator rect_iter = rects.begin();
460 for (tile_iter = tiles.begin(); tile_iter < tiles.end(); tile_iter++) { 460 for (tile_iter = tiles.begin(); tile_iter < tiles.end(); tile_iter++) {
461 MockCanvas mock_canvas(1000, 1000); 461 MockCanvas mock_canvas(1000, 1000);
462 const bool include_images = true;
462 updated_active_raster_source->PlaybackToSharedCanvas( 463 updated_active_raster_source->PlaybackToSharedCanvas(
463 &mock_canvas, (*tile_iter)->content_rect(), 1.0f); 464 &mock_canvas, (*tile_iter)->content_rect(), 1.0f, include_images);
464 465
465 // This test verifies that when drawing the contents of a specific tile 466 // This test verifies that when drawing the contents of a specific tile
466 // at content scale 1.0, the playback canvas never receives content from 467 // at content scale 1.0, the playback canvas never receives content from
467 // neighboring tiles which indicates that the tile grid embedded in 468 // neighboring tiles which indicates that the tile grid embedded in
468 // SkPicture is perfectly aligned with the compositor's tiles. 469 // SkPicture is perfectly aligned with the compositor's tiles.
469 EXPECT_EQ(1u, mock_canvas.rects_.size()); 470 EXPECT_EQ(1u, mock_canvas.rects_.size());
470 EXPECT_EQ(*rect_iter, mock_canvas.rects_[0]); 471 EXPECT_EQ(*rect_iter, mock_canvas.rects_[0]);
471 rect_iter++; 472 rect_iter++;
472 } 473 }
473 } 474 }
(...skipping 4445 matching lines...) Expand 10 before | Expand all | Expand 10 after
4919 // New low res tiling. 4920 // New low res tiling.
4920 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); 4921 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles());
4921 4922
4922 // This tiling will be high res now, it won't contain low res content since it 4923 // This tiling will be high res now, it won't contain low res content since it
4923 // was all destroyed. 4924 // was all destroyed.
4924 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); 4925 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles());
4925 } 4926 }
4926 4927
4927 } // namespace 4928 } // namespace
4928 } // namespace cc 4929 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698