1 /*
2  * Copyright 2022 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 
17 package android.gui;
18 
19 import android.gui.CreateSurfaceResult;
20 import android.gui.FrameStats;
21 import android.gui.LayerMetadata;
22 import android.gui.SchedulingPolicy;
23 
24 /** @hide */
25 interface ISurfaceComposerClient {
26 
27     // flags for createSurface()
28     // (keep in sync with SurfaceControl.java)
29     const int eHidden = 0x00000004;
30     const int eDestroyBackbuffer = 0x00000020;
31     const int eSkipScreenshot = 0x00000040;
32     const int eSecure = 0x00000080;
33     const int eNonPremultiplied = 0x00000100;
34     const int eOpaque = 0x00000400;
35     const int eProtectedByApp = 0x00000800;
36     const int eProtectedByDRM = 0x00001000;
37     const int eCursorWindow = 0x00002000;
38     const int eNoColorFill = 0x00004000;
39 
40     const int eFXSurfaceBufferQueue = 0x00000000;
41     const int eFXSurfaceEffect = 0x00020000;
42     const int eFXSurfaceBufferState = 0x00040000;
43     const int eFXSurfaceContainer = 0x00080000;
44     const int eFXSurfaceMask = 0x000F0000;
45 
46     /**
47      * Requires ACCESS_SURFACE_FLINGER permission
48      */
createSurface(@tf8InCpp String name, int flags, @nullable IBinder parent, in LayerMetadata metadata)49     CreateSurfaceResult createSurface(@utf8InCpp String name, int flags, @nullable IBinder parent, in LayerMetadata metadata);
50 
51     /**
52      * Requires ACCESS_SURFACE_FLINGER permission
53      */
clearLayerFrameStats(IBinder handle)54     void clearLayerFrameStats(IBinder handle);
55 
56     /**
57      * Requires ACCESS_SURFACE_FLINGER permission
58      */
getLayerFrameStats(IBinder handle)59     FrameStats getLayerFrameStats(IBinder handle);
60 
mirrorSurface(IBinder mirrorFromHandle)61     CreateSurfaceResult mirrorSurface(IBinder mirrorFromHandle);
62 
mirrorDisplay(long displayId)63     CreateSurfaceResult mirrorDisplay(long displayId);
64 
getSchedulingPolicy()65     SchedulingPolicy getSchedulingPolicy();
66 }
67