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

Unified Diff: debugger/QT/SkDebuggerGUI.cpp

Issue 24826002: Allow creating a picture from skp to fail. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 | src/core/SkPicture.cpp » ('j') | src/core/SkPicturePlayback.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: debugger/QT/SkDebuggerGUI.cpp
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp
index d444152eabe9007d3849a0249422d53df886accb..e8701a8ddf2b6edde27ab65ac60f19a1731ffa1a 100644
--- a/debugger/QT/SkDebuggerGUI.cpp
+++ b/debugger/QT/SkDebuggerGUI.cpp
@@ -147,10 +147,10 @@ void SkDebuggerGUI::showDeletes() {
// offsets to individual commands.
class SkTimedPicturePlayback : public SkPicturePlayback {
public:
- SkTimedPicturePlayback(SkStream* stream, const SkPictInfo& info,
+ SkTimedPicturePlayback(SkStream* stream, const SkPictInfo& info, bool* isValid,
SkPicture::InstallPixelRefProc proc,
const SkTDArray<bool>& deletedCommands)
- : INHERITED(stream, info, proc)
+ : INHERITED(stream, info, isValid, proc)
, fSkipCommands(deletedCommands)
, fTot(0.0)
, fCurCommand(0) {
@@ -249,8 +249,13 @@ public:
SkTimedPicturePlayback* playback;
// Check to see if there is a playback to recreate.
if (stream->readBool()) {
+ bool isValid = false;
playback = SkNEW_ARGS(SkTimedPicturePlayback,
- (stream, info, proc, deletedCommands));
+ (stream, info, &isValid, proc, deletedCommands));
+ if (!isValid) {
+ SkDELETE(playback);
+ return NULL;
+ }
} else {
playback = NULL;
}
« no previous file with comments | « no previous file | src/core/SkPicture.cpp » ('j') | src/core/SkPicturePlayback.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698