fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 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 | |
| 8 | #ifndef SkSVGTransformableNode_DEFINED |
| 9 | #define SkSVGTransformableNode_DEFINED |
| 10 | |
| 11 | #include "SkMatrix.h" |
| 12 | #include "SkSVGNode.h" |
| 13 | |
| 14 | class SkSVGTransformableNode : public SkSVGNode { |
| 15 | public: |
| 16 | virtual ~SkSVGTransformableNode() = default; |
| 17 | |
fmalita | c97796b | 2016-08-08 12:58:57 -0700 | [diff] [blame] | 18 | void setTransform(const SkSVGTransformType& t) { fTransform = t; } |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 19 | |
| 20 | protected: |
| 21 | SkSVGTransformableNode(SkSVGTag); |
| 22 | |
fmalita | 397a517 | 2016-08-08 11:38:55 -0700 | [diff] [blame] | 23 | bool onPrepareToRender(SkSVGRenderContext*) const override; |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 24 | |
fmalita | 397a517 | 2016-08-08 11:38:55 -0700 | [diff] [blame] | 25 | void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override; |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 26 | |
Florin Malita | ce8840e | 2016-12-08 09:26:47 -0500 | [diff] [blame] | 27 | void mapToParent(SkPath*) const; |
| 28 | |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 29 | private: |
| 30 | // FIXME: should be sparse |
fmalita | c97796b | 2016-08-08 12:58:57 -0700 | [diff] [blame] | 31 | SkSVGTransformType fTransform; |
fmalita | 6ceef3d | 2016-07-26 18:46:34 -0700 | [diff] [blame] | 32 | |
| 33 | typedef SkSVGNode INHERITED; |
| 34 | }; |
| 35 | |
| 36 | #endif // SkSVGTransformableNode_DEFINED |