Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1034)

Side by Side Diff: cc/playback/raster_source.cc

Issue 1888613002: cc: Ensure to reapply a shared canvas transform to image hijack canvas. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/playback/raster_source_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/playback/raster_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698