blob: 2e75a0e4cfd96d0b058eb011bd5c572e275f2eec [file] [log] [blame]
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08001/*
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
Mathias Agopian7e27f052010-05-28 14:22:23 -070017#ifndef ANDROID_SF_ISURFACE_COMPOSER_CLIENT_H
18#define ANDROID_SF_ISURFACE_COMPOSER_CLIENT_H
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080019
20#include <stdint.h>
21#include <sys/types.h>
22
23#include <utils/Errors.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080024#include <utils/RefBase.h>
25
Mathias Agopian9cce3252010-02-09 17:46:37 -080026#include <binder/IInterface.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080027
28#include <ui/PixelFormat.h>
Mathias Agopian7e27f052010-05-28 14:22:23 -070029
Mathias Agopian9cce3252010-02-09 17:46:37 -080030#include <surfaceflinger/ISurface.h>
31
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080032namespace android {
33
34// ----------------------------------------------------------------------------
35
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080036typedef int32_t DisplayID;
37
38// ----------------------------------------------------------------------------
39
40class layer_state_t;
41
Mathias Agopian7e27f052010-05-28 14:22:23 -070042class ISurfaceComposerClient : public IInterface
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080043{
Mathias Agopian7e27f052010-05-28 14:22:23 -070044public:
45 DECLARE_META_INTERFACE(SurfaceComposerClient);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080046
47 struct surface_data_t {
48 int32_t token;
49 int32_t identity;
Mathias Agopian1c97d2e2009-08-19 17:46:26 -070050 uint32_t width;
51 uint32_t height;
52 uint32_t format;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080053 status_t readFromParcel(const Parcel& parcel);
54 status_t writeToParcel(Parcel* parcel) const;
55 };
Mathias Agopian7e27f052010-05-28 14:22:23 -070056
Mathias Agopiancc08e682010-04-15 18:48:26 -070057 /*
58 * Requires ACCESS_SURFACE_FLINGER permission
59 */
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080060 virtual sp<ISurface> createSurface( surface_data_t* data,
Mathias Agopian285dbde2010-03-01 16:09:43 -080061 const String8& name,
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080062 DisplayID display,
63 uint32_t w,
64 uint32_t h,
65 PixelFormat format,
66 uint32_t flags) = 0;
Mathias Agopian7e27f052010-05-28 14:22:23 -070067
Mathias Agopiancc08e682010-04-15 18:48:26 -070068 /*
69 * Requires ACCESS_SURFACE_FLINGER permission
70 */
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080071 virtual status_t destroySurface(SurfaceID sid) = 0;
72
Mathias Agopiancc08e682010-04-15 18:48:26 -070073 /*
74 * Requires ACCESS_SURFACE_FLINGER permission
75 */
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080076 virtual status_t setState(int32_t count, const layer_state_t* states) = 0;
77};
78
79// ----------------------------------------------------------------------------
80
Mathias Agopian7e27f052010-05-28 14:22:23 -070081class BnSurfaceComposerClient : public BnInterface<ISurfaceComposerClient>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080082{
83public:
84 virtual status_t onTransact( uint32_t code,
85 const Parcel& data,
86 Parcel* reply,
87 uint32_t flags = 0);
88};
89
90// ----------------------------------------------------------------------------
91
92}; // namespace android
93
Mathias Agopian7e27f052010-05-28 14:22:23 -070094#endif // ANDROID_SF_ISURFACE_COMPOSER_CLIENT_H