blob: f9cd668003cc0ffd18e0615266ef304cba382bac [file] [log] [blame]
fmalita6ceef3d2016-07-26 18:46:34 -07001/*
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 "SkMatrix.h"
12#include "SkSVGNode.h"
13
14class SkSVGTransformableNode : public SkSVGNode {
15public:
Brian Salomond3b65972017-03-22 12:05:03 -040016 ~SkSVGTransformableNode() override = default;
fmalita6ceef3d2016-07-26 18:46:34 -070017
fmalitac97796b2016-08-08 12:58:57 -070018 void setTransform(const SkSVGTransformType& t) { fTransform = t; }
fmalita6ceef3d2016-07-26 18:46:34 -070019
20protected:
21 SkSVGTransformableNode(SkSVGTag);
22
fmalita397a5172016-08-08 11:38:55 -070023 bool onPrepareToRender(SkSVGRenderContext*) const override;
fmalita6ceef3d2016-07-26 18:46:34 -070024
fmalita397a5172016-08-08 11:38:55 -070025 void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override;
fmalita6ceef3d2016-07-26 18:46:34 -070026
Florin Malitace8840e2016-12-08 09:26:47 -050027 void mapToParent(SkPath*) const;
28
fmalita6ceef3d2016-07-26 18:46:34 -070029private:
30 // FIXME: should be sparse
fmalitac97796b2016-08-08 12:58:57 -070031 SkSVGTransformType fTransform;
fmalita6ceef3d2016-07-26 18:46:34 -070032
33 typedef SkSVGNode INHERITED;
34};
35
36#endif // SkSVGTransformableNode_DEFINED