2 * Copyright (C) 2007 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H
18 #define ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H
21 #include <sys/types.h>
23 #include <utils/Errors.h>
24 #include <utils/RefBase.h>
26 #include <binder/IInterface.h>
28 #include <ui/FrameStats.h>
29 #include <ui/PixelFormat.h>
32 // ----------------------------------------------------------------------------
34 class IGraphicBufferProducer;
36 class ISurfaceComposerClient : public IInterface
39 DECLARE_META_INTERFACE(SurfaceComposerClient);
41 // flags for createSurface()
42 enum { // (keep in sync with Surface.java)
44 eDestroyBackbuffer = 0x00000020,
46 eNonPremultiplied = 0x00000100,
48 eProtectedByApp = 0x00000800,
49 eProtectedByDRM = 0x00001000,
50 eCursorWindow = 0x00002000,
52 eFXSurfaceNormal = 0x00000000,
53 eFXSurfaceDim = 0x00020000,
54 eFXSurfaceMask = 0x000F0000,
58 * Requires ACCESS_SURFACE_FLINGER permission
60 virtual status_t createSurface(
61 const String8& name, uint32_t w, uint32_t h,
62 PixelFormat format, uint32_t flags,
64 sp<IGraphicBufferProducer>* gbp) = 0;
67 * Requires ACCESS_SURFACE_FLINGER permission
69 virtual status_t destroySurface(const sp<IBinder>& handle) = 0;
72 * Requires ACCESS_SURFACE_FLINGER permission
74 virtual status_t clearLayerFrameStats(const sp<IBinder>& handle) const = 0;
77 * Requires ACCESS_SURFACE_FLINGER permission
79 virtual status_t getLayerFrameStats(const sp<IBinder>& handle, FrameStats* outStats) const = 0;
82 // ----------------------------------------------------------------------------
84 class BnSurfaceComposerClient: public BnInterface<ISurfaceComposerClient> {
86 virtual status_t onTransact(uint32_t code, const Parcel& data,
87 Parcel* reply, uint32_t flags = 0);
90 // ----------------------------------------------------------------------------
92 }; // namespace android
94 #endif // ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H