Index: dm/DMSrcSink.cpp |
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp |
index 258e94e7e6bff8a5179073863898c0c17aaed62d..78fa140b31686a0f183a410edc1e0921f5d2b21b 100644 |
--- a/dm/DMSrcSink.cpp |
+++ b/dm/DMSrcSink.cpp |
@@ -34,7 +34,6 @@ |
#include "SkSVGCanvas.h" |
#include "SkStream.h" |
#include "SkTLogic.h" |
-#include "SkXMLWriter.h" |
#include "SkSwizzler.h" |
#include <functional> |
@@ -46,6 +45,10 @@ |
#include "qcms.h" |
#endif |
+#if defined(SK_XML) |
+ #include "SkXMLWriter.h" |
+#endif |
+ |
DEFINE_bool(multiPage, false, "For document-type backends, render the source" |
" into multiple pages"); |
DEFINE_bool(RAW_threading, true, "Allow RAW decodes to run on multiple threads?"); |
@@ -1205,11 +1208,15 @@ Error SKPSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const |
SVGSink::SVGSink() {} |
Error SVGSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const { |
+#if defined(SK_XML) |
SkAutoTDelete<SkXMLWriter> xmlWriter(new SkXMLStreamWriter(dst)); |
SkAutoTUnref<SkCanvas> canvas(SkSVGCanvas::Create( |
SkRect::MakeWH(SkIntToScalar(src.size().width()), SkIntToScalar(src.size().height())), |
xmlWriter)); |
return src.draw(canvas); |
+#else |
+ return Error("SVG sink is disabled."); |
+#endif // SK_XML |
} |
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ |