Skia
2D Graphics Library
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 
11 #include "include/core/SkRefCnt.h"
12 
13 class SkCanvas;
14 struct SkSize;
15 
16 namespace skottie {
17 
21 class ExternalLayer : public SkRefCnt {
22 public:
28  virtual void render(SkCanvas* canvas, double t) = 0;
29 };
30 
37 class PrecompInterceptor : public SkRefCnt {
38 public:
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
SkCanvas provides an interface for drawing, and how the drawing is clipped and transformed.
Definition: SkCanvas.h:99
Definition: SkRefCnt.h:119
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:220
Interface for externally-rendered layers.
Definition: ExternalLayer.h:21
virtual void render(SkCanvas *canvas, double t)=0
Render layer content into the given canvas.
Interface for intercepting pre-composed layer creation.
Definition: ExternalLayer.h:37
virtual sk_sp< ExternalLayer > onLoadPrecomp(const char id[], const char name[], const SkSize &size)=0
Invoked at animation build time, for each precomp layer.
Definition: ExternalLayer.h:16
Definition: SkSize.h:51