aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/svg/SkSVGCanvas.cpp
diff options
context:
space:
mode:
authorGravatar fmalita <fmalita@chromium.org>2015-02-06 12:51:10 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-06 12:51:10 -0800
commit2aafe6f427f6d98aa4d173efc6195fe245add91d (patch)
treee54ed2c567cafcc6ca76b5d424d0b70eda00fece /src/svg/SkSVGCanvas.cpp
parent23e619cf462b2a8a500f3ca750e099f79601f508 (diff)
Add SkSVGCanvas
Add a public SVG canvas factory + move the SVG files from experimental -> src/svg/. Update current clients to the new API. R=reed@google.com, mtklein@google.com, halcanary@google.com Review URL: https://codereview.chromium.org/902583006
Diffstat (limited to 'src/svg/SkSVGCanvas.cpp')
-rw-r--r--src/svg/SkSVGCanvas.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/svg/SkSVGCanvas.cpp b/src/svg/SkSVGCanvas.cpp
new file mode 100644
index 0000000000..22a6e0bd9c
--- /dev/null
+++ b/src/svg/SkSVGCanvas.cpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkSVGCanvas.h"
+#include "SkSVGDevice.h"
+
+SkCanvas* SkSVGCanvas::Create(const SkRect& bounds, SkXMLWriter* writer) {
+ // TODO: pass full bounds to the device
+ SkISize size = bounds.roundOut().size();
+ SkAutoTUnref<SkBaseDevice> device(SkSVGDevice::Create(size, writer));
+
+ return SkNEW_ARGS(SkCanvas, (device));
+}