Skia
2D Graphics Library
SkSVGTransformableNode.h
Go to the documentation of this file.
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"
13 
14 class SK_API SkSVGTransformableNode : public SkSVGNode {
15 public:
16  void setTransform(const SkSVGTransformType& t) { fTransform = t; }
17 
18 protected:
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
SkSVGAttribute
Definition: SkSVGAttribute.h:16
SkSVGTag
Definition: SkSVGNode.h:23
SkMatrix holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:53
SkPath contain geometry.
Definition: SkPath.h:58
Definition: SkRefCnt.h:119
Definition: SkSVGNode.h:95
SkSVGNode(SkSVGTag)
Definition: SkSVGRenderContext.h:61
Definition: SkSVGTransformableNode.h:14
void mapToParent(SkRect *) const
void setTransform(const SkSVGTransformType &t)
Definition: SkSVGTransformableNode.h:16
bool onPrepareToRender(SkSVGRenderContext *) const override
void mapToParent(SkPath *) const
void onSetAttribute(SkSVGAttribute, const SkSVGValue &) override
SkSVGTransformableNode(SkSVGTag)
Definition: SkSVGValue.h:18
SkRect holds four float coordinates describing the upper and lower bounds of a rectangle.
Definition: SkRect.h:582