summaryrefslogtreecommitdiffstats
path: root/cc/playback
diff options
context:
space:
mode:
authorvmpstr <vmpstr@chromium.org>2016-01-26 16:19:07 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-27 00:19:58 +0000
commit6abc838bd4fed2d0e0eef80febbda07aa0190644 (patch)
tree972221b704257a490b542ec38c0adb2337649e95 /cc/playback
parentb36e0d5d5100b55128ed7a2c7642afd3591a4e07 (diff)
downloadchromium_src-6abc838bd4fed2d0e0eef80febbda07aa0190644.zip
chromium_src-6abc838bd4fed2d0e0eef80febbda07aa0190644.tar.gz
chromium_src-6abc838bd4fed2d0e0eef80febbda07aa0190644.tar.bz2
cc: Fix nullptr dereference when capturing skps.
We capture sk picture from PictureLayer, which happens before we had a chance to set the image decode controller during commit. The fix here is not to use PlaybackToCanvas, but rather use other functions to accomplish the same goal. PlaybackToCanvas should only be called after commit. R=enne BUG=581107 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1633203003 Cr-Commit-Position: refs/heads/master@{#371655}
Diffstat (limited to 'cc/playback')
-rw-r--r--cc/playback/display_list_raster_source.cc7
-rw-r--r--cc/playback/display_list_raster_source.h6
2 files changed, 10 insertions, 3 deletions
diff --git a/cc/playback/display_list_raster_source.cc b/cc/playback/display_list_raster_source.cc
index 3f740af..38bc5e8 100644
--- a/cc/playback/display_list_raster_source.cc
+++ b/cc/playback/display_list_raster_source.cc
@@ -387,8 +387,11 @@ skia::RefPtr<SkPicture> DisplayListRasterSource::GetFlattenedPicture() {
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(display_list_rect.width(),
display_list_rect.height());
- if (!display_list_rect.IsEmpty())
- PlaybackToCanvas(canvas, display_list_rect, display_list_rect, 1.0);
+ if (!display_list_rect.IsEmpty()) {
+ PrepareForPlaybackToCanvas(canvas, display_list_rect, display_list_rect,
+ 1.f);
+ RasterCommon(canvas, nullptr, display_list_rect, display_list_rect, 1.f);
+ }
skia::RefPtr<SkPicture> picture =
skia::AdoptRef(recorder.endRecordingAsPicture());
diff --git a/cc/playback/display_list_raster_source.h b/cc/playback/display_list_raster_source.h
index 73c7a7f..9ebfd4f 100644
--- a/cc/playback/display_list_raster_source.h
+++ b/cc/playback/display_list_raster_source.h
@@ -36,7 +36,11 @@ class CC_EXPORT DisplayListRasterSource
// rasterizing to the stats if the respective pointer is not nullptr.
// It is assumed that the canvas passed here will only be rasterized by
// this raster source via this call.
- // virtual for testing.
+ //
+ // Virtual for testing.
+ //
+ // Note that this should only be called after the image decode controller has
+ // been set, which happens during commit.
virtual void PlaybackToCanvas(SkCanvas* canvas,
const gfx::Rect& canvas_bitmap_rect,
const gfx::Rect& canvas_playback_rect,