Flutter Engine
The Flutter Engine
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
14 : INHERITED(tag)
15 , fTransform(SkMatrix::I()) { }
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)
Definition: SkCanvas.cpp:1318
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
Definition: SkMatrix.cpp:1141
bool isIdentity() const
Definition: SkMatrix.h:223
Definition: SkPath.h:59
virtual void onSetAttribute(SkSVGAttribute, const SkSVGValue &)
Definition: SkSVGNode.h:175
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
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
Definition: p3.cpp:47
Definition: SkMD5.cpp:134