| 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( |  | 
| 24     const PicturePileBase* other) { |  | 
| 25   return make_scoped_refptr(new PicturePileImpl(other)); |  | 
| 26 } |  | 
| 27 |  | 
| 28 PicturePileImpl::PicturePileImpl() | 23 PicturePileImpl::PicturePileImpl() | 
| 29     : background_color_(SK_ColorTRANSPARENT), | 24     : background_color_(SK_ColorTRANSPARENT), | 
| 30       contents_opaque_(false), | 25       contents_opaque_(false), | 
| 31       contents_fill_bounds_completely_(false), | 26       contents_fill_bounds_completely_(false), | 
| 32       is_solid_color_(false), | 27       is_solid_color_(false), | 
| 33       solid_color_(SK_ColorTRANSPARENT), | 28       solid_color_(SK_ColorTRANSPARENT), | 
| 34       has_any_recordings_(false), | 29       has_any_recordings_(false), | 
| 35       is_mask_(false), | 30       is_mask_(false), | 
| 36       clear_canvas_with_debug_color_(false), | 31       clear_canvas_with_debug_color_(false), | 
| 37       min_contents_scale_(0.f), | 32       min_contents_scale_(0.f), | 
| 38       slow_down_raster_scale_factor_for_debug_(0), | 33       slow_down_raster_scale_factor_for_debug_(0), | 
| 39       should_attempt_to_use_distance_field_text_(false) { | 34       should_attempt_to_use_distance_field_text_(false) { | 
| 40 } | 35 } | 
| 41 | 36 | 
| 42 PicturePileImpl::PicturePileImpl(const PicturePileBase* other) | 37 PicturePileImpl::PicturePileImpl(const PicturePile* other) | 
| 43     : picture_map_(other->picture_map_), | 38     : picture_map_(other->picture_map_), | 
| 44       tiling_(other->tiling_), | 39       tiling_(other->tiling_), | 
| 45       background_color_(other->background_color_), | 40       background_color_(other->background_color_), | 
| 46       contents_opaque_(other->contents_opaque_), | 41       contents_opaque_(other->contents_opaque_), | 
| 47       contents_fill_bounds_completely_(other->contents_fill_bounds_completely_), | 42       contents_fill_bounds_completely_(other->contents_fill_bounds_completely_), | 
| 48       is_solid_color_(other->is_solid_color_), | 43       is_solid_color_(other->is_solid_color_), | 
| 49       solid_color_(other->solid_color_), | 44       solid_color_(other->solid_color_), | 
| 50       recorded_viewport_(other->recorded_viewport_), | 45       recorded_viewport_(other->recorded_viewport_), | 
| 51       has_any_recordings_(other->has_any_recordings_), | 46       has_any_recordings_(other->has_any_recordings_), | 
| 52       is_mask_(other->is_mask_), | 47       is_mask_(other->is_mask_), | 
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 484        ++it) { | 479        ++it) { | 
| 485     const Picture* picture = it->second.GetPicture(); | 480     const Picture* picture = it->second.GetPicture(); | 
| 486     if (picture && (processed_pictures.count(picture) == 0)) { | 481     if (picture && (processed_pictures.count(picture) == 0)) { | 
| 487       picture->EmitTraceSnapshot(); | 482       picture->EmitTraceSnapshot(); | 
| 488       processed_pictures.insert(picture); | 483       processed_pictures.insert(picture); | 
| 489     } | 484     } | 
| 490   } | 485   } | 
| 491 } | 486 } | 
| 492 | 487 | 
| 493 }  // namespace cc | 488 }  // namespace cc | 
| OLD | NEW | 
|---|