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

Unified Diff: dm/DMSrcSink.cpp

Issue 2150353002: Make XML compilation conditional. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: improved SkDOMTest guard Created 4 years, 5 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 | gyp/xml.gyp » ('j') | 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 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
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
« no previous file with comments | « no previous file | gyp/xml.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698