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

Side by Side Diff: cc/test/fake_picture_pile_impl.cc

Issue 832963002: Revert of cc: Remove tile and scale specific code from raster source (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « cc/test/fake_picture_pile.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
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/test/fake_picture_pile_impl.h" 5 #include "cc/test/fake_picture_pile_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 14 matching lines...) Expand all
25 : PicturePileImpl(other), 25 : PicturePileImpl(other),
26 playback_allowed_event_(playback_allowed_event), 26 playback_allowed_event_(playback_allowed_event),
27 tile_grid_info_(other->GetTileGridInfoForTesting()) { 27 tile_grid_info_(other->GetTileGridInfoForTesting()) {
28 } 28 }
29 29
30 FakePicturePileImpl::~FakePicturePileImpl() {} 30 FakePicturePileImpl::~FakePicturePileImpl() {}
31 31
32 scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateFilledPile( 32 scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateFilledPile(
33 const gfx::Size& tile_size, 33 const gfx::Size& tile_size,
34 const gfx::Size& layer_bounds) { 34 const gfx::Size& layer_bounds) {
35 FakePicturePile pile(ImplSidePaintingSettings().minimum_contents_scale, 35 FakePicturePile pile;
36 ImplSidePaintingSettings().default_tile_grid_size);
37 pile.tiling().SetBorderTexels(0);
38 pile.tiling().SetTilingSize(layer_bounds); 36 pile.tiling().SetTilingSize(layer_bounds);
39 pile.tiling().SetMaxTextureSize(tile_size); 37 pile.tiling().SetMaxTextureSize(tile_size);
38 pile.SetTileGridSize(ImplSidePaintingSettings().default_tile_grid_size);
40 pile.SetRecordedViewport(gfx::Rect(layer_bounds)); 39 pile.SetRecordedViewport(gfx::Rect(layer_bounds));
41 pile.SetHasAnyRecordings(true); 40 pile.SetHasAnyRecordings(true);
42 41
43 scoped_refptr<FakePicturePileImpl> pile_impl( 42 scoped_refptr<FakePicturePileImpl> pile_impl(
44 new FakePicturePileImpl(&pile, nullptr)); 43 new FakePicturePileImpl(&pile, nullptr));
45 for (int x = 0; x < pile_impl->tiling().num_tiles_x(); ++x) { 44 for (int x = 0; x < pile_impl->tiling().num_tiles_x(); ++x) {
46 for (int y = 0; y < pile_impl->tiling().num_tiles_y(); ++y) 45 for (int y = 0; y < pile_impl->tiling().num_tiles_y(); ++y)
47 pile_impl->AddRecordingAt(x, y); 46 pile_impl->AddRecordingAt(x, y);
48 } 47 }
49 return pile_impl; 48 return pile_impl;
50 } 49 }
51 50
52 scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateEmptyPile( 51 scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateEmptyPile(
53 const gfx::Size& tile_size, 52 const gfx::Size& tile_size,
54 const gfx::Size& layer_bounds) { 53 const gfx::Size& layer_bounds) {
55 FakePicturePile pile(ImplSidePaintingSettings().minimum_contents_scale, 54 FakePicturePile pile;
56 ImplSidePaintingSettings().default_tile_grid_size);
57 pile.tiling().SetBorderTexels(0);
58 pile.tiling().SetTilingSize(layer_bounds); 55 pile.tiling().SetTilingSize(layer_bounds);
59 pile.tiling().SetMaxTextureSize(tile_size); 56 pile.tiling().SetMaxTextureSize(tile_size);
57 pile.SetTileGridSize(ImplSidePaintingSettings().default_tile_grid_size);
60 pile.SetRecordedViewport(gfx::Rect()); 58 pile.SetRecordedViewport(gfx::Rect());
61 pile.SetHasAnyRecordings(false); 59 pile.SetHasAnyRecordings(false);
62 return make_scoped_refptr(new FakePicturePileImpl(&pile, nullptr)); 60 return make_scoped_refptr(new FakePicturePileImpl(&pile, nullptr));
63 } 61 }
64 62
65 scoped_refptr<FakePicturePileImpl> 63 scoped_refptr<FakePicturePileImpl>
66 FakePicturePileImpl::CreateEmptyPileThatThinksItHasRecordings( 64 FakePicturePileImpl::CreateEmptyPileThatThinksItHasRecordings(
67 const gfx::Size& tile_size, 65 const gfx::Size& tile_size,
68 const gfx::Size& layer_bounds) { 66 const gfx::Size& layer_bounds) {
69 FakePicturePile pile(ImplSidePaintingSettings().minimum_contents_scale, 67 FakePicturePile pile;
70 ImplSidePaintingSettings().default_tile_grid_size);
71 pile.tiling().SetBorderTexels(0);
72 pile.tiling().SetTilingSize(layer_bounds); 68 pile.tiling().SetTilingSize(layer_bounds);
73 pile.tiling().SetMaxTextureSize(tile_size); 69 pile.tiling().SetMaxTextureSize(tile_size);
70 pile.SetTileGridSize(ImplSidePaintingSettings().default_tile_grid_size);
74 // This simulates a false positive for this flag. 71 // This simulates a false positive for this flag.
75 pile.SetRecordedViewport(gfx::Rect()); 72 pile.SetRecordedViewport(gfx::Rect());
76 pile.SetHasAnyRecordings(true); 73 pile.SetHasAnyRecordings(true);
77 return make_scoped_refptr(new FakePicturePileImpl(&pile, nullptr)); 74 return make_scoped_refptr(new FakePicturePileImpl(&pile, nullptr));
78 } 75 }
79 76
80 scoped_refptr<FakePicturePileImpl> 77 scoped_refptr<FakePicturePileImpl>
81 FakePicturePileImpl::CreateInfiniteFilledPile() { 78 FakePicturePileImpl::CreateInfiniteFilledPile() {
79 FakePicturePile pile;
82 gfx::Size size(std::numeric_limits<int>::max(), 80 gfx::Size size(std::numeric_limits<int>::max(),
83 std::numeric_limits<int>::max()); 81 std::numeric_limits<int>::max());
84 FakePicturePile pile(ImplSidePaintingSettings().minimum_contents_scale, size);
85 pile.tiling().SetBorderTexels(0);
86 pile.tiling().SetTilingSize(size); 82 pile.tiling().SetTilingSize(size);
87 pile.tiling().SetMaxTextureSize(size); 83 pile.tiling().SetMaxTextureSize(size);
84 pile.SetTileGridSize(size);
88 pile.SetRecordedViewport(gfx::Rect(size)); 85 pile.SetRecordedViewport(gfx::Rect(size));
89 pile.SetHasAnyRecordings(true); 86 pile.SetHasAnyRecordings(true);
90 87
91 scoped_refptr<FakePicturePileImpl> pile_impl( 88 scoped_refptr<FakePicturePileImpl> pile_impl(
92 new FakePicturePileImpl(&pile, nullptr)); 89 new FakePicturePileImpl(&pile, nullptr));
93 pile_impl->AddRecordingAt(0, 0); 90 pile_impl->AddRecordingAt(0, 0);
94 return pile_impl; 91 return pile_impl;
95 } 92 }
96 93
97 scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateFromPile( 94 scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateFromPile(
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 Clear(); 180 Clear();
184 tiling_.SetBorderTexels(new_buffer_pixels); 181 tiling_.SetBorderTexels(new_buffer_pixels);
185 } 182 }
186 183
187 void FakePicturePileImpl::Clear() { 184 void FakePicturePileImpl::Clear() {
188 picture_map_.clear(); 185 picture_map_.clear();
189 recorded_viewport_ = gfx::Rect(); 186 recorded_viewport_ = gfx::Rect();
190 } 187 }
191 188
192 } // namespace cc 189 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_picture_pile.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698