Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
9
11
13
14bool SkSVGClipPath::parseAndSetAttribute(const char* n, const char* v) {
16 this->setClipPathUnits(
17 SkSVGAttributeParser::parse<SkSVGObjectBoundingBoxUnits>("clipPathUnits", n, v));
18}
19
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}
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition SkPath.cpp:3824
SkSVGTag
Definition SkSVGNode.h:23
static SkMatrix Scale(SkScalar sx, SkScalar sy)
Definition SkMatrix.h:75
static SkMatrix Translate(SkScalar dx, SkScalar dy)
Definition SkMatrix.h:91
void transform(const SkMatrix &matrix, SkPath *dst, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
Definition SkPath.cpp:1647
bool parseAndSetAttribute(const char *, const char *) override
SVG_ATTR(ClipPathUnits, SkSVGObjectBoundingBoxUnits, SkSVGObjectBoundingBoxUnits(SkSVGObjectBoundingBoxUnits::Type::kUserSpaceOnUse)) private SkSVGClipPath()
SkPath resolveClip(const SkSVGRenderContext &) const
virtual bool parseAndSetAttribute(const char *name, const char *value)
Definition SkSVGNode.cpp:90
SkPath asPath(const SkSVGRenderContext &) const
Definition SkSVGNode.cpp:42
OBBTransform transformForCurrentOBB(SkSVGObjectBoundingBoxUnits) const