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 20 matching lines...) Expand all Loading... |
31 } | 31 } |
32 | 32 |
33 scoped_refptr<PicturePileImpl> PicturePileImpl::CreateFromPicturePile( | 33 scoped_refptr<PicturePileImpl> PicturePileImpl::CreateFromPicturePile( |
34 const PicturePile* other) { | 34 const PicturePile* other) { |
35 return make_scoped_refptr(new PicturePileImpl(other)); | 35 return make_scoped_refptr(new PicturePileImpl(other)); |
36 } | 36 } |
37 | 37 |
38 PicturePileImpl::PicturePileImpl() | 38 PicturePileImpl::PicturePileImpl() |
39 : background_color_(SK_ColorTRANSPARENT), | 39 : background_color_(SK_ColorTRANSPARENT), |
40 requires_clear_(true), | 40 requires_clear_(true), |
| 41 can_use_lcd_text_(false), |
41 is_solid_color_(false), | 42 is_solid_color_(false), |
42 solid_color_(SK_ColorTRANSPARENT), | 43 solid_color_(SK_ColorTRANSPARENT), |
43 has_any_recordings_(false), | 44 has_any_recordings_(false), |
44 clear_canvas_with_debug_color_(kDefaultClearCanvasSetting), | 45 clear_canvas_with_debug_color_(kDefaultClearCanvasSetting), |
45 min_contents_scale_(0.f), | 46 min_contents_scale_(0.f), |
46 slow_down_raster_scale_factor_for_debug_(0), | 47 slow_down_raster_scale_factor_for_debug_(0), |
47 should_attempt_to_use_distance_field_text_(false) { | 48 should_attempt_to_use_distance_field_text_(false) { |
48 } | 49 } |
49 | 50 |
50 PicturePileImpl::PicturePileImpl(const PicturePile* other) | 51 PicturePileImpl::PicturePileImpl(const PicturePile* other) |
51 : picture_map_(other->picture_map_), | 52 : picture_map_(other->picture_map_), |
52 tiling_(other->tiling_), | 53 tiling_(other->tiling_), |
53 background_color_(SK_ColorTRANSPARENT), | 54 background_color_(SK_ColorTRANSPARENT), |
54 requires_clear_(true), | 55 requires_clear_(true), |
| 56 can_use_lcd_text_(other->can_use_lcd_text_), |
55 is_solid_color_(other->is_solid_color_), | 57 is_solid_color_(other->is_solid_color_), |
56 solid_color_(other->solid_color_), | 58 solid_color_(other->solid_color_), |
57 recorded_viewport_(other->recorded_viewport_), | 59 recorded_viewport_(other->recorded_viewport_), |
58 has_any_recordings_(other->has_any_recordings_), | 60 has_any_recordings_(other->has_any_recordings_), |
59 clear_canvas_with_debug_color_(kDefaultClearCanvasSetting), | 61 clear_canvas_with_debug_color_(kDefaultClearCanvasSetting), |
60 min_contents_scale_(other->min_contents_scale_), | 62 min_contents_scale_(other->min_contents_scale_), |
61 slow_down_raster_scale_factor_for_debug_( | 63 slow_down_raster_scale_factor_for_debug_( |
62 other->slow_down_raster_scale_factor_for_debug_), | 64 other->slow_down_raster_scale_factor_for_debug_), |
63 should_attempt_to_use_distance_field_text_(false) { | 65 should_attempt_to_use_distance_field_text_(false) { |
64 } | 66 } |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 continue; | 432 continue; |
431 | 433 |
432 const Picture* picture = map_iter->second.GetPicture(); | 434 const Picture* picture = map_iter->second.GetPicture(); |
433 if (picture && (appended_pictures.count(picture) == 0)) { | 435 if (picture && (appended_pictures.count(picture) == 0)) { |
434 appended_pictures.insert(picture); | 436 appended_pictures.insert(picture); |
435 TracedValue::AppendIDRef(picture, pictures); | 437 TracedValue::AppendIDRef(picture, pictures); |
436 } | 438 } |
437 } | 439 } |
438 } | 440 } |
439 | 441 |
| 442 bool PicturePileImpl::CanUseLCDText() const { |
| 443 return can_use_lcd_text_; |
| 444 } |
| 445 |
440 PicturePileImpl::PixelRefIterator::PixelRefIterator( | 446 PicturePileImpl::PixelRefIterator::PixelRefIterator( |
441 const gfx::Rect& content_rect, | 447 const gfx::Rect& content_rect, |
442 float contents_scale, | 448 float contents_scale, |
443 const PicturePileImpl* picture_pile) | 449 const PicturePileImpl* picture_pile) |
444 : picture_pile_(picture_pile), | 450 : picture_pile_(picture_pile), |
445 layer_rect_( | 451 layer_rect_( |
446 gfx::ScaleToEnclosingRect(content_rect, 1.f / contents_scale)), | 452 gfx::ScaleToEnclosingRect(content_rect, 1.f / contents_scale)), |
447 tile_iterator_(&picture_pile_->tiling_, | 453 tile_iterator_(&picture_pile_->tiling_, |
448 layer_rect_, | 454 layer_rect_, |
449 false /* include_borders */) { | 455 false /* include_borders */) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 ++it) { | 500 ++it) { |
495 const Picture* picture = it->second.GetPicture(); | 501 const Picture* picture = it->second.GetPicture(); |
496 if (picture && (processed_pictures.count(picture) == 0)) { | 502 if (picture && (processed_pictures.count(picture) == 0)) { |
497 picture->EmitTraceSnapshot(); | 503 picture->EmitTraceSnapshot(); |
498 processed_pictures.insert(picture); | 504 processed_pictures.insert(picture); |
499 } | 505 } |
500 } | 506 } |
501 } | 507 } |
502 | 508 |
503 } // namespace cc | 509 } // namespace cc |
OLD | NEW |