| 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/SkColorSpaceXformCanvas.h" | 19 #include "third_party/skia/include/core/SkColorSpaceXformCanvas.h" |
| 20 #include "third_party/skia/include/core/SkPictureRecorder.h" | 20 #include "third_party/skia/include/core/SkPictureRecorder.h" |
| 21 #include "ui/gfx/geometry/rect_conversions.h" | 21 #include "ui/gfx/geometry/rect_conversions.h" |
| 22 | 22 |
| 23 namespace cc { | 23 namespace cc { |
| 24 | 24 |
| 25 scoped_refptr<RasterSource> RasterSource::CreateFromRecordingSource( | 25 scoped_refptr<RasterSource> RasterSource::CreateFromRecordingSource( |
| 26 const RecordingSource* other, | 26 const RecordingSource* other, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 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_), |
| 55 size_(other->size_), | 55 size_(other->size_), |
| 56 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), | 56 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), |
| 57 slow_down_raster_scale_factor_for_debug_( | 57 slow_down_raster_scale_factor_for_debug_( |
| 58 other->slow_down_raster_scale_factor_for_debug_), | 58 other->slow_down_raster_scale_factor_for_debug_), |
| 59 image_decode_cache_(other->image_decode_cache_) {} | 59 image_decode_cache_(other->image_decode_cache_) {} |
| 60 | 60 |
| 61 RasterSource::~RasterSource() { | 61 RasterSource::~RasterSource() {} |
| 62 } | |
| 63 | 62 |
| 64 void RasterSource::PlaybackToCanvas(SkCanvas* raster_canvas, | 63 void RasterSource::PlaybackToCanvas(SkCanvas* raster_canvas, |
| 65 const gfx::ColorSpace& canvas_color_space, | 64 const gfx::ColorSpace& canvas_color_space, |
| 66 const gfx::Rect& canvas_bitmap_rect, | 65 const gfx::Rect& canvas_bitmap_rect, |
| 67 const gfx::Rect& canvas_playback_rect, | 66 const gfx::Rect& canvas_playback_rect, |
| 68 float raster_scale, | 67 float raster_scale, |
| 69 const PlaybackSettings& settings) const { | 68 const PlaybackSettings& settings) const { |
| 70 SkIRect raster_bounds = gfx::RectToSkIRect(canvas_bitmap_rect); | 69 SkIRect raster_bounds = gfx::RectToSkIRect(canvas_bitmap_rect); |
| 71 if (!canvas_playback_rect.IsEmpty() && | 70 if (!canvas_playback_rect.IsEmpty() && |
| 72 !raster_bounds.intersect(gfx::RectToSkIRect(canvas_playback_rect))) | 71 !raster_bounds.intersect(gfx::RectToSkIRect(canvas_playback_rect))) |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 use_image_hijack_canvas(true) {} | 320 use_image_hijack_canvas(true) {} |
| 322 | 321 |
| 323 RasterSource::PlaybackSettings::PlaybackSettings(const PlaybackSettings&) = | 322 RasterSource::PlaybackSettings::PlaybackSettings(const PlaybackSettings&) = |
| 324 default; | 323 default; |
| 325 | 324 |
| 326 RasterSource::PlaybackSettings::PlaybackSettings(PlaybackSettings&&) = default; | 325 RasterSource::PlaybackSettings::PlaybackSettings(PlaybackSettings&&) = default; |
| 327 | 326 |
| 328 RasterSource::PlaybackSettings::~PlaybackSettings() = default; | 327 RasterSource::PlaybackSettings::~PlaybackSettings() = default; |
| 329 | 328 |
| 330 } // namespace cc | 329 } // namespace cc |
| OLD | NEW |