Flutter Engine
The Flutter Engine
third_party
skia
modules
skottie
src
Adapter.h
Go to the documentation of this file.
1
/*
2
* Copyright 2020 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 SkottieAdapter_DEFINED
9
#define SkottieAdapter_DEFINED
10
11
#include "
modules/skottie/src/animator/Animator.h
"
12
13
namespace
skottie
{
14
namespace
internal {
15
16
template
<
typename
AdapterT,
typename
T>
17
class
DiscardableAdapterBase
:
public
AnimatablePropertyContainer
{
18
public
:
19
template
<
typename
... Args>
20
static
sk_sp<AdapterT>
Make
(Args&&...
args
) {
21
sk_sp<AdapterT>
adapter(
new
AdapterT(std::forward<Args>(
args
)...));
22
adapter->shrink_to_fit();
23
return
adapter;
24
}
25
26
const
sk_sp<T>
&
node
()
const
{
return
fNode; }
27
28
protected
:
29
DiscardableAdapterBase
()
30
: fNode(
T
::
Make
()) {}
31
32
explicit
DiscardableAdapterBase
(
sk_sp<T>
node
)
33
: fNode(
std
::move(
node
)) {}
34
35
private
:
36
const
sk_sp<T>
fNode;
37
};
38
39
}
// namespace internal
40
}
// namespace skottie
41
42
#endif
// SkottieAdapter_DEFINED
Animator.h
sk_sp
Definition:
SkRefCnt.h:220
skottie::internal::AnimatablePropertyContainer
Definition:
Animator.h:47
skottie::internal::DiscardableAdapterBase
Definition:
Adapter.h:17
skottie::internal::DiscardableAdapterBase::node
const sk_sp< T > & node() const
Definition:
Adapter.h:26
skottie::internal::DiscardableAdapterBase::DiscardableAdapterBase
DiscardableAdapterBase()
Definition:
Adapter.h:29
skottie::internal::DiscardableAdapterBase::Make
static sk_sp< AdapterT > Make(Args &&... args)
Definition:
Adapter.h:20
skottie::internal::DiscardableAdapterBase::DiscardableAdapterBase
DiscardableAdapterBase(sk_sp< T > node)
Definition:
Adapter.h:32
args
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
Definition:
fl_event_channel.h:89
skottie
Definition:
ExternalLayer.h:16
std
Definition:
ref_ptr.h:256
T
#define T
Definition:
precompiler.cc:65
Generated on Sun Jun 23 2024 21:56:05 for Flutter Engine by
1.9.4