Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkSVGTransformableNode.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
12
16
17
19 if (!fTransform.isIdentity()) {
20 ctx->saveOnce();
21 ctx->canvas()->concat(fTransform);
22 }
23
24 return this->INHERITED::onPrepareToRender(ctx);
25}
26
28 switch (attr) {
30 if (const auto* transform = v.as<SkSVGTransformValue>()) {
31 this->setTransform(*transform);
32 }
33 break;
34 default:
35 this->INHERITED::onSetAttribute(attr, v);
36 break;
37 }
38}
39
41 // transforms the path to parent node coordinates.
42 path->transform(fTransform);
43}
44
46 *rect = fTransform.mapRect(*rect);
47}
SkSVGAttribute
SkSVGTag
Definition SkSVGNode.h:23
void concat(const SkMatrix &matrix)
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
bool isIdentity() const
Definition SkMatrix.h:223
virtual void onSetAttribute(SkSVGAttribute, const SkSVGValue &)
Definition SkSVGNode.h:168
virtual bool onPrepareToRender(SkSVGRenderContext *) const
Definition SkSVGNode.cpp:62
SkCanvas * canvas() const
void setTransform(const SkSVGTransformType &t)
bool onPrepareToRender(SkSVGRenderContext *) const override
void mapToParent(SkPath *) const
void onSetAttribute(SkSVGAttribute, const SkSVGValue &) override
const T * as() const
Definition SkSVGValue.h:36
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
Definition p3.cpp:47
Definition SkMD5.cpp:134