aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/pdf/SkPDFUtils.h18
-rw-r--r--src/pdf/SkPDFGraphicState.cpp5
2 files changed, 16 insertions, 7 deletions
diff --git a/include/pdf/SkPDFUtils.h b/include/pdf/SkPDFUtils.h
index 8c7d0c0760..501d746cd9 100644
--- a/include/pdf/SkPDFUtils.h
+++ b/include/pdf/SkPDFUtils.h
@@ -17,18 +17,26 @@
#ifndef SkPDFUtils_DEFINED
#define SkPDFUtils_DEFINED
+#include "SkPath.h"
+
+class SkMatrix;
+class SkPath;
+class SkPDFArray;
+
+#if 0
+#define PRINT_NOT_IMPL(str) fprintf(stderr, str)
+#else
+#define PRINT_NOT_IMPL(str)
+#endif
+
#define NOT_IMPLEMENTED(condition, assert) \
do { \
if (condition) { \
- fprintf(stderr, "NOT_IMPLEMENTED: " #condition "\n"); \
+ PRINT_NOT_IMPL("NOT_IMPLEMENTED: " #condition "\n"); \
SkDEBUGCODE(SkASSERT(!assert);) \
} \
} while(0)
-class SkMatrix;
-class SkPath;
-class SkPDFArray;
-
class SkPDFUtils {
public:
static SkPDFArray* MatrixToArray(const SkMatrix& matrix);
diff --git a/src/pdf/SkPDFGraphicState.cpp b/src/pdf/SkPDFGraphicState.cpp
index 44419ece43..7f03d0b08b 100644
--- a/src/pdf/SkPDFGraphicState.cpp
+++ b/src/pdf/SkPDFGraphicState.cpp
@@ -15,6 +15,7 @@
*/
#include "SkPDFGraphicState.h"
+#include "SkPDFUtils.h"
#include "SkStream.h"
#include "SkTypes.h"
@@ -145,14 +146,14 @@ void SkPDFGraphicState::populateDict() {
insert("SA", new SkPDFBool(true))->unref(); // Auto stroke adjustment.
SkXfermode::Mode xfermode = SkXfermode::kSrcOver_Mode;
- // If asMode fails return false, default to kSrcOver_Mode.
+ // If asMode fails, default to kSrcOver_Mode.
if (fPaint.getXfermode())
fPaint.getXfermode()->asMode(&xfermode);
// If we don't support the mode, just use kSrcOver_Mode.
if (xfermode < 0 || xfermode > SkXfermode::kLastMode ||
blendModeFromXfermode(xfermode) == NULL) {
- fprintf(stderr, "NOT_IMPLEMENTED: xfermode = %d\n", xfermode);
xfermode = SkXfermode::kSrcOver_Mode;
+ NOT_IMPLEMENTED("unsupported xfermode", false);
}
insert("BM", new SkPDFName(blendModeFromXfermode(xfermode)))->unref();
}