Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
ExternalLayer.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 SkottieExternalLayer_DEFINED
9#define SkottieExternalLayer_DEFINED
10
12
13class SkCanvas;
14struct SkSize;
15
16namespace skottie {
17
18/**
19 * Interface for externally-rendered layers.
20 */
21class ExternalLayer : public SkRefCnt {
22public:
23 /** Render layer content into the given canvas.
24 *
25 * @param canvas Destination canvas
26 * @param t Time in seconds, relative to the layer in-point (start time)
27 */
28 virtual void render(SkCanvas* canvas, double t) = 0;
29};
30
31/**
32 * Interface for intercepting pre-composed layer creation.
33 *
34 * Embedders can register interceptors with animation builders, to substitute target layers
35 * with arbitrary/externally-controlled content (see ExternalLayer above).
36 */
38public:
39 /**
40 * Invoked at animation build time, for each precomp layer.
41 *
42 * @param id The target composition ID (usually assigned automatically by BM: comp_0, ...)
43 * @param name The name of the precomp layer (by default it matches the target comp name,
44 * but can be changed in AE)
45 * @param size Lottie-specified precomp layer size
46 * @return An ExternalLayer implementation (to be used instead of the actual Lottie file
47 * content), or nullptr (to use the Lottie file content).
48 */
49 virtual sk_sp<ExternalLayer> onLoadPrecomp(const char id[],
50 const char name[],
51 const SkSize& size) = 0;
52};
53
54} // namespace skottie
55
56#endif // SkottieExternalLayer_DEFINED
virtual void render(SkCanvas *canvas, double t)=0
virtual sk_sp< ExternalLayer > onLoadPrecomp(const char id[], const char name[], const SkSize &size)=0
const char * name
Definition fuchsia.cc:50