Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkSVGCanvas.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
9
11#include "include/core/SkRect.h"
14#include "src/svg/SkSVGDevice.h"
15#include "src/xml/SkXMLWriter.h"
16
17#include <utility>
18
19std::unique_ptr<SkCanvas> SkSVGCanvas::Make(const SkRect& bounds, SkWStream* writer,
20 uint32_t flags) {
21 // TODO: pass full bounds to the device
22 const auto size = bounds.roundOut().size();
24 : 0;
25
26 auto svgDevice = SkSVGDevice::Make(size,
27 std::make_unique<SkXMLStreamWriter>(writer, xml_flags),
28 flags);
29
30 return svgDevice ? std::make_unique<SkCanvas>(std::move(svgDevice))
31 : nullptr;
32}
constexpr uint32_t SkToU32(S x)
Definition SkTo.h:26
static std::unique_ptr< SkCanvas > Make(const SkRect &bounds, SkWStream *, uint32_t flags=0)
static sk_sp< SkDevice > Make(const SkISize &size, std::unique_ptr< SkXMLWriter >, uint32_t flags)
FlutterSemanticsFlag flags