blob: 61524900b89b76dcc90bd8437650a7177daa6d03 [file] [log] [blame]
Ahan Wufa42c512019-05-15 19:52:51 +08001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.systemui.glwallpaper;
18
19import android.util.Size;
Ahan Wufa42c512019-05-15 19:52:51 +080020
Ahan Wu76884242019-05-22 20:04:23 +080021import java.io.FileDescriptor;
22import java.io.PrintWriter;
23
Ahan Wufa42c512019-05-15 19:52:51 +080024/**
25 * A renderer which is responsible for making OpenGL calls to render a frame.
26 */
27public interface GLWallpaperRenderer {
28
29 /**
Ahan Wu287d8282019-12-17 16:23:17 +080030 * Check if the content to render is a WCG content.
31 */
32 boolean isWcgContent();
33
34 /**
Ahan Wufa42c512019-05-15 19:52:51 +080035 * Called when the surface is created or recreated.
36 */
37 void onSurfaceCreated();
38
39 /**
40 * Called when the surface changed size.
41 * @param width surface width.
42 * @param height surface height.
43 */
44 void onSurfaceChanged(int width, int height);
45
46 /**
47 * Called to draw the current frame.
48 */
49 void onDrawFrame();
50
51 /**
Ahan Wufa42c512019-05-15 19:52:51 +080052 * Ask renderer to report the surface size it needs.
53 */
54 Size reportSurfaceSize();
55
56 /**
57 * Called when no need to render any more.
58 */
59 void finish();
60
61 /**
Ahan Wu76884242019-05-22 20:04:23 +080062 * Called to dump current state.
63 * @param prefix prefix.
64 * @param fd fd.
65 * @param out out.
66 * @param args args.
67 */
68 void dump(String prefix, FileDescriptor fd, PrintWriter out, String[] args);
69
Ahan Wufa42c512019-05-15 19:52:51 +080070}