diff options
author | 2014-06-12 05:51:22 -0700 | |
---|---|---|
committer | 2014-06-12 05:51:22 -0700 | |
commit | e26e65e8f831f7a5626c92d11bbb8c2cec1f70de (patch) | |
tree | 1586df1f28e642e12c875adbeabc4e711ec9a29b /debugger | |
parent | 679426c0b4b6568a79a7a69ac4fc9ba248009d19 (diff) |
Remove SkPicture pointer from SkPicturePlayback
This CL simplifies the relationship between SkPicture and SkPicturePlayback by moving the path heap into SkPicturePlayback and removing SkPicturePlayback's SkPicture pointer.
R=mtklein@google.com, reed@google.com
Author: robertphillips@google.com
Review URL: https://codereview.chromium.org/334493002
Diffstat (limited to 'debugger')
-rw-r--r-- | debugger/QT/SkDebuggerGUI.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp index 0f816eec7c..1873afca67 100644 --- a/debugger/QT/SkDebuggerGUI.cpp +++ b/debugger/QT/SkDebuggerGUI.cpp @@ -160,23 +160,21 @@ void SkDebuggerGUI::showDeletes() { // offsets to individual commands. class SkTimedPicturePlayback : public SkPicturePlayback { public: - static SkTimedPicturePlayback* CreateFromStream(SkPicture* picture, - SkStream* stream, const SkPictInfo& info, + static SkTimedPicturePlayback* CreateFromStream(SkStream* stream, const SkPictInfo& info, SkPicture::InstallPixelRefProc proc, const SkTDArray<bool>& deletedCommands) { // Mimics SkPicturePlayback::CreateFromStream SkAutoTDelete<SkTimedPicturePlayback> playback(SkNEW_ARGS(SkTimedPicturePlayback, - (picture, deletedCommands, info))); - if (!playback->parseStream(picture, stream, proc)) { + (deletedCommands, info))); + if (!playback->parseStream(stream, proc)) { return NULL; // we're invalid } return playback.detach(); } - SkTimedPicturePlayback(SkPicture* picture, - const SkTDArray<bool>& deletedCommands, + SkTimedPicturePlayback(const SkTDArray<bool>& deletedCommands, const SkPictInfo& info) - : INHERITED(picture, info) + : INHERITED(info) , fSkipCommands(deletedCommands) , fTot(0.0) , fCurCommand(0) { @@ -272,21 +270,20 @@ public: return NULL; } - SkTimedPicture* newPict = SkNEW_ARGS(SkTimedPicture, (NULL, info.fWidth, info.fHeight)); // Check to see if there is a playback to recreate. if (stream->readBool()) { SkTimedPicturePlayback* playback = SkTimedPicturePlayback::CreateFromStream( - newPict, stream, + stream, info, proc, deletedCommands); if (NULL == playback) { - SkDELETE(newPict); return NULL; } - newPict->fPlayback = playback; + + return SkNEW_ARGS(SkTimedPicture, (playback, info.fWidth, info.fHeight)); } - return newPict; + return NULL; } void resetTimes() { ((SkTimedPicturePlayback*) fPlayback)->resetTimes(); } |