Flutter Engine
The Flutter Engine
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
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
Definition: SkSize.h:52