Flutter Engine
The Flutter Engine
Public Types | Static Public Member Functions | List of all members
SkSVGCanvas Class Reference

#include <SkSVGCanvas.h>

Public Types

enum  { kConvertTextToPaths_Flag = 0x01 , kNoPrettyXML_Flag = 0x02 , kRelativePathEncoding_Flag = 0x04 }
 

Static Public Member Functions

static std::unique_ptr< SkCanvasMake (const SkRect &bounds, SkWStream *, uint32_t flags=0)
 

Detailed Description

Definition at line 20 of file SkSVGCanvas.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kConvertTextToPaths_Flag 
kNoPrettyXML_Flag 
kRelativePathEncoding_Flag 

Definition at line 22 of file SkSVGCanvas.h.

22 {
23 kConvertTextToPaths_Flag = 0x01, // emit text as <path>s
24 kNoPrettyXML_Flag = 0x02, // suppress newlines and tabs in output
25 kRelativePathEncoding_Flag = 0x04, // use relative commands for path encoding
26 };
@ kRelativePathEncoding_Flag
Definition: SkSVGCanvas.h:25
@ kConvertTextToPaths_Flag
Definition: SkSVGCanvas.h:23
@ kNoPrettyXML_Flag
Definition: SkSVGCanvas.h:24

Member Function Documentation

◆ Make()

std::unique_ptr< SkCanvas > SkSVGCanvas::Make ( const SkRect bounds,
SkWStream writer,
uint32_t  flags = 0 
)
static

Returns a new canvas that will generate SVG commands from its draw calls, and send them to the provided stream. Ownership of the stream is not transfered, and it must remain valid for the lifetime of the returned canvas.

The canvas may buffer some drawing calls, so the output is not guaranteed to be valid or complete until the canvas instance is deleted.

The 'bounds' parameter defines an initial SVG viewport (viewBox attribute on the root SVG element).

Definition at line 19 of file SkSVGCanvas.cpp.

20 {
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 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

The documentation for this class was generated from the following files: