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 ~SkSVGTransformableNode() override = default; 17 setTransform(const SkSVGTransformType & t)18 void setTransform(const SkSVGTransformType& t) { fTransform = t; } 19 20 protected: 21 SkSVGTransformableNode(SkSVGTag); 22 23 bool onPrepareToRender(SkSVGRenderContext*) const override; 24 25 void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override; 26 27 void mapToParent(SkPath*) const; 28 29 private: 30 // FIXME: should be sparse 31 SkSVGTransformType fTransform; 32 33 typedef SkSVGNode INHERITED; 34 }; 35 36 #endif // SkSVGTransformableNode_DEFINED 37