blob: ad217a92f943d01a7d409168f8399fa078d27606 [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:
16 virtual ~SkSVGTransformableNode() = default;
17
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