Skia
2D Graphics Library
SkSVGMask.h
Go to the documentation of this file.
1
/*
2
* Copyright 2021 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 SkSVGMask_DEFINED
9
#define SkSVGMask_DEFINED
10
11
#include "
modules/svg/include/SkSVGHiddenContainer.h
"
12
#include "
modules/svg/include/SkSVGTypes.h
"
13
14
class
SK_API
SkSVGMask
final :
public
SkSVGHiddenContainer
{
15
public
:
16
static
sk_sp<SkSVGMask>
Make
() {
17
return
sk_sp<SkSVGMask>
(
new
SkSVGMask
());
18
}
19
20
SVG_ATTR
(X ,
SkSVGLength
,
SkSVGLength
(-10,
SkSVGLength::Unit::kPercentage
))
21
SVG_ATTR
(Y ,
SkSVGLength
,
SkSVGLength
(-10,
SkSVGLength::Unit::kPercentage
))
22
SVG_ATTR
(Width ,
SkSVGLength
,
SkSVGLength
(120,
SkSVGLength::Unit::kPercentage
))
23
SVG_ATTR
(Height,
SkSVGLength
,
SkSVGLength
(120,
SkSVGLength::Unit::kPercentage
))
24
25
SVG_ATTR
(MaskUnits,
SkSVGObjectBoundingBoxUnits
,
26
SkSVGObjectBoundingBoxUnits
(
SkSVGObjectBoundingBoxUnits
::Type::kObjectBoundingBox))
27
SVG_ATTR
(MaskContentUnits,
SkSVGObjectBoundingBoxUnits
,
28
SkSVGObjectBoundingBoxUnits
(
SkSVGObjectBoundingBoxUnits
::Type::kUserSpaceOnUse))
29
30
private:
31
friend class
SkSVGRenderContext
;
32
33
SkSVGMask
() :
INHERITED
(
SkSVGTag
::
kMask
) {}
34
35
bool
parseAndSetAttribute
(
const
char
*,
const
char
*)
override
;
36
37
SkRect
bounds
(
const
SkSVGRenderContext
&)
const
;
38
void
renderMask
(
const
SkSVGRenderContext
&)
const
;
39
40
using
INHERITED
=
SkSVGHiddenContainer
;
41
};
42
43
#endif
// SkSVGMask_DEFINED
SkSVGHiddenContainer.h
SkSVGTag
SkSVGTag
Definition:
SkSVGNode.h:23
SkSVGTag::kMask
@ kMask
SVG_ATTR
#define SVG_ATTR(attr_name, attr_type, attr_default)
Definition:
SkSVGNode.h:203
SkSVGTypes.h
SkSVGHiddenContainer
Definition:
SkSVGHiddenContainer.h:13
SkSVGHiddenContainer::SkSVGHiddenContainer
SkSVGHiddenContainer(SkSVGTag t)
Definition:
SkSVGHiddenContainer.h:15
SkSVGLength
Definition:
SkSVGTypes.h:116
SkSVGLength::Unit::kPercentage
@ kPercentage
SkSVGMask
Definition:
SkSVGMask.h:14
SkSVGMask::renderMask
void renderMask(const SkSVGRenderContext &) const
SkSVGMask::bounds
SkRect bounds(const SkSVGRenderContext &) const
SkSVGMask::parseAndSetAttribute
bool parseAndSetAttribute(const char *, const char *) override
SkSVGMask::Make
static sk_sp< SkSVGMask > Make()
Definition:
SkSVGMask.h:16
SkSVGObjectBoundingBoxUnits
Definition:
SkSVGTypes.h:454
SkSVGRenderContext
Definition:
SkSVGRenderContext.h:61
SkSVGTransformableNode
Definition:
SkSVGTransformableNode.h:14
sk_sp
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition:
SkRefCnt.h:220
SkRect
SkRect holds four float coordinates describing the upper and lower bounds of a rectangle.
Definition:
SkRect.h:582
modules
svg
include
SkSVGMask.h
Generated by
Doxygen
1.9.1 on Tue Nov 14 2023