blob: a32f83dcc63432316c0ad8449244728b6562ef54 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
/*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkSGTransform_DEFINED
#define SkSGTransform_DEFINED
#include "SkSGEffectNode.h"
#include "SkMatrix.h"
namespace sksg {
/**
* Concrete Effect node, wrapping an SkMatrix.
*/
class Transform : public EffectNode {
public:
static sk_sp<Transform> Make(sk_sp<RenderNode> child, const SkMatrix& matrix) {
return sk_sp<Transform>(new Transform(std::move(child), matrix));
}
SG_ATTRIBUTE(Matrix, SkMatrix, fMatrix)
protected:
Transform(sk_sp<RenderNode>, const SkMatrix&);
void onRender(SkCanvas*) const override;
SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
private:
SkMatrix fMatrix;
typedef EffectNode INHERITED;
};
} // namespace sksg
#endif // SkSGTransform_DEFINED
|