| 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 const gfx::Rect& recorded_viewport, |
| 27 const scoped_refptr<DisplayItemList>& display_list, |
| 28 const size_t& painter_reported_memory_usage) { |
| 29 return make_scoped_refptr(new RasterSource(other, can_use_lcd_text, |
| 30 recorded_viewport, display_list, |
| 31 painter_reported_memory_usage)); |
| 27 } | 32 } |
| 28 | 33 |
| 29 RasterSource::RasterSource(const RecordingSource* other, bool can_use_lcd_text) | 34 RasterSource::RasterSource(const RecordingSource* other, |
| 30 : display_list_(other->display_list_), | 35 bool can_use_lcd_text, |
| 31 painter_reported_memory_usage_(other->painter_reported_memory_usage_), | 36 const gfx::Rect& recorded_viewport, |
| 37 const scoped_refptr<DisplayItemList>& display_list, |
| 38 const size_t& painter_reported_memory_usage) |
| 39 : display_list_(display_list), |
| 40 painter_reported_memory_usage_(painter_reported_memory_usage), |
| 32 background_color_(other->background_color_), | 41 background_color_(other->background_color_), |
| 33 requires_clear_(other->requires_clear_), | 42 requires_clear_(other->requires_clear_), |
| 34 can_use_lcd_text_(can_use_lcd_text), | 43 can_use_lcd_text_(can_use_lcd_text), |
| 35 is_solid_color_(other->is_solid_color_), | 44 is_solid_color_(other->is_solid_color_), |
| 36 solid_color_(other->solid_color_), | 45 solid_color_(other->solid_color_), |
| 37 recorded_viewport_(other->recorded_viewport_), | 46 recorded_viewport_(recorded_viewport), |
| 38 size_(other->size_), | 47 size_(other->size_), |
| 39 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), | 48 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), |
| 40 slow_down_raster_scale_factor_for_debug_( | 49 slow_down_raster_scale_factor_for_debug_( |
| 41 other->slow_down_raster_scale_factor_for_debug_), | 50 other->slow_down_raster_scale_factor_for_debug_), |
| 42 should_attempt_to_use_distance_field_text_(false), | 51 should_attempt_to_use_distance_field_text_(false), |
| 43 image_decode_controller_(nullptr) { | 52 image_decode_controller_(nullptr) {} |
| 44 } | |
| 45 | 53 |
| 46 RasterSource::RasterSource(const RasterSource* other, bool can_use_lcd_text) | 54 RasterSource::RasterSource(const RasterSource* other, bool can_use_lcd_text) |
| 47 : display_list_(other->display_list_), | 55 : display_list_(other->display_list_), |
| 48 painter_reported_memory_usage_(other->painter_reported_memory_usage_), | 56 painter_reported_memory_usage_(other->painter_reported_memory_usage_), |
| 49 background_color_(other->background_color_), | 57 background_color_(other->background_color_), |
| 50 requires_clear_(other->requires_clear_), | 58 requires_clear_(other->requires_clear_), |
| 51 can_use_lcd_text_(can_use_lcd_text), | 59 can_use_lcd_text_(can_use_lcd_text), |
| 52 is_solid_color_(other->is_solid_color_), | 60 is_solid_color_(other->is_solid_color_), |
| 53 solid_color_(other->solid_color_), | 61 solid_color_(other->solid_color_), |
| 54 recorded_viewport_(other->recorded_viewport_), | 62 recorded_viewport_(other->recorded_viewport_), |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 DCHECK(image_decode_controller); | 309 DCHECK(image_decode_controller); |
| 302 image_decode_controller_ = image_decode_controller; | 310 image_decode_controller_ = image_decode_controller; |
| 303 } | 311 } |
| 304 | 312 |
| 305 RasterSource::PlaybackSettings::PlaybackSettings() | 313 RasterSource::PlaybackSettings::PlaybackSettings() |
| 306 : playback_to_shared_canvas(false), | 314 : playback_to_shared_canvas(false), |
| 307 skip_images(false), | 315 skip_images(false), |
| 308 use_image_hijack_canvas(true) {} | 316 use_image_hijack_canvas(true) {} |
| 309 | 317 |
| 310 } // namespace cc | 318 } // namespace cc |
| OLD | NEW |