OLD | NEW |
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 "cc/playback/pixel_ref_map.h" | 5 #include "cc/playback/pixel_ref_map.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "cc/playback/picture.h" | 10 #include "cc/playback/picture.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // | x | | x | | | 32 // | x | | x | | |
33 // |---|---|---|---| | 33 // |---|---|---|---| |
34 // | | x | | x | | 34 // | | x | | x | |
35 // |---|---|---|---| | 35 // |---|---|---|---| |
36 // | x | | x | | | 36 // | x | | x | | |
37 // |---|---|---|---| | 37 // |---|---|---|---| |
38 SkBitmap discardable_bitmap[4][4]; | 38 SkBitmap discardable_bitmap[4][4]; |
39 for (int y = 0; y < 4; ++y) { | 39 for (int y = 0; y < 4; ++y) { |
40 for (int x = 0; x < 4; ++x) { | 40 for (int x = 0; x < 4; ++x) { |
41 if ((x + y) & 1) { | 41 if ((x + y) & 1) { |
42 CreateBitmap(gfx::Size(500, 500), "discardable", | 42 CreateDiscardableBitmap(gfx::Size(500, 500), &discardable_bitmap[y][x]); |
43 &discardable_bitmap[y][x]); | |
44 SkPaint paint; | 43 SkPaint paint; |
45 content_layer_client.add_draw_bitmap( | 44 content_layer_client.add_draw_bitmap( |
46 discardable_bitmap[y][x], gfx::Point(x * 512 + 6, y * 512 + 6), | 45 discardable_bitmap[y][x], gfx::Point(x * 512 + 6, y * 512 + 6), |
47 paint); | 46 paint); |
48 } | 47 } |
49 } | 48 } |
50 } | 49 } |
51 | 50 |
52 scoped_refptr<Picture> picture = | 51 scoped_refptr<Picture> picture = |
53 Picture::Create(layer_rect, &content_layer_client, tile_grid_size, true, | 52 Picture::Create(layer_rect, &content_layer_client, tile_grid_size, true, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // | x | | x | | | 153 // | x | | x | | |
155 // |---|---|---|---| | 154 // |---|---|---|---| |
156 // | | x | | x | | 155 // | | x | | x | |
157 // |---|---|---|---| | 156 // |---|---|---|---| |
158 // | x | | x | | | 157 // | x | | x | | |
159 // |---|---|---|---| | 158 // |---|---|---|---| |
160 SkBitmap discardable_bitmap[4][4]; | 159 SkBitmap discardable_bitmap[4][4]; |
161 for (int y = 0; y < 4; ++y) { | 160 for (int y = 0; y < 4; ++y) { |
162 for (int x = 0; x < 4; ++x) { | 161 for (int x = 0; x < 4; ++x) { |
163 if ((x + y) & 1) { | 162 if ((x + y) & 1) { |
164 CreateBitmap(gfx::Size(500, 500), "discardable", | 163 CreateDiscardableBitmap(gfx::Size(500, 500), &discardable_bitmap[y][x]); |
165 &discardable_bitmap[y][x]); | |
166 SkPaint paint; | 164 SkPaint paint; |
167 content_layer_client.add_draw_bitmap( | 165 content_layer_client.add_draw_bitmap( |
168 discardable_bitmap[y][x], | 166 discardable_bitmap[y][x], |
169 gfx::Point(1024 + x * 512 + 6, y * 512 + 6), paint); | 167 gfx::Point(1024 + x * 512 + 6, y * 512 + 6), paint); |
170 } | 168 } |
171 } | 169 } |
172 } | 170 } |
173 | 171 |
174 scoped_refptr<Picture> picture = | 172 scoped_refptr<Picture> picture = |
175 Picture::Create(layer_rect, &content_layer_client, tile_grid_size, true, | 173 Picture::Create(layer_rect, &content_layer_client, tile_grid_size, true, |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 // | x | | x | | | 295 // | x | | x | | |
298 // |---|---|---|---| | 296 // |---|---|---|---| |
299 // | | x | | x | | 297 // | | x | | x | |
300 // |---|---|---|---| | 298 // |---|---|---|---| |
301 // | x | | x | | | 299 // | x | | x | | |
302 // |---|---|---|---| | 300 // |---|---|---|---| |
303 SkBitmap discardable_bitmap[4][4]; | 301 SkBitmap discardable_bitmap[4][4]; |
304 for (int y = 0; y < 4; ++y) { | 302 for (int y = 0; y < 4; ++y) { |
305 for (int x = 0; x < 4; ++x) { | 303 for (int x = 0; x < 4; ++x) { |
306 if ((x + y) & 1) { | 304 if ((x + y) & 1) { |
307 CreateBitmap(gfx::Size(500, 500), "discardable", | 305 CreateDiscardableBitmap(gfx::Size(500, 500), &discardable_bitmap[y][x]); |
308 &discardable_bitmap[y][x]); | |
309 SkPaint paint; | 306 SkPaint paint; |
310 content_layer_client.add_draw_bitmap( | 307 content_layer_client.add_draw_bitmap( |
311 discardable_bitmap[y][x], gfx::Point(x * 512 + 6, y * 512 + 6), | 308 discardable_bitmap[y][x], gfx::Point(x * 512 + 6, y * 512 + 6), |
312 paint); | 309 paint); |
313 } | 310 } |
314 } | 311 } |
315 } | 312 } |
316 | 313 |
317 scoped_refptr<Picture> picture = | 314 scoped_refptr<Picture> picture = |
318 Picture::Create(layer_rect, &content_layer_client, tile_grid_size, true, | 315 Picture::Create(layer_rect, &content_layer_client, tile_grid_size, true, |
(...skipping 17 matching lines...) Expand all Loading... |
336 EXPECT_FALSE(++iterator) << x << " " << y; | 333 EXPECT_FALSE(++iterator) << x << " " << y; |
337 } else { | 334 } else { |
338 EXPECT_FALSE(iterator) << x << " " << y; | 335 EXPECT_FALSE(iterator) << x << " " << y; |
339 } | 336 } |
340 } | 337 } |
341 } | 338 } |
342 } | 339 } |
343 | 340 |
344 } // namespace | 341 } // namespace |
345 } // namespace cc | 342 } // namespace cc |
OLD | NEW |