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/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 void RasterSource::PlaybackToCanvas(SkCanvas* raster_canvas, | 83 void RasterSource::PlaybackToCanvas(SkCanvas* raster_canvas, |
84 const PlaybackSettings& settings) const { | 84 const PlaybackSettings& settings) const { |
85 if (!settings.playback_to_shared_canvas) | 85 if (!settings.playback_to_shared_canvas) |
86 PrepareForPlaybackToCanvas(raster_canvas); | 86 PrepareForPlaybackToCanvas(raster_canvas); |
87 | 87 |
88 if (settings.skip_images) { | 88 if (settings.skip_images) { |
89 SkipImageCanvas canvas(raster_canvas); | 89 SkipImageCanvas canvas(raster_canvas); |
90 RasterCommon(&canvas, nullptr); | 90 RasterCommon(&canvas, nullptr); |
91 } else if (settings.use_image_hijack_canvas) { | 91 } else if (settings.use_image_hijack_canvas) { |
92 const SkImageInfo& info = raster_canvas->imageInfo(); | 92 const SkImageInfo& info = raster_canvas->imageInfo(); |
93 | 93 ImageHijackCanvas canvas(info.width(), info.height(), image_decode_cache_, |
94 ImageHijackCanvas canvas(info.width(), info.height(), image_decode_cache_); | 94 &settings.images_to_skip); |
95 // Before adding the canvas, make sure that the ImageHijackCanvas is aware | 95 // Before adding the canvas, make sure that the ImageHijackCanvas is aware |
96 // of the current transform and clip, which may affect the clip bounds. | 96 // of the current transform and clip, which may affect the clip bounds. |
97 // Since we query the clip bounds of the current canvas to get the list of | 97 // Since we query the clip bounds of the current canvas to get the list of |
98 // draw commands to process, this is important to produce correct content. | 98 // draw commands to process, this is important to produce correct content. |
99 canvas.clipRect( | 99 canvas.clipRect( |
100 SkRect::MakeFromIRect(raster_canvas->getDeviceClipBounds())); | 100 SkRect::MakeFromIRect(raster_canvas->getDeviceClipBounds())); |
101 canvas.setMatrix(raster_canvas->getTotalMatrix()); | 101 canvas.setMatrix(raster_canvas->getTotalMatrix()); |
102 canvas.addCanvas(raster_canvas); | 102 canvas.addCanvas(raster_canvas); |
103 | 103 |
104 RasterCommon(&canvas, nullptr); | 104 RasterCommon(&canvas, nullptr); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 scoped_refptr<RasterSource> RasterSource::CreateCloneWithoutLCDText() const { | 305 scoped_refptr<RasterSource> RasterSource::CreateCloneWithoutLCDText() const { |
306 bool can_use_lcd_text = false; | 306 bool can_use_lcd_text = false; |
307 return scoped_refptr<RasterSource>(new RasterSource(this, can_use_lcd_text)); | 307 return scoped_refptr<RasterSource>(new RasterSource(this, can_use_lcd_text)); |
308 } | 308 } |
309 | 309 |
310 RasterSource::PlaybackSettings::PlaybackSettings() | 310 RasterSource::PlaybackSettings::PlaybackSettings() |
311 : playback_to_shared_canvas(false), | 311 : playback_to_shared_canvas(false), |
312 skip_images(false), | 312 skip_images(false), |
313 use_image_hijack_canvas(true) {} | 313 use_image_hijack_canvas(true) {} |
314 | 314 |
| 315 RasterSource::PlaybackSettings::PlaybackSettings(const PlaybackSettings&) = |
| 316 default; |
| 317 |
| 318 RasterSource::PlaybackSettings::PlaybackSettings(PlaybackSettings&&) = default; |
| 319 |
| 320 RasterSource::PlaybackSettings::~PlaybackSettings() = default; |
| 321 |
315 } // namespace cc | 322 } // namespace cc |
OLD | NEW |