| 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/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 canvas_playback_rect, contents_scale); | 96 canvas_playback_rect, contents_scale); |
| 97 } | 97 } |
| 98 | 98 |
| 99 if (settings.skip_images) { | 99 if (settings.skip_images) { |
| 100 SkipImageCanvas canvas(raster_canvas); | 100 SkipImageCanvas canvas(raster_canvas); |
| 101 RasterCommon(&canvas, nullptr, canvas_bitmap_rect, canvas_playback_rect, | 101 RasterCommon(&canvas, nullptr, canvas_bitmap_rect, canvas_playback_rect, |
| 102 contents_scale); | 102 contents_scale); |
| 103 } else if (settings.use_image_hijack_canvas && | 103 } else if (settings.use_image_hijack_canvas && |
| 104 display_list_->MayHaveDiscardableImages()) { | 104 display_list_->MayHaveDiscardableImages()) { |
| 105 const SkImageInfo& info = raster_canvas->imageInfo(); | 105 const SkImageInfo& info = raster_canvas->imageInfo(); |
| 106 |
| 106 ImageHijackCanvas canvas(info.width(), info.height(), | 107 ImageHijackCanvas canvas(info.width(), info.height(), |
| 107 image_decode_controller_); | 108 image_decode_controller_); |
| 109 // Before adding the canvas, make sure that the ImageHijackCanvas is aware |
| 110 // of the current transform, which may affect the clip bounds. Since we |
| 111 // query the clip bounds of the current canvas to get the list of draw |
| 112 // commands to process, this is important to produce correct content. |
| 113 canvas.setMatrix(raster_canvas->getTotalMatrix()); |
| 108 canvas.addCanvas(raster_canvas); | 114 canvas.addCanvas(raster_canvas); |
| 109 | 115 |
| 110 RasterCommon(&canvas, nullptr, canvas_bitmap_rect, canvas_playback_rect, | 116 RasterCommon(&canvas, nullptr, canvas_bitmap_rect, canvas_playback_rect, |
| 111 contents_scale); | 117 contents_scale); |
| 112 } else { | 118 } else { |
| 113 RasterCommon(raster_canvas, nullptr, canvas_bitmap_rect, | 119 RasterCommon(raster_canvas, nullptr, canvas_bitmap_rect, |
| 114 canvas_playback_rect, contents_scale); | 120 canvas_playback_rect, contents_scale); |
| 115 } | 121 } |
| 116 } | 122 } |
| 117 | 123 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 } | 353 } |
| 348 return true; | 354 return true; |
| 349 } | 355 } |
| 350 | 356 |
| 351 RasterSource::PlaybackSettings::PlaybackSettings() | 357 RasterSource::PlaybackSettings::PlaybackSettings() |
| 352 : playback_to_shared_canvas(false), | 358 : playback_to_shared_canvas(false), |
| 353 skip_images(false), | 359 skip_images(false), |
| 354 use_image_hijack_canvas(true) {} | 360 use_image_hijack_canvas(true) {} |
| 355 | 361 |
| 356 } // namespace cc | 362 } // namespace cc |
| OLD | NEW |