Flutter Engine
The Flutter Engine
third_party
skia
modules
svg
include
SkSVGGradient.h
Go to the documentation of this file.
1
/*
2
* Copyright 2017 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 SkSVGGradient_DEFINED
9
#define SkSVGGradient_DEFINED
10
11
#include "
include/core/SkShader.h
"
12
#include "
modules/svg/include/SkSVGHiddenContainer.h
"
13
#include "
modules/svg/include/SkSVGTypes.h
"
14
15
class
SkMatrix
;
16
class
SkSVGRenderContext
;
17
class
SkSVGStop
;
18
19
class
SK_API
SkSVGGradient
:
public
SkSVGHiddenContainer
{
20
public
:
21
SVG_ATTR
(Href,
SkSVGIRI
,
SkSVGIRI
())
22
SVG_ATTR
(GradientTransform,
SkSVGTransformType
,
SkSVGTransformType
(
SkMatrix
::
I
()))
23
SVG_ATTR
(SpreadMethod,
SkSVGSpreadMethod
,
SkSVGSpreadMethod
(
SkSVGSpreadMethod
::
Type
::
kPad
))
24
SVG_ATTR
(GradientUnits,
25
SkSVGObjectBoundingBoxUnits
,
26
SkSVGObjectBoundingBoxUnits
(
SkSVGObjectBoundingBoxUnits
::
Type
::kObjectBoundingBox))
27
28
protected:
29
explicit
SkSVGGradient
(
SkSVGTag
t) :
INHERITED
(t) {}
30
31
bool
parseAndSetAttribute
(
const
char
*,
const
char
*)
override
;
32
33
bool
onAsPaint
(
const
SkSVGRenderContext
&,
SkPaint
*)
const
final
;
34
35
virtual
sk_sp<SkShader>
onMakeShader
(
const
SkSVGRenderContext
&,
36
const
SkColor4f
*,
const
SkScalar
*,
int
count
,
37
SkTileMode
,
const
SkMatrix
& localMatrix)
const
= 0;
38
39
private
:
40
using
StopPositionArray
=
skia_private::STArray<2, SkScalar , true>
;
41
using
StopColorArray
=
skia_private::STArray<2, SkColor4f, true>
;
42
void
collectColorStops(
const
SkSVGRenderContext
&,
StopPositionArray
*,
StopColorArray
*)
const
;
43
SkColor4f
resolveStopColor(
const
SkSVGRenderContext
&,
const
SkSVGStop
&)
const
;
44
45
using
INHERITED
=
SkSVGHiddenContainer
;
46
};
47
48
#endif
// SkSVGGradient_DEFINED
count
int count
Definition:
FontMgrTest.cpp:50
SK_API
#define SK_API
Definition:
SkAPI.h:35
SkSVGHiddenContainer.h
SkSVGTag
SkSVGTag
Definition:
SkSVGNode.h:23
SVG_ATTR
#define SVG_ATTR(attr_name, attr_type, attr_default)
Definition:
SkSVGNode.h:210
SkSVGTypes.h
SkShader.h
SkTileMode
SkTileMode
Definition:
SkTileMode.h:13
kPad
constexpr int kPad
Definition:
bc1_transparency.cpp:24
SkMatrix
Definition:
SkMatrix.h:54
SkPaint
Definition:
SkPaint.h:44
SkSVGGradient
Definition:
SkSVGGradient.h:19
SkSVGGradient::onMakeShader
virtual sk_sp< SkShader > onMakeShader(const SkSVGRenderContext &, const SkColor4f *, const SkScalar *, int count, SkTileMode, const SkMatrix &localMatrix) const =0
SkSVGHiddenContainer
Definition:
SkSVGHiddenContainer.h:13
SkSVGHiddenContainer::SkSVGHiddenContainer
SkSVGHiddenContainer(SkSVGTag t)
Definition:
SkSVGHiddenContainer.h:15
SkSVGIRI
Definition:
SkSVGTypes.h:152
SkSVGNode::parseAndSetAttribute
virtual bool parseAndSetAttribute(const char *name, const char *value)
Definition:
SkSVGNode.cpp:90
SkSVGNode::onAsPaint
virtual bool onAsPaint(const SkSVGRenderContext &, SkPaint *) const
Definition:
SkSVGNode.h:171
SkSVGObjectBoundingBoxUnits
Definition:
SkSVGTypes.h:454
SkSVGRenderContext
Definition:
SkSVGRenderContext.h:63
SkSVGSpreadMethod
Definition:
SkSVGTypes.h:318
SkSVGStop
Definition:
SkSVGStop.h:16
SkSVGTransformableNode
Definition:
SkSVGTransformableNode.h:14
sk_sp< SkShader >
skia_private::STArray
Definition:
SkTArray.h:754
SkScalar
float SkScalar
Definition:
extension.cpp:12
Type
Definition:
asyncrescaleandread.cpp:530
I
Definition:
SkMD5.cpp:134
SkColor4f
Generated on Sun Jun 23 2024 21:56:07 for Flutter Engine by
1.9.4