blob: bb2d39f54caf2293703910892e9f1177728033ed [file] [log] [blame]
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -07001/*
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_ISURFACE_FLINGER_CLIENT_H
18#define ANDROID_ISURFACE_FLINGER_CLIENT_H
19
20#include <stdint.h>
21#include <sys/types.h>
22
23#include <utils/Errors.h>
24#include <utils/IInterface.h>
25#include <utils/RefBase.h>
26
27#include <ui/ISurface.h>
28
29#include <ui/PixelFormat.h>
30
31namespace android {
32
33// ----------------------------------------------------------------------------
34
35class Rect;
36class Point;
37class IMemory;
38class ISurface;
39
40typedef int32_t ClientID;
41typedef int32_t DisplayID;
42
43// ----------------------------------------------------------------------------
44
45class layer_state_t;
46
47class ISurfaceFlingerClient : public IInterface
48{
49public:
50 DECLARE_META_INTERFACE(SurfaceFlingerClient);
51
52 struct surface_data_t {
53 int32_t token;
54 int32_t identity;
55 int32_t type;
56 sp<IMemoryHeap> heap[2];
57 status_t readFromParcel(const Parcel& parcel);
58 status_t writeToParcel(Parcel* parcel) const;
59 };
60
61 virtual void getControlBlocks(sp<IMemory>* ctl) const = 0;
62
63 virtual sp<ISurface> createSurface( surface_data_t* data,
64 int pid,
65 DisplayID display,
66 uint32_t w,
67 uint32_t h,
68 PixelFormat format,
69 uint32_t flags) = 0;
70
71 virtual status_t destroySurface(SurfaceID sid) = 0;
72
73 virtual status_t setState(int32_t count, const layer_state_t* states) = 0;
74};
75
76// ----------------------------------------------------------------------------
77
78class BnSurfaceFlingerClient : public BnInterface<ISurfaceFlingerClient>
79{
80public:
81 virtual status_t onTransact( uint32_t code,
82 const Parcel& data,
83 Parcel* reply,
84 uint32_t flags = 0);
85};
86
87// ----------------------------------------------------------------------------
88
89}; // namespace android
90
91#endif // ANDROID_ISURFACE_FLINGER_CLIENT_H