blob: bc4d18f18e437ccb9e8dcbc6069f4bd64ea10f7e [file] [log] [blame]
Florin Malitab3418102020-10-15 18:10:29 -04001/*
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#ifndef SkSVGTransformableNode_DEFINED
9#define SkSVGTransformableNode_DEFINED
10
11#include "include/core/SkMatrix.h"
12#include "modules/svg/include/SkSVGNode.h"
13
14class SkSVGTransformableNode : public SkSVGNode {
15public:
Florin Malitab3418102020-10-15 18:10:29 -040016 void setTransform(const SkSVGTransformType& t) { fTransform = t; }
17
18protected:
19 SkSVGTransformableNode(SkSVGTag);
20
21 bool onPrepareToRender(SkSVGRenderContext*) const override;
22
23 void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override;
24
25 void mapToParent(SkPath*) const;
26
Tyler Dennistonf548a022020-10-27 15:02:02 -040027 void mapToParent(SkRect*) const;
28
Florin Malitab3418102020-10-15 18:10:29 -040029private:
30 // FIXME: should be sparse
31 SkSVGTransformType fTransform;
32
33 using INHERITED = SkSVGNode;
34};
35
36#endif // SkSVGTransformableNode_DEFINED