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