2 * Copyright (C) 2013 Canonical Ltd
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.
16 * Authored by: Thomas Voss <thomas.voss@canonical.com>
19 #ifndef SURFACE_FLINGER_COMPATIBILITY_LAYER_H_
20 #define SURFACE_FLINGER_COMPATIBILITY_LAYER_H_
27 #include <EGL/eglext.h>
34 SURFACE_FLINGER_DEFAULT_DISPLAY_ID
= 0
37 void sf_blank(size_t display_id
);
38 void sf_unblank(size_t display_id
);
40 size_t sf_get_display_width(size_t display_id
);
41 size_t sf_get_display_height(size_t display_id
);
43 // The egl_support parameter disables the use of EGL inside the
44 // library. sf_client_create() enables the use of EGL by default. When
45 // disabled, the functions sf_client_get_egl_display(),
46 // sf_client_get_egl_config(), sf_surface_get_egl_surface(),
47 // sf_surface_make_current() and the create_egl_window_surface feature are
48 // not supported anymore.
49 struct SfClient
* sf_client_create_full(int egl_support
);
50 struct SfClient
* sf_client_create();
52 EGLDisplay
sf_client_get_egl_display(struct SfClient
* display
);
53 EGLConfig
sf_client_get_egl_config(struct SfClient
* client
);
54 void sf_client_begin_transaction(struct SfClient
*);
55 void sf_client_end_transaction(struct SfClient
*);
66 int create_egl_window_surface
;
68 } SfSurfaceCreationParameters
;
70 struct SfSurface
* sf_surface_create(struct SfClient
* client
,
71 SfSurfaceCreationParameters
* params
);
72 EGLSurface
sf_surface_get_egl_surface(struct SfSurface
*);
73 EGLNativeWindowType
sf_surface_get_egl_native_window(struct SfSurface
*);
74 void sf_surface_make_current(struct SfSurface
* surface
);
76 void sf_surface_move_to(struct SfSurface
* surface
, int x
, int y
);
77 void sf_surface_set_size(struct SfSurface
* surface
, int w
, int h
);
78 void sf_surface_set_layer(struct SfSurface
* surface
, int layer
);
79 void sf_surface_set_alpha(struct SfSurface
* surface
, float alpha
);
85 #endif // SURFACE_FLINGER_COMPATIBILITY_LAYER_H_