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 "base/debug/trace_event.h" | 5 #include "base/debug/trace_event.h" |
6 #include "cc/base/region.h" | 6 #include "cc/base/region.h" |
7 #include "cc/debug/debug_colors.h" | 7 #include "cc/debug/debug_colors.h" |
8 #include "cc/debug/rendering_stats.h" | 8 #include "cc/debug/rendering_stats.h" |
9 #include "cc/resources/picture_pile_impl.h" | 9 #include "cc/resources/picture_pile_impl.h" |
10 #include "skia/ext/analysis_canvas.h" | 10 #include "skia/ext/analysis_canvas.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 empty_bitmap.setConfig(SkBitmap::kNo_Config, content_rect.width(), | 255 empty_bitmap.setConfig(SkBitmap::kNo_Config, content_rect.width(), |
256 content_rect.height()); | 256 content_rect.height()); |
257 skia::AnalysisDevice device(empty_bitmap); | 257 skia::AnalysisDevice device(empty_bitmap); |
258 skia::AnalysisCanvas canvas(&device); | 258 skia::AnalysisCanvas canvas(&device); |
259 | 259 |
260 Raster(&canvas, content_rect, contents_scale); | 260 Raster(&canvas, content_rect, contents_scale); |
261 | 261 |
262 analysis->is_transparent = canvas.isTransparent(); | 262 analysis->is_transparent = canvas.isTransparent(); |
263 analysis->is_solid_color = canvas.getColorIfSolid(&analysis->solid_color); | 263 analysis->is_solid_color = canvas.getColorIfSolid(&analysis->solid_color); |
264 analysis->is_cheap_to_raster = canvas.isCheap(); | 264 analysis->is_cheap_to_raster = canvas.isCheap(); |
| 265 analysis->has_text = canvas.hasText(); |
265 canvas.consumeLazyPixelRefs(&analysis->lazy_pixel_refs); | 266 canvas.consumeLazyPixelRefs(&analysis->lazy_pixel_refs); |
266 } | 267 } |
267 | 268 |
268 PicturePileImpl::Analysis::Analysis() | 269 PicturePileImpl::Analysis::Analysis() |
269 : is_solid_color(false), | 270 : is_solid_color(false), |
270 is_transparent(false), | 271 is_transparent(false), |
| 272 has_text(false), |
271 is_cheap_to_raster(false) { | 273 is_cheap_to_raster(false) { |
272 } | 274 } |
273 | 275 |
274 PicturePileImpl::Analysis::~Analysis() { | 276 PicturePileImpl::Analysis::~Analysis() { |
275 } | 277 } |
276 | 278 |
277 } // namespace cc | 279 } // namespace cc |
OLD | NEW |