Flutter Engine
The Flutter Engine
third_party
skia
modules
svg
src
SkSVGClipPath.cpp
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
#include "
modules/svg/include/SkSVGClipPath.h
"
9
10
#include "
modules/svg/include/SkSVGRenderContext.h
"
11
12
SkSVGClipPath::SkSVGClipPath
() :
INHERITED
(
SkSVGTag
::kClipPath) {}
13
14
bool
SkSVGClipPath::parseAndSetAttribute
(
const
char
* n,
const
char
* v) {
15
return
INHERITED::parseAndSetAttribute
(n, v) ||
16
this->setClipPathUnits(
17
SkSVGAttributeParser::parse<SkSVGObjectBoundingBoxUnits>(
"clipPathUnits"
, n, v));
18
}
19
20
SkPath
SkSVGClipPath::resolveClip
(
const
SkSVGRenderContext
& ctx)
const
{
21
auto
clip
= this->
asPath
(ctx);
22
23
const
auto
obbt = ctx.
transformForCurrentOBB
(fClipPathUnits);
24
const
auto
m
=
SkMatrix::Translate
(obbt.offset.x, obbt.offset.y)
25
*
SkMatrix::Scale
(obbt.scale.x, obbt.scale.y);
26
clip
.
transform
(
m
);
27
28
return
clip
;
29
}
clip
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition:
SkPath.cpp:3892
SkSVGClipPath.h
SkSVGTag
SkSVGTag
Definition:
SkSVGNode.h:23
SkSVGRenderContext.h
SkMatrix::Scale
static SkMatrix Scale(SkScalar sx, SkScalar sy)
Definition:
SkMatrix.h:75
SkMatrix::Translate
static SkMatrix Translate(SkScalar dx, SkScalar dy)
Definition:
SkMatrix.h:91
SkPath
Definition:
SkPath.h:59
SkPath::transform
void transform(const SkMatrix &matrix, SkPath *dst, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
Definition:
SkPath.cpp:1711
SkSVGClipPath::parseAndSetAttribute
bool parseAndSetAttribute(const char *, const char *) override
Definition:
SkSVGClipPath.cpp:14
SkSVGClipPath::SkSVGClipPath
SVG_ATTR(ClipPathUnits, SkSVGObjectBoundingBoxUnits, SkSVGObjectBoundingBoxUnits(SkSVGObjectBoundingBoxUnits::Type::kUserSpaceOnUse)) private SkSVGClipPath()
Definition:
SkSVGClipPath.cpp:12
SkSVGClipPath::resolveClip
SkPath resolveClip(const SkSVGRenderContext &) const
Definition:
SkSVGClipPath.cpp:20
SkSVGHiddenContainer
Definition:
SkSVGHiddenContainer.h:13
SkSVGNode::parseAndSetAttribute
virtual bool parseAndSetAttribute(const char *name, const char *value)
Definition:
SkSVGNode.cpp:90
SkSVGNode::asPath
SkPath asPath(const SkSVGRenderContext &) const
Definition:
SkSVGNode.cpp:42
SkSVGRenderContext
Definition:
SkSVGRenderContext.h:63
SkSVGRenderContext::transformForCurrentOBB
OBBTransform transformForCurrentOBB(SkSVGObjectBoundingBoxUnits) const
Definition:
SkSVGRenderContext.cpp:493
dart_profiler_symbols.m
m
Definition:
dart_profiler_symbols.py:64
Generated on Sun Jun 23 2024 21:56:08 for Flutter Engine by
1.9.4