Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2232)

Unified Diff: debugger/QT/SkDebuggerGUI.cpp

Issue 249453002: First step in pulling SkPicturePlayback & SkPictureRecord out of SkPicture (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: cleanup Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/core/SkPicture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: debugger/QT/SkDebuggerGUI.cpp
===================================================================
--- debugger/QT/SkDebuggerGUI.cpp (revision 14323)
+++ debugger/QT/SkDebuggerGUI.cpp (working copy)
@@ -159,20 +159,23 @@
// 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 @@
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(); }
« no previous file with comments | « no previous file | include/core/SkPicture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698