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

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

Issue 2075873002: Support general raster matrix for RasterSource and DisplayItemList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix a bug in PrepareForPlaybackToCanvas and fix cc_unittests Created 4 years, 6 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
« no previous file with comments | « no previous file | cc/playback/clip_display_item.h » ('j') | cc/playback/raster_source.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/playback/clip_display_item.h » ('j') | cc/playback/raster_source.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698