Skia
2D Graphics Library
SkSVGLinearGradient.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 SkSVGLinearGradient_DEFINED
9
#define SkSVGLinearGradient_DEFINED
10
11
#include "
modules/svg/include/SkSVGGradient.h
"
12
#include "
modules/svg/include/SkSVGTypes.h
"
13
14
class
SK_API
SkSVGLinearGradient
final :
public
SkSVGGradient
{
15
public
:
16
static
sk_sp<SkSVGLinearGradient>
Make
() {
17
return
sk_sp<SkSVGLinearGradient>
(
new
SkSVGLinearGradient
());
18
}
19
20
SVG_ATTR
(X1,
SkSVGLength
,
SkSVGLength
(0 ,
SkSVGLength::Unit::kPercentage
))
21
SVG_ATTR
(Y1,
SkSVGLength
,
SkSVGLength
(0 ,
SkSVGLength::Unit::kPercentage
))
22
SVG_ATTR
(X2,
SkSVGLength
,
SkSVGLength
(100,
SkSVGLength::Unit::kPercentage
))
23
SVG_ATTR
(Y2,
SkSVGLength
,
SkSVGLength
(0 ,
SkSVGLength::Unit::kPercentage
))
24
25
protected
:
26
bool
parseAndSetAttribute
(
const
char
*,
const
char
*)
override
;
27
28
sk_sp<SkShader>
onMakeShader
(
const
SkSVGRenderContext
&,
29
const
SkColor4f
*,
const
SkScalar
*,
int
count,
30
SkTileMode
,
const
SkMatrix
&)
const override
;
31
private
:
32
SkSVGLinearGradient
();
33
34
using
INHERITED
=
SkSVGGradient
;
35
};
36
37
#endif
// SkSVGLinearGradient_DEFINED
SkSVGGradient.h
SkSVGTypes.h
SkScalar
float SkScalar
Definition:
SkScalar.h:14
SkTileMode
SkTileMode
Definition:
SkTileMode.h:13
SkMatrix
SkMatrix holds a 3x3 matrix for transforming coordinates.
Definition:
SkMatrix.h:53
SkSVGGradient
Definition:
SkSVGGradient.h:19
SkSVGGradient::SVG_ATTR
SVG_ATTR(GradientTransform, SkSVGTransformType, SkSVGTransformType(SkMatrix::I())) SVG_ATTR(GradientUnits
SkSVGLength
Definition:
SkSVGTypes.h:116
SkSVGLength::Unit::kPercentage
@ kPercentage
SkSVGLinearGradient
Definition:
SkSVGLinearGradient.h:14
SkSVGLinearGradient::onMakeShader
sk_sp< SkShader > onMakeShader(const SkSVGRenderContext &, const SkColor4f *, const SkScalar *, int count, SkTileMode, const SkMatrix &) const override
SkSVGLinearGradient::parseAndSetAttribute
bool parseAndSetAttribute(const char *, const char *) override
SkSVGLinearGradient::Make
static sk_sp< SkSVGLinearGradient > Make()
Definition:
SkSVGLinearGradient.h:16
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
SkColor4f
RGBA color value, holding four floating point components.
modules
svg
include
SkSVGLinearGradient.h
Generated by
Doxygen
1.9.1 on Tue Nov 14 2023