OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <algorithm> | 5 #include <algorithm> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "cc/base/region.h" | 9 #include "cc/base/region.h" |
10 #include "cc/debug/debug_colors.h" | 10 #include "cc/debug/debug_colors.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 empty_bitmap.setConfig(SkBitmap::kNo_Config, | 256 empty_bitmap.setConfig(SkBitmap::kNo_Config, |
257 content_rect.width(), | 257 content_rect.width(), |
258 content_rect.height()); | 258 content_rect.height()); |
259 skia::AnalysisDevice device(empty_bitmap); | 259 skia::AnalysisDevice device(empty_bitmap); |
260 skia::AnalysisCanvas canvas(&device); | 260 skia::AnalysisCanvas canvas(&device); |
261 | 261 |
262 Raster(&canvas, content_rect, contents_scale, NULL); | 262 Raster(&canvas, content_rect, contents_scale, NULL); |
263 | 263 |
264 analysis->is_transparent = canvas.isTransparent(); | 264 analysis->is_transparent = canvas.isTransparent(); |
265 analysis->is_solid_color = canvas.getColorIfSolid(&analysis->solid_color); | 265 analysis->is_solid_color = canvas.getColorIfSolid(&analysis->solid_color); |
266 analysis->is_cheap_to_raster = canvas.isCheap(); | |
267 analysis->has_text = canvas.hasText(); | 266 analysis->has_text = canvas.hasText(); |
268 canvas.consumeLazyPixelRefs(&analysis->lazy_pixel_refs); | 267 canvas.consumeLazyPixelRefs(&analysis->lazy_pixel_refs); |
269 } | 268 } |
270 | 269 |
271 PicturePileImpl::Analysis::Analysis() | 270 PicturePileImpl::Analysis::Analysis() |
272 : is_solid_color(false), | 271 : is_solid_color(false), |
273 is_transparent(false), | 272 is_transparent(false), |
274 has_text(false), | 273 has_text(false) { |
275 is_cheap_to_raster(false) { | |
276 } | 274 } |
277 | 275 |
278 PicturePileImpl::Analysis::~Analysis() { | 276 PicturePileImpl::Analysis::~Analysis() { |
279 } | 277 } |
280 | 278 |
281 PicturePileImpl::PixelRefIterator::PixelRefIterator( | 279 PicturePileImpl::PixelRefIterator::PixelRefIterator( |
282 gfx::Rect content_rect, | 280 gfx::Rect content_rect, |
283 float contents_scale, | 281 float contents_scale, |
284 const PicturePileImpl* picture_pile) | 282 const PicturePileImpl* picture_pile) |
285 : picture_pile_(picture_pile), | 283 : picture_pile_(picture_pile), |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 layer_rect_, | 331 layer_rect_, |
334 *picture_list_iterator_); | 332 *picture_list_iterator_); |
335 if (pixel_ref_iterator_) | 333 if (pixel_ref_iterator_) |
336 return; | 334 return; |
337 } | 335 } |
338 ++tile_iterator_; | 336 ++tile_iterator_; |
339 } while (AdvanceToTileWithPictures()); | 337 } while (AdvanceToTileWithPictures()); |
340 } | 338 } |
341 | 339 |
342 } // namespace cc | 340 } // namespace cc |
OLD | NEW |