| 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" |
| 11 #include "cc/resources/picture_pile_impl.h" | 11 #include "cc/resources/picture_pile_impl.h" |
| 12 #include "skia/ext/analysis_canvas.h" | 12 #include "skia/ext/analysis_canvas.h" |
| 13 #include "third_party/skia/include/core/SkCanvas.h" | 13 #include "third_party/skia/include/core/SkCanvas.h" |
| 14 #include "third_party/skia/include/core/SkPictureRecorder.h" | 14 #include "third_party/skia/include/core/SkPictureRecorder.h" |
| 15 #include "ui/gfx/geometry/rect_conversions.h" | 15 #include "ui/gfx/geometry/rect_conversions.h" |
| 16 | 16 |
| 17 namespace cc { | 17 namespace cc { |
| 18 | 18 |
| 19 scoped_refptr<PicturePileImpl> PicturePileImpl::Create() { | 19 scoped_refptr<PicturePileImpl> PicturePileImpl::Create() { |
| 20 return make_scoped_refptr(new PicturePileImpl); | 20 return make_scoped_refptr(new PicturePileImpl); |
| 21 } | 21 } |
| 22 | 22 |
| 23 scoped_refptr<PicturePileImpl> PicturePileImpl::CreateFromOther( | 23 scoped_refptr<PicturePileImpl> PicturePileImpl::CreateFromPicturePile( |
| 24 const PicturePileBase* 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 is_solid_color_(false), | 32 is_solid_color_(false), |
| 33 solid_color_(SK_ColorTRANSPARENT), | 33 solid_color_(SK_ColorTRANSPARENT), |
| 34 has_any_recordings_(false), | 34 has_any_recordings_(false), |
| 35 is_mask_(false), | 35 is_mask_(false), |
| 36 clear_canvas_with_debug_color_(false), | 36 clear_canvas_with_debug_color_(false), |
| 37 min_contents_scale_(0.f), | 37 min_contents_scale_(0.f), |
| 38 slow_down_raster_scale_factor_for_debug_(0), | 38 slow_down_raster_scale_factor_for_debug_(0), |
| 39 should_attempt_to_use_distance_field_text_(false) { | 39 should_attempt_to_use_distance_field_text_(false) { |
| 40 } | 40 } |
| 41 | 41 |
| 42 PicturePileImpl::PicturePileImpl(const PicturePileBase* other) | 42 PicturePileImpl::PicturePileImpl(const PicturePile* other) |
| 43 : picture_map_(other->picture_map_), | 43 : picture_map_(other->picture_map_), |
| 44 tiling_(other->tiling_), | 44 tiling_(other->tiling_), |
| 45 background_color_(other->background_color_), | 45 background_color_(other->background_color_), |
| 46 contents_opaque_(other->contents_opaque_), | 46 contents_opaque_(other->contents_opaque_), |
| 47 contents_fill_bounds_completely_(other->contents_fill_bounds_completely_), | 47 contents_fill_bounds_completely_(other->contents_fill_bounds_completely_), |
| 48 is_solid_color_(other->is_solid_color_), | 48 is_solid_color_(other->is_solid_color_), |
| 49 solid_color_(other->solid_color_), | 49 solid_color_(other->solid_color_), |
| 50 recorded_viewport_(other->recorded_viewport_), | 50 recorded_viewport_(other->recorded_viewport_), |
| 51 has_any_recordings_(other->has_any_recordings_), | 51 has_any_recordings_(other->has_any_recordings_), |
| 52 is_mask_(other->is_mask_), | 52 is_mask_(other->is_mask_), |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 ++it) { | 484 ++it) { |
| 485 const Picture* picture = it->second.GetPicture(); | 485 const Picture* picture = it->second.GetPicture(); |
| 486 if (picture && (processed_pictures.count(picture) == 0)) { | 486 if (picture && (processed_pictures.count(picture) == 0)) { |
| 487 picture->EmitTraceSnapshot(); | 487 picture->EmitTraceSnapshot(); |
| 488 processed_pictures.insert(picture); | 488 processed_pictures.insert(picture); |
| 489 } | 489 } |
| 490 } | 490 } |
| 491 } | 491 } |
| 492 | 492 |
| 493 } // namespace cc | 493 } // namespace cc |
| OLD | NEW |