| 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/raster/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/math_util.h" | 10 #include "cc/base/math_util.h" |
| 11 #include "cc/base/region.h" | 11 #include "cc/base/region.h" |
| 12 #include "cc/debug/debug_colors.h" | 12 #include "cc/debug/debug_colors.h" |
| 13 #include "cc/debug/traced_value.h" | 13 #include "cc/debug/traced_value.h" |
| 14 #include "cc/playback/display_item_list.h" | 14 #include "cc/paint/display_item_list.h" |
| 15 #include "cc/playback/image_hijack_canvas.h" | 15 #include "cc/raster/image_hijack_canvas.h" |
| 16 #include "cc/playback/skip_image_canvas.h" | 16 #include "cc/raster/skip_image_canvas.h" |
| 17 #include "skia/ext/analysis_canvas.h" | 17 #include "skia/ext/analysis_canvas.h" |
| 18 #include "third_party/skia/include/core/SkCanvas.h" | 18 #include "third_party/skia/include/core/SkCanvas.h" |
| 19 #include "third_party/skia/include/core/SkPictureRecorder.h" | 19 #include "third_party/skia/include/core/SkPictureRecorder.h" |
| 20 #include "ui/gfx/geometry/rect_conversions.h" | 20 #include "ui/gfx/geometry/rect_conversions.h" |
| 21 | 21 |
| 22 namespace cc { | 22 namespace cc { |
| 23 | 23 |
| 24 scoped_refptr<RasterSource> RasterSource::CreateFromRecordingSource( | 24 scoped_refptr<RasterSource> RasterSource::CreateFromRecordingSource( |
| 25 const RecordingSource* other, | 25 const RecordingSource* other, |
| 26 bool can_use_lcd_text) { | 26 bool can_use_lcd_text) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 50 can_use_lcd_text_(can_use_lcd_text), | 50 can_use_lcd_text_(can_use_lcd_text), |
| 51 is_solid_color_(other->is_solid_color_), | 51 is_solid_color_(other->is_solid_color_), |
| 52 solid_color_(other->solid_color_), | 52 solid_color_(other->solid_color_), |
| 53 recorded_viewport_(other->recorded_viewport_), | 53 recorded_viewport_(other->recorded_viewport_), |
| 54 size_(other->size_), | 54 size_(other->size_), |
| 55 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), | 55 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), |
| 56 slow_down_raster_scale_factor_for_debug_( | 56 slow_down_raster_scale_factor_for_debug_( |
| 57 other->slow_down_raster_scale_factor_for_debug_), | 57 other->slow_down_raster_scale_factor_for_debug_), |
| 58 image_decode_cache_(other->image_decode_cache_) {} | 58 image_decode_cache_(other->image_decode_cache_) {} |
| 59 | 59 |
| 60 RasterSource::~RasterSource() { | 60 RasterSource::~RasterSource() {} |
| 61 } | |
| 62 | 61 |
| 63 void RasterSource::PlaybackToCanvas(SkCanvas* raster_canvas, | 62 void RasterSource::PlaybackToCanvas(SkCanvas* raster_canvas, |
| 64 const gfx::Rect& canvas_bitmap_rect, | 63 const gfx::Rect& canvas_bitmap_rect, |
| 65 const gfx::Rect& canvas_playback_rect, | 64 const gfx::Rect& canvas_playback_rect, |
| 66 float raster_scale, | 65 float raster_scale, |
| 67 const PlaybackSettings& settings) const { | 66 const PlaybackSettings& settings) const { |
| 68 SkIRect raster_bounds = gfx::RectToSkIRect(canvas_bitmap_rect); | 67 SkIRect raster_bounds = gfx::RectToSkIRect(canvas_bitmap_rect); |
| 69 if (!canvas_playback_rect.IsEmpty() && | 68 if (!canvas_playback_rect.IsEmpty() && |
| 70 !raster_bounds.intersect(gfx::RectToSkIRect(canvas_playback_rect))) | 69 !raster_bounds.intersect(gfx::RectToSkIRect(canvas_playback_rect))) |
| 71 return; | 70 return; |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 use_image_hijack_canvas(true) {} | 306 use_image_hijack_canvas(true) {} |
| 308 | 307 |
| 309 RasterSource::PlaybackSettings::PlaybackSettings(const PlaybackSettings&) = | 308 RasterSource::PlaybackSettings::PlaybackSettings(const PlaybackSettings&) = |
| 310 default; | 309 default; |
| 311 | 310 |
| 312 RasterSource::PlaybackSettings::PlaybackSettings(PlaybackSettings&&) = default; | 311 RasterSource::PlaybackSettings::PlaybackSettings(PlaybackSettings&&) = default; |
| 313 | 312 |
| 314 RasterSource::PlaybackSettings::~PlaybackSettings() = default; | 313 RasterSource::PlaybackSettings::~PlaybackSettings() = default; |
| 315 | 314 |
| 316 } // namespace cc | 315 } // namespace cc |
| OLD | NEW |