• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "include/core/SkMatrix.h"
12 #include "modules/svg/include/SkSVGNode.h"
13 
14 class SkSVGTransformableNode : public SkSVGNode {
15 public:
setTransform(const SkSVGTransformType & t)16     void setTransform(const SkSVGTransformType& t) { fTransform = t; }
17 
18 protected:
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 
27     void mapToParent(SkRect*) const;
28 
29 private:
30     // FIXME: should be sparse
31     SkSVGTransformType fTransform;
32 
33     using INHERITED = SkSVGNode;
34 };
35 
36 #endif // SkSVGTransformableNode_DEFINED
37