Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkSGTransformPriv.h
Go to the documentation of this file.
1/*
2 * Copyright 2019 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 SkSGTransformPriv_DEFINED
9#define SkSGTransformPriv_DEFINED
10
11#include "include/core/SkM44.h"
14
15namespace sksg {
16
17// Helper for accessing implementation-private Transform methods.
18class TransformPriv final {
19public:
20
21 static bool Is44(const sk_sp<Transform>&t) { return t->is44(); }
22
23 template <typename T, typename = std::enable_if<std::is_same<T, SkMatrix>::value ||
24 std::is_same<T, SkM44 >::value >>
25 static T As(const sk_sp<Transform>&);
26
27private:
28 TransformPriv() = delete;
29};
30
31template <>
32inline SkMatrix TransformPriv::As<SkMatrix>(const sk_sp<Transform>& t) {
33 return t->asMatrix();
34}
35
36template <>
37inline SkM44 TransformPriv::As<SkM44>(const sk_sp<Transform>& t) {
38 return t->asM44();
39}
40
41} // namespace sksg
42
43#endif // SkSGTransformPriv_DEFINED
Definition SkM44.h:150
static T As(const sk_sp< Transform > &)
static bool Is44(const sk_sp< Transform > &t)
Definition Skottie.h:32
#define T