| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/playback/raster_source.h" | 5 #include "cc/playback/raster_source.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "cc/base/region.h" | 10 #include "cc/base/region.h" |
| 11 #include "cc/debug/debug_colors.h" | 11 #include "cc/debug/debug_colors.h" |
| 12 #include "cc/playback/display_item_list.h" | 12 #include "cc/playback/display_item_list.h" |
| 13 #include "cc/playback/image_hijack_canvas.h" | 13 #include "cc/playback/image_hijack_canvas.h" |
| 14 #include "cc/playback/skip_image_canvas.h" | 14 #include "cc/playback/skip_image_canvas.h" |
| 15 #include "skia/ext/analysis_canvas.h" | 15 #include "skia/ext/analysis_canvas.h" |
| 16 #include "third_party/skia/include/core/SkCanvas.h" | 16 #include "third_party/skia/include/core/SkCanvas.h" |
| 17 #include "third_party/skia/include/core/SkClipStack.h" | 17 #include "third_party/skia/include/core/SkClipStack.h" |
| 18 #include "third_party/skia/include/core/SkPictureRecorder.h" | 18 #include "third_party/skia/include/core/SkPictureRecorder.h" |
| 19 #include "ui/gfx/geometry/rect_conversions.h" | 19 #include "ui/gfx/geometry/rect_conversions.h" |
| 20 | 20 |
| 21 namespace cc { | 21 namespace cc { |
| 22 | 22 |
| 23 scoped_refptr<RasterSource> RasterSource::CreateFromRecordingSource( | 23 scoped_refptr<RasterSource> RasterSource::CreateFromRecordingSource( |
| 24 const RecordingSource* other, | 24 const RecordingSource* other, |
| 25 bool can_use_lcd_text) { | 25 bool can_use_lcd_text) { |
| 26 return make_scoped_refptr(new RasterSource(other, can_use_lcd_text)); | 26 return make_scoped_refptr(new RasterSource(other, can_use_lcd_text)); |
| 27 } | 27 } |
| 28 | 28 |
| 29 RasterSource::RasterSource(const RecordingSource* other, bool can_use_lcd_text) | 29 RasterSource::RasterSource(const RecordingSource* other, bool can_use_lcd_text) |
| 30 : display_list_(other->display_list_), | 30 : display_list_(other->inputs_.display_list), |
| 31 painter_reported_memory_usage_(other->painter_reported_memory_usage_), | 31 painter_reported_memory_usage_( |
| 32 other->inputs_.painter_reported_memory_usage), |
| 32 background_color_(other->background_color_), | 33 background_color_(other->background_color_), |
| 33 requires_clear_(other->requires_clear_), | 34 requires_clear_(other->requires_clear_), |
| 34 can_use_lcd_text_(can_use_lcd_text), | 35 can_use_lcd_text_(can_use_lcd_text), |
| 35 is_solid_color_(other->is_solid_color_), | 36 is_solid_color_(other->is_solid_color_), |
| 36 solid_color_(other->solid_color_), | 37 solid_color_(other->solid_color_), |
| 37 recorded_viewport_(other->recorded_viewport_), | 38 recorded_viewport_(other->inputs_.recorded_viewport), |
| 38 size_(other->size_), | 39 size_(other->size_), |
| 39 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), | 40 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), |
| 40 slow_down_raster_scale_factor_for_debug_( | 41 slow_down_raster_scale_factor_for_debug_( |
| 41 other->slow_down_raster_scale_factor_for_debug_), | 42 other->slow_down_raster_scale_factor_for_debug_), |
| 42 should_attempt_to_use_distance_field_text_(false), | 43 should_attempt_to_use_distance_field_text_(false), |
| 43 image_decode_controller_(nullptr) { | 44 image_decode_controller_(nullptr) {} |
| 44 } | |
| 45 | 45 |
| 46 RasterSource::RasterSource(const RasterSource* other, bool can_use_lcd_text) | 46 RasterSource::RasterSource(const RasterSource* other, bool can_use_lcd_text) |
| 47 : display_list_(other->display_list_), | 47 : display_list_(other->display_list_), |
| 48 painter_reported_memory_usage_(other->painter_reported_memory_usage_), | 48 painter_reported_memory_usage_(other->painter_reported_memory_usage_), |
| 49 background_color_(other->background_color_), | 49 background_color_(other->background_color_), |
| 50 requires_clear_(other->requires_clear_), | 50 requires_clear_(other->requires_clear_), |
| 51 can_use_lcd_text_(can_use_lcd_text), | 51 can_use_lcd_text_(can_use_lcd_text), |
| 52 is_solid_color_(other->is_solid_color_), | 52 is_solid_color_(other->is_solid_color_), |
| 53 solid_color_(other->solid_color_), | 53 solid_color_(other->solid_color_), |
| 54 recorded_viewport_(other->recorded_viewport_), | 54 recorded_viewport_(other->recorded_viewport_), |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 DCHECK(image_decode_controller); | 301 DCHECK(image_decode_controller); |
| 302 image_decode_controller_ = image_decode_controller; | 302 image_decode_controller_ = image_decode_controller; |
| 303 } | 303 } |
| 304 | 304 |
| 305 RasterSource::PlaybackSettings::PlaybackSettings() | 305 RasterSource::PlaybackSettings::PlaybackSettings() |
| 306 : playback_to_shared_canvas(false), | 306 : playback_to_shared_canvas(false), |
| 307 skip_images(false), | 307 skip_images(false), |
| 308 use_image_hijack_canvas(true) {} | 308 use_image_hijack_canvas(true) {} |
| 309 | 309 |
| 310 } // namespace cc | 310 } // namespace cc |
| OLD | NEW |