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

Side by Side Diff: cc/playback/recording_source_unittest.cc

Issue 1146813012: cc: Add tests for DisplayListRasterSource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: displaytest: . Created 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <vector> 5 #include <vector>
6 6
7 #include "cc/playback/display_list_raster_source.h" 7 #include "cc/playback/display_list_raster_source.h"
8 #include "cc/test/fake_display_list_recording_source.h" 8 #include "cc/test/fake_display_list_recording_source.h"
9 #include "cc/test/fake_picture_pile.h" 9 #include "cc/test/fake_picture_pile.h"
10 #include "cc/test/fake_picture_pile_impl.h" 10 #include "cc/test/fake_picture_pile_impl.h"
(...skipping 12 matching lines...) Expand all
23 scoped_ptr<FakePicturePile> CreateRecordingSource<FakePicturePile>( 23 scoped_ptr<FakePicturePile> CreateRecordingSource<FakePicturePile>(
24 const gfx::Rect& viewport, 24 const gfx::Rect& viewport,
25 const gfx::Size& grid_cell_size) { 25 const gfx::Size& grid_cell_size) {
26 return FakePicturePile::CreateFilledPile(grid_cell_size, viewport.size()); 26 return FakePicturePile::CreateFilledPile(grid_cell_size, viewport.size());
27 } 27 }
28 28
29 template <> 29 template <>
30 scoped_ptr<FakeDisplayListRecordingSource> CreateRecordingSource< 30 scoped_ptr<FakeDisplayListRecordingSource> CreateRecordingSource<
31 FakeDisplayListRecordingSource>(const gfx::Rect& viewport, 31 FakeDisplayListRecordingSource>(const gfx::Rect& viewport,
32 const gfx::Size& grid_cell_size) { 32 const gfx::Size& grid_cell_size) {
33 gfx::Rect layer_rect(viewport.right(), viewport.bottom());
33 scoped_ptr<FakeDisplayListRecordingSource> recording_source = 34 scoped_ptr<FakeDisplayListRecordingSource> recording_source =
34 FakeDisplayListRecordingSource::CreateRecordingSource(viewport); 35 FakeDisplayListRecordingSource::CreateRecordingSource(viewport,
36 layer_rect.size());
35 recording_source->SetGridCellSize(grid_cell_size); 37 recording_source->SetGridCellSize(grid_cell_size);
36 38
37 return recording_source.Pass(); 39 return recording_source.Pass();
38 } 40 }
39 41
40 template <class T> 42 template <class T>
41 scoped_refptr<RasterSource> CreateRasterSource(T* recording_source); 43 scoped_refptr<RasterSource> CreateRasterSource(T* recording_source);
42 44
43 template <> 45 template <>
44 scoped_refptr<RasterSource> CreateRasterSource( 46 scoped_refptr<RasterSource> CreateRasterSource(
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 EXPECT_FALSE(pixel_refs.empty()); 463 EXPECT_FALSE(pixel_refs.empty());
462 EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[0][0].pixelRef()); 464 EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[0][0].pixelRef());
463 EXPECT_TRUE(pixel_refs[1] == discardable_bitmap[0][1].pixelRef()); 465 EXPECT_TRUE(pixel_refs[1] == discardable_bitmap[0][1].pixelRef());
464 EXPECT_TRUE(pixel_refs[2] == discardable_bitmap[1][1].pixelRef()); 466 EXPECT_TRUE(pixel_refs[2] == discardable_bitmap[1][1].pixelRef());
465 EXPECT_EQ(3u, pixel_refs.size()); 467 EXPECT_EQ(3u, pixel_refs.size());
466 } 468 }
467 } 469 }
468 470
469 } // namespace 471 } // namespace
470 } // namespace cc 472 } // namespace cc
OLDNEW
« no previous file with comments | « cc/playback/display_list_recording_source_unittest.cc ('k') | cc/test/fake_display_list_recording_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698