Imported Upstream version 0.1.0+git20131207+e452e83
[deb_libhybris.git] / hybris / include / hybris / internal / surface_flinger_compatibility_layer_internal.h
1 /*
2 * Copyright (C) 2013 Canonical Ltd
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 * Authored by: Thomas Voss <thomas.voss@canonical.com>
17 */
18
19 #ifndef SURFACE_FLINGER_COMPATIBILITY_LAYER_INTERNAL_H_
20 #define SURFACE_FLINGER_COMPATIBILITY_LAYER_INTERNAL_H_
21
22 #ifndef __ANDROID__
23 #error "Using this header is only safe when compiling for Android."
24 #endif
25
26 #include <utils/misc.h>
27
28 #include <gui/SurfaceComposerClient.h>
29 #include <ui/PixelFormat.h>
30 #include <ui/Region.h>
31 #include <ui/Rect.h>
32
33 #include <cassert>
34 #include <cstdio>
35
36 struct SfClient
37 {
38 android::sp<android::SurfaceComposerClient> client;
39 EGLDisplay egl_display;
40 EGLConfig egl_config;
41 EGLContext egl_context;
42 bool egl_support;
43 };
44
45 struct SfSurface
46 {
47 SfSurface() : client(NULL)
48 {
49 }
50
51 SfClient* client;
52 android::sp<android::SurfaceControl> surface_control;
53 android::sp<android::Surface> surface;
54 EGLSurface egl_surface;
55 };
56
57 #endif // SURFACE_FLINGER_COMPATIBILITY_LAYER_INTERNAL_H_