diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-23 22:35:42 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-23 22:35:42 +0000 |
commit | 8f831f262f5e57665587cb3033860eea39fe1621 (patch) | |
tree | 537c4d24071bd6974406f94eb02decf922821bea /debugger/QT | |
parent | dcbc3605670d60e0d834eecebc5eb0c40182007c (diff) |
First step in pulling SkPicturePlayback & SkPictureRecord out of SkPicture
This CL begins the process of making SkPicturePlayback & SkPictureRecord independent of SkPicture. It just moves the PathHeap into SkPicture to get a feel for where all this is going to lead.
Some items of note:
SkTimedPicture (debugger/QT) should wind up being just an SkPicturePlayback-derived object.
All the flattening & unflattening should migrate out of SkPicturePlayback and into SkPicture.
SkPicture::initForPlayback should eventually become something just SkPictureRecorder::endRecording calls.
SkPicture is passed into SkPicturePlayback's & SkPictureRecord's constructors. SkPicturePlayback only
holds onto a "const SkPicture*". The SkPicturePlayback:: CreateFromStream & CreateFromBuffer methods pass a non-const
SkPicture* down the call stack.
BUG=skia:2315
R=reed@google.com
Author: robertphillips@google.com
Review URL: https://codereview.chromium.org/249453002
git-svn-id: http://skia.googlecode.com/svn/trunk@14341 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'debugger/QT')
-rw-r--r-- | debugger/QT/SkDebuggerGUI.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp index 05725500ff..b476a14ccf 100644 --- a/debugger/QT/SkDebuggerGUI.cpp +++ b/debugger/QT/SkDebuggerGUI.cpp @@ -159,20 +159,23 @@ void SkDebuggerGUI::showDeletes() { // offsets to individual commands. class SkTimedPicturePlayback : public SkPicturePlayback { public: - static SkTimedPicturePlayback* CreateFromStream(SkStream* stream, const SkPictInfo& info, + static SkTimedPicturePlayback* CreateFromStream(SkPicture* picture, + SkStream* stream, const SkPictInfo& info, SkPicture::InstallPixelRefProc proc, const SkTDArray<bool>& deletedCommands) { // Mimics SkPicturePlayback::CreateFromStream SkAutoTDelete<SkTimedPicturePlayback> playback(SkNEW_ARGS(SkTimedPicturePlayback, - (deletedCommands, info))); - if (!playback->parseStream(stream, proc)) { + (picture, deletedCommands, info))); + if (!playback->parseStream(picture, stream, proc)) { return NULL; // we're invalid } return playback.detach(); } - SkTimedPicturePlayback(const SkTDArray<bool>& deletedCommands, const SkPictInfo& info) - : INHERITED(info) + SkTimedPicturePlayback(SkPicture* picture, + const SkTDArray<bool>& deletedCommands, + const SkPictInfo& info) + : INHERITED(picture, info) , fSkipCommands(deletedCommands) , fTot(0.0) , fCurCommand(0) { @@ -268,19 +271,21 @@ public: return NULL; } - SkTimedPicturePlayback* playback; + SkTimedPicture* newPict = SkNEW_ARGS(SkTimedPicture, (NULL, info.fWidth, info.fHeight)); // Check to see if there is a playback to recreate. if (stream->readBool()) { - playback = SkTimedPicturePlayback::CreateFromStream(stream, info, proc, + SkTimedPicturePlayback* playback = SkTimedPicturePlayback::CreateFromStream( + newPict, stream, + info, proc, deletedCommands); if (NULL == playback) { + SkDELETE(newPict); return NULL; } - } else { - playback = NULL; + newPict->fPlayback = playback; } - return SkNEW_ARGS(SkTimedPicture, (playback, info.fWidth, info.fHeight)); + return newPict; } void resetTimes() { ((SkTimedPicturePlayback*) fPlayback)->resetTimes(); } |