Flutter Engine
The Flutter Engine
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)
Definition: SkSVGCanvas.cpp:19
@ kNoPrettyXML_Flag
Definition: SkSVGCanvas.h:24
static sk_sp< SkDevice > Make(const SkISize &size, std::unique_ptr< SkXMLWriter >, uint32_t flags)
FlutterSemanticsFlag flags
Optional< SkRect > bounds
Definition: SkRecords.h:189
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259