Cleanup debugger's handling of bad input files

https://codereview.appspot.com/7308062/



git-svn-id: http://skia.googlecode.com/svn/trunk@7654 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
robertphillips@google.com 2013-02-07 20:39:40 +00:00
parent 53009ba701
commit 2d40ec4e9a

View File

@ -1001,7 +1001,16 @@ void SkDebuggerGUI::loadPicture(const SkString& fileName) {
fFileName = fileName; fFileName = fileName;
fLoading = true; fLoading = true;
SkStream* stream = SkNEW_ARGS(SkFILEStream, (fileName.c_str())); SkStream* stream = SkNEW_ARGS(SkFILEStream, (fileName.c_str()));
SkOffsetPicture* picture = SkNEW_ARGS(SkOffsetPicture, (stream, NULL, &SkImageDecoder::DecodeStream));
bool success = false;
SkOffsetPicture* picture = SkNEW_ARGS(SkOffsetPicture, (stream, &success, &SkImageDecoder::DecodeStream));
if (!success) {
QMessageBox::critical(this, "Error loading file", "Couldn't read file, sorry.");
SkSafeUnref(stream);
return;
}
fCanvasWidget.resetWidgetTransform(); fCanvasWidget.resetWidgetTransform();
fDebugger.loadPicture(picture); fDebugger.loadPicture(picture);