Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
modules
svg
include
SkSVGSVG.h
Go to the documentation of this file.
1
/*
2
* Copyright 2016 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
8
#ifndef SkSVGSVG_DEFINED
9
#define SkSVGSVG_DEFINED
10
11
#include "
modules/svg/include/SkSVGContainer.h
"
12
#include "
modules/svg/include/SkSVGTypes.h
"
13
#include "
src/base/SkTLazy.h
"
14
15
class
SkSVGLengthContext
;
16
17
class
SK_API
SkSVGSVG
:
public
SkSVGContainer
{
18
public
:
19
enum class
Type
{
20
kRoot,
21
kInner,
22
};
23
static
sk_sp<SkSVGSVG>
Make
(
Type
t = Type::kInner) {
return
sk_sp<SkSVGSVG>
(
new
SkSVGSVG
(t)); }
24
25
SVG_ATTR
(
X
,
SkSVGLength
,
SkSVGLength
(0))
26
SVG_ATTR
(
Y
,
SkSVGLength
,
SkSVGLength
(0))
27
SVG_ATTR
(Width ,
SkSVGLength
,
SkSVGLength
(100,
SkSVGLength
::Unit::kPercentage))
28
SVG_ATTR
(Height ,
SkSVGLength
,
SkSVGLength
(100,
SkSVGLength
::Unit::kPercentage))
29
SVG_ATTR
(PreserveAspectRatio,
SkSVGPreserveAspectRatio
,
SkSVGPreserveAspectRatio
())
30
31
SVG_OPTIONAL_ATTR
(ViewBox,
SkSVGViewBoxType
)
32
33
SkSize
intrinsicSize(const
SkSVGLengthContext
&) const;
34
35
void
renderNode(const
SkSVGRenderContext
&, const
SkSVGIRI
& iri) const;
36
37
protected:
38
bool
onPrepareToRender(
SkSVGRenderContext
*) const override;
39
40
void
onSetAttribute(
SkSVGAttribute
, const
SkSVGValue
&) override;
41
42
private:
43
explicit
SkSVGSVG
(
Type
t)
44
:
INHERITED
(
SkSVGTag
::
kSvg
)
45
, fType(t)
46
{}
47
48
// Some attributes behave differently for the outermost svg element.
49
const
Type
fType;
50
51
using
INHERITED
=
SkSVGContainer
;
52
};
53
54
#endif
// SkSVGSVG_DEFINED
SK_API
#define SK_API
Definition
SkAPI.h:35
INHERITED
#define INHERITED(method,...)
Definition
SkRecorder.cpp:128
SkSVGAttribute
SkSVGAttribute
Definition
SkSVGAttribute.h:16
SkSVGContainer.h
SVG_OPTIONAL_ATTR
#define SVG_OPTIONAL_ATTR(attr_name, attr_type)
Definition
SkSVGNode.h:213
SkSVGTag
SkSVGTag
Definition
SkSVGNode.h:23
SkSVGTag::kSvg
@ kSvg
SVG_ATTR
#define SVG_ATTR(attr_name, attr_type, attr_default)
Definition
SkSVGNode.h:203
SkSVGTypes.h
SkTLazy.h
Y
static const SkScalar Y
Definition
StrokeBench.cpp:55
X
static const SkScalar X
Definition
StrokeBench.cpp:54
SkSVGContainer
Definition
SkSVGContainer.h:14
SkSVGIRI
Definition
SkSVGTypes.h:152
SkSVGLengthContext
Definition
SkSVGRenderContext.h:29
SkSVGLength
Definition
SkSVGTypes.h:116
SkSVGRenderContext
Definition
SkSVGRenderContext.h:63
SkSVGSVG
Definition
SkSVGSVG.h:17
SkSVGSVG::Make
static sk_sp< SkSVGSVG > Make(Type t=Type::kInner)
Definition
SkSVGSVG.h:23
SkSVGValue
Definition
SkSVGValue.h:18
sk_sp
Definition
SkRefCnt.h:220
Type
Definition
asyncrescaleandread.cpp:530
SkRect
Definition
extension.cpp:13
SkSVGPreserveAspectRatio
Definition
SkSVGTypes.h:585
SkSize
Definition
SkSize.h:52
Generated on Fri Apr 26 2024 06:16:26 for Flutter Engine by
1.9.8