skia2/modules/skottie/include/ExternalLayer.h
John Stiles a6841be235 Enable ClangTidy check llvm-namespace-comment.
This fixes a large number of SkSL namespaces which were labeled as if
they were anonymous, and also a handful of other mislabeled namespaces.
Missing namespace-end comments have been added throughout.
A number of diffs are just indentation-related (adjusting 1- or 3-
space indents to 2-space).

Change-Id: I6c62052a0d3aea4ae12ca07e0c2a8587b2fce4ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308503
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-08-06 19:07:52 +00:00

57 lines
1.7 KiB
C++

/*
* Copyright 2020 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkottieExternalLayer_DEFINED
#define SkottieExternalLayer_DEFINED
#include "include/core/SkRefCnt.h"
class SkCanvas;
struct SkSize;
namespace skottie {
/**
* Interface for externally-rendered layers.
*/
class ExternalLayer : public SkRefCnt {
public:
/** Render layer content into the given canvas.
*
* @param canvas Destination canvas
* @param t Time in seconds, relative to the layer in-point (start time)
*/
virtual void render(SkCanvas* canvas, double t) = 0;
};
/**
* Interface for intercepting pre-composed layer creation.
*
* Embedders can register interceptors with animation builders, to substitute target layers
* with arbitrary/externally-controlled content (see ExternalLayer above).
*/
class PrecompInterceptor : public SkRefCnt {
public:
/**
* Invoked at animation build time, for each precomp layer.
*
* @param id The target composition ID (usually assigned automatically by BM: comp_0, ...)
* @param name The name of the precomp layer (by default it matches the target comp name,
* but can be changed in AE)
* @param size Lottie-specified precomp layer size
* @return An ExternalLayer implementation (to be used instead of the actual Lottie file
* content), or nullptr (to use the Lottie file content).
*/
virtual sk_sp<ExternalLayer> onLoadPrecomp(const char id[],
const char name[],
const SkSize& size) = 0;
};
} // namespace skottie
#endif // SkottieExternalLayer_DEFINED