OSDN Git Service

am 76cbbc07: Merge "Always #include <sys/...>, not <linux/...>."
[android-x86/frameworks-native.git] / include / gui / ISurfaceComposerClient.h
1 /*
2  * Copyright (C) 2007 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 #ifndef ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H
18 #define ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H
19
20 #include <stdint.h>
21 #include <sys/types.h>
22
23 #include <utils/Errors.h>
24 #include <utils/RefBase.h>
25
26 #include <binder/IInterface.h>
27
28 #include <ui/FrameStats.h>
29 #include <ui/PixelFormat.h>
30
31 namespace android {
32 // ----------------------------------------------------------------------------
33
34 class IGraphicBufferProducer;
35
36 class ISurfaceComposerClient : public IInterface
37 {
38 public:
39     DECLARE_META_INTERFACE(SurfaceComposerClient);
40
41     // flags for createSurface()
42     enum { // (keep in sync with Surface.java)
43         eHidden             = 0x00000004,
44         eDestroyBackbuffer  = 0x00000020,
45         eSecure             = 0x00000080,
46         eNonPremultiplied   = 0x00000100,
47         eOpaque             = 0x00000400,
48         eProtectedByApp     = 0x00000800,
49         eProtectedByDRM     = 0x00001000,
50
51         eFXSurfaceNormal    = 0x00000000,
52         eFXSurfaceDim       = 0x00020000,
53         eFXSurfaceMask      = 0x000F0000,
54     };
55
56     /*
57      * Requires ACCESS_SURFACE_FLINGER permission
58      */
59     virtual status_t createSurface(
60             const String8& name, uint32_t w, uint32_t h,
61             PixelFormat format, uint32_t flags,
62             sp<IBinder>* handle,
63             sp<IGraphicBufferProducer>* gbp) = 0;
64
65     /*
66      * Requires ACCESS_SURFACE_FLINGER permission
67      */
68     virtual status_t destroySurface(const sp<IBinder>& handle) = 0;
69
70     /*
71      * Requires ACCESS_SURFACE_FLINGER permission
72      */
73     virtual status_t clearLayerFrameStats(const sp<IBinder>& handle) const = 0;
74
75     /*
76      * Requires ACCESS_SURFACE_FLINGER permission
77      */
78     virtual status_t getLayerFrameStats(const sp<IBinder>& handle, FrameStats* outStats) const = 0;
79 };
80
81 // ----------------------------------------------------------------------------
82
83 class BnSurfaceComposerClient: public BnInterface<ISurfaceComposerClient> {
84 public:
85     virtual status_t onTransact(uint32_t code, const Parcel& data,
86             Parcel* reply, uint32_t flags = 0);
87 };
88
89 // ----------------------------------------------------------------------------
90
91 }; // namespace android
92
93 #endif // ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H