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

Unified Diff: dm/DMSrcSink.cpp

Issue 1780253002: DM: better SkDocument error message. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-03-10 (Thursday) 13:12:56 EST Created 4 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 9d0b545f94374f4500327876d924b28ec30bd86e..134c7a37e067d1faf573fe4e2a53a4eb5bacfff4 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -1003,12 +1003,15 @@ Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) co
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
static Error draw_skdocument(const Src& src, SkDocument* doc, SkWStream* dst) {
- // Print the given DM:Src to a document, breaking on 8.5x11 pages.
+ if (src.size().isEmpty()) {
+ return "Source has empty dimensions";
+ }
SkASSERT(doc);
int width = src.size().width(),
height = src.size().height();
if (FLAGS_multiPage) {
+ // Print the given DM:Src to a document, breaking on 8.5x11 pages.
const int kLetterWidth = 612, // 8.5 * 72
kLetterHeight = 792; // 11 * 72
const SkRect letter = SkRect::MakeWH(SkIntToScalar(kLetterWidth),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698