Split SkPicturePlayback out of SkPictureData
This splits the playback functionality out of SkPictureData. The old SkPictureData::draw method is pulled out along
with its supporting functions as verbatim as possible. Some follow on CLs will be required to:
re-enable profiling in the debugger (and remove the vestiges of SkTimedPicture)
re-enable display of command offsets in the picture (this should probably wait until we've switched to SkRecord though)
Clean up CachedOperationList (maybe fuse with SkPicture::OperationList)
Split SkPicturePlayback into a base class and two derived classes
Implement parallel version of GatherGPUInfo for SkRecord
Landing this is blocked on removing Android's use of the abortPlayback entry point.
R=mtklein@google.com, reed@google.com
Author: robertphillips@google.com
Review URL: https://codereview.chromium.org/377623002
diff --git a/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp
index acc7878..3793b85 100644
--- a/tools/PictureRenderer.cpp
+++ b/tools/PictureRenderer.cpp
@@ -48,8 +48,11 @@
kDefaultTileHeight = 256
};
-void PictureRenderer::init(SkPicture* pict, const SkString* writePath, const SkString* mismatchPath,
- const SkString* inputFilename, bool useChecksumBasedFilenames) {
+void PictureRenderer::init(const SkPicture* pict,
+ const SkString* writePath,
+ const SkString* mismatchPath,
+ const SkString* inputFilename,
+ bool useChecksumBasedFilenames) {
this->CopyString(&fWritePath, writePath);
this->CopyString(&fMismatchPath, mismatchPath);
this->CopyString(&fInputFilename, inputFilename);
@@ -406,7 +409,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////
-void SimplePictureRenderer::init(SkPicture* picture, const SkString* writePath,
+void SimplePictureRenderer::init(const SkPicture* picture, const SkString* writePath,
const SkString* mismatchPath, const SkString* inputFilename,
bool useChecksumBasedFilenames) {
INHERITED::init(picture, writePath, mismatchPath, inputFilename, useChecksumBasedFilenames);
@@ -451,7 +454,7 @@
, fTilesX(0)
, fTilesY(0) { }
-void TiledPictureRenderer::init(SkPicture* pict, const SkString* writePath,
+void TiledPictureRenderer::init(const SkPicture* pict, const SkString* writePath,
const SkString* mismatchPath, const SkString* inputFilename,
bool useChecksumBasedFilenames) {
SkASSERT(NULL != pict);
@@ -579,7 +582,9 @@
* Saves and restores so that the initial clip and matrix return to their state before this function
* is called.
*/
-static void draw_tile_to_canvas(SkCanvas* canvas, const SkRect& tileRect, SkPicture* picture) {
+static void draw_tile_to_canvas(SkCanvas* canvas,
+ const SkRect& tileRect,
+ const SkPicture* picture) {
int saveCount = canvas->save();
// Translate so that we draw the correct portion of the picture.
// Perform a postTranslate so that the scaleFactor does not interfere with the positioning.