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 11 matching lines...) Expand all Loading... |
22 | 22 |
23 scoped_refptr<PicturePileImpl> PicturePileImpl::CreateFromPicturePile( | 23 scoped_refptr<PicturePileImpl> PicturePileImpl::CreateFromPicturePile( |
24 const PicturePile* other) { | 24 const PicturePile* other) { |
25 return make_scoped_refptr(new PicturePileImpl(other)); | 25 return make_scoped_refptr(new PicturePileImpl(other)); |
26 } | 26 } |
27 | 27 |
28 PicturePileImpl::PicturePileImpl() | 28 PicturePileImpl::PicturePileImpl() |
29 : background_color_(SK_ColorTRANSPARENT), | 29 : background_color_(SK_ColorTRANSPARENT), |
30 contents_opaque_(false), | 30 contents_opaque_(false), |
31 contents_fill_bounds_completely_(false), | 31 contents_fill_bounds_completely_(false), |
| 32 can_use_lcd_text_(false), |
32 is_solid_color_(false), | 33 is_solid_color_(false), |
33 solid_color_(SK_ColorTRANSPARENT), | 34 solid_color_(SK_ColorTRANSPARENT), |
34 has_any_recordings_(false), | 35 has_any_recordings_(false), |
35 is_mask_(false), | 36 is_mask_(false), |
36 clear_canvas_with_debug_color_(false), | 37 clear_canvas_with_debug_color_(false), |
37 min_contents_scale_(0.f), | 38 min_contents_scale_(0.f), |
38 slow_down_raster_scale_factor_for_debug_(0), | 39 slow_down_raster_scale_factor_for_debug_(0), |
39 should_attempt_to_use_distance_field_text_(false) { | 40 should_attempt_to_use_distance_field_text_(false) { |
40 } | 41 } |
41 | 42 |
42 PicturePileImpl::PicturePileImpl(const PicturePile* other) | 43 PicturePileImpl::PicturePileImpl(const PicturePile* other) |
43 : picture_map_(other->picture_map_), | 44 : picture_map_(other->picture_map_), |
44 tiling_(other->tiling_), | 45 tiling_(other->tiling_), |
45 background_color_(other->background_color_), | 46 background_color_(other->background_color_), |
46 contents_opaque_(other->contents_opaque_), | 47 contents_opaque_(other->contents_opaque_), |
47 contents_fill_bounds_completely_(other->contents_fill_bounds_completely_), | 48 contents_fill_bounds_completely_(other->contents_fill_bounds_completely_), |
| 49 can_use_lcd_text_(other->can_use_lcd_text_), |
48 is_solid_color_(other->is_solid_color_), | 50 is_solid_color_(other->is_solid_color_), |
49 solid_color_(other->solid_color_), | 51 solid_color_(other->solid_color_), |
50 recorded_viewport_(other->recorded_viewport_), | 52 recorded_viewport_(other->recorded_viewport_), |
51 has_any_recordings_(other->has_any_recordings_), | 53 has_any_recordings_(other->has_any_recordings_), |
52 is_mask_(other->is_mask_), | 54 is_mask_(other->is_mask_), |
53 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), | 55 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), |
54 min_contents_scale_(other->min_contents_scale_), | 56 min_contents_scale_(other->min_contents_scale_), |
55 slow_down_raster_scale_factor_for_debug_( | 57 slow_down_raster_scale_factor_for_debug_( |
56 other->slow_down_raster_scale_factor_for_debug_), | 58 other->slow_down_raster_scale_factor_for_debug_), |
57 should_attempt_to_use_distance_field_text_(false) { | 59 should_attempt_to_use_distance_field_text_(false) { |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 appended_pictures.insert(picture); | 422 appended_pictures.insert(picture); |
421 TracedValue::AppendIDRef(picture, pictures); | 423 TracedValue::AppendIDRef(picture, pictures); |
422 } | 424 } |
423 } | 425 } |
424 } | 426 } |
425 | 427 |
426 bool PicturePileImpl::IsMask() const { | 428 bool PicturePileImpl::IsMask() const { |
427 return is_mask_; | 429 return is_mask_; |
428 } | 430 } |
429 | 431 |
| 432 bool PicturePileImpl::CanUseLcdText() const { |
| 433 return can_use_lcd_text_; |
| 434 } |
| 435 |
430 PicturePileImpl::PixelRefIterator::PixelRefIterator( | 436 PicturePileImpl::PixelRefIterator::PixelRefIterator( |
431 const gfx::Rect& content_rect, | 437 const gfx::Rect& content_rect, |
432 float contents_scale, | 438 float contents_scale, |
433 const PicturePileImpl* picture_pile) | 439 const PicturePileImpl* picture_pile) |
434 : picture_pile_(picture_pile), | 440 : picture_pile_(picture_pile), |
435 layer_rect_( | 441 layer_rect_( |
436 gfx::ScaleToEnclosingRect(content_rect, 1.f / contents_scale)), | 442 gfx::ScaleToEnclosingRect(content_rect, 1.f / contents_scale)), |
437 tile_iterator_(&picture_pile_->tiling_, | 443 tile_iterator_(&picture_pile_->tiling_, |
438 layer_rect_, | 444 layer_rect_, |
439 false /* include_borders */) { | 445 false /* include_borders */) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 ++it) { | 490 ++it) { |
485 const Picture* picture = it->second.GetPicture(); | 491 const Picture* picture = it->second.GetPicture(); |
486 if (picture && (processed_pictures.count(picture) == 0)) { | 492 if (picture && (processed_pictures.count(picture) == 0)) { |
487 picture->EmitTraceSnapshot(); | 493 picture->EmitTraceSnapshot(); |
488 processed_pictures.insert(picture); | 494 processed_pictures.insert(picture); |
489 } | 495 } |
490 } | 496 } |
491 } | 497 } |
492 | 498 |
493 } // namespace cc | 499 } // namespace cc |
OLD | NEW |