2016-07-27 01:46:34 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkSVGTransformableNode_DEFINED
|
|
|
|
#define SkSVGTransformableNode_DEFINED
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "experimental/svg/model/SkSVGNode.h"
|
|
|
|
#include "include/core/SkMatrix.h"
|
2016-07-27 01:46:34 +00:00
|
|
|
|
|
|
|
class SkSVGTransformableNode : public SkSVGNode {
|
|
|
|
public:
|
2017-03-22 16:05:03 +00:00
|
|
|
~SkSVGTransformableNode() override = default;
|
2016-07-27 01:46:34 +00:00
|
|
|
|
2016-08-08 19:58:57 +00:00
|
|
|
void setTransform(const SkSVGTransformType& t) { fTransform = t; }
|
2016-07-27 01:46:34 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
SkSVGTransformableNode(SkSVGTag);
|
|
|
|
|
2016-08-08 18:38:55 +00:00
|
|
|
bool onPrepareToRender(SkSVGRenderContext*) const override;
|
2016-07-27 01:46:34 +00:00
|
|
|
|
2016-08-08 18:38:55 +00:00
|
|
|
void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override;
|
2016-07-27 01:46:34 +00:00
|
|
|
|
2016-12-08 14:26:47 +00:00
|
|
|
void mapToParent(SkPath*) const;
|
|
|
|
|
2016-07-27 01:46:34 +00:00
|
|
|
private:
|
|
|
|
// FIXME: should be sparse
|
2016-08-08 19:58:57 +00:00
|
|
|
SkSVGTransformType fTransform;
|
2016-07-27 01:46:34 +00:00
|
|
|
|
|
|
|
typedef SkSVGNode INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SkSVGTransformableNode_DEFINED
|