Resolve drawable when playing back DisplayListData in the RenderThread.
Drawables are mutable, and not expected to produce the same content if retained for longer than the
duration of the frame. This becomes relevant when recording multi-frame SKPs because the
serialization step forces drawables to be played back long after the frame completed. By resolving
the drawable when we are drawing the frame we avoid ref'ing the SkDrawable and do not extend its
lifetime beyond the frame.
Bug: skia:9234
Test: Captured SKPs on a Pixel 3
Change-Id: I5d317dd14e20be9d5e18675df8667327bd05aff0
diff --git a/libs/hwui/pipeline/skia/SkiaPipeline.cpp b/libs/hwui/pipeline/skia/SkiaPipeline.cpp
index 84c0d13..530926b 100644
--- a/libs/hwui/pipeline/skia/SkiaPipeline.cpp
+++ b/libs/hwui/pipeline/skia/SkiaPipeline.cpp
@@ -313,8 +313,7 @@
case CaptureMode::CallbackAPI:
case CaptureMode::SingleFrameSKP:
mRecorder.reset(new SkPictureRecorder());
- pictureCanvas = mRecorder->beginRecording(surface->width(), surface->height(),
- nullptr, SkPictureRecorder::kPlaybackDrawPicture_RecordFlag);
+ pictureCanvas = mRecorder->beginRecording(surface->width(), surface->height());
break;
case CaptureMode::MultiFrameSKP:
// If a multi frame recording is active, initialize recording for a single frame of a