Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ui / ozone / platform / egltest / eglplatform_shim.h
blobce7cce9838f06038c0b59f5e1bc2c05ad6d7fbb6
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef __eglplatform_shim_h_
6 #define __eglplatform_shim_h_
8 #include <stdbool.h>
9 #include <stdint.h>
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
15 #define SHIM_EXPORT __attribute__((visibility("default")))
17 // Simple integral native window identifier.
18 // NB: Unlike EGLNativeWindowType, this will be shipped between processes.
19 typedef int ShimNativeWindowId;
20 #define SHIM_NO_WINDOW_ID ((ShimNativeWindowId)0)
22 // Opaque versions of EGL types (as used by ozone).
23 typedef intptr_t ShimEGLNativeDisplayType;
24 typedef intptr_t ShimEGLNativeWindowType;
26 // QueryString targets
27 #define SHIM_EGL_LIBRARY 0x1001
28 #define SHIM_GLES_LIBRARY 0x1002
30 // CreateWindow / QueryWindow attributes
31 #define SHIM_WINDOW_WIDTH 0x0001
32 #define SHIM_WINDOW_HEIGHT 0x0002
34 // Query global implementation information.
35 SHIM_EXPORT const char* ShimQueryString(int name);
37 // Init/terminate library.
38 SHIM_EXPORT bool ShimInitialize(void);
39 SHIM_EXPORT bool ShimTerminate(void);
41 // Create window handle & query window properties (called from browser process).
42 SHIM_EXPORT ShimNativeWindowId ShimCreateWindow(void);
43 SHIM_EXPORT bool ShimQueryWindow(ShimNativeWindowId window_id,
44 int attribute,
45 int* value);
46 SHIM_EXPORT bool ShimDestroyWindow(ShimNativeWindowId window_id);
48 // Manage actual EGL platform objects (called from GPU process).
49 SHIM_EXPORT ShimEGLNativeDisplayType ShimGetNativeDisplay(void);
50 SHIM_EXPORT ShimEGLNativeWindowType
51 ShimGetNativeWindow(ShimNativeWindowId native_window_id);
52 SHIM_EXPORT bool ShimReleaseNativeWindow(ShimEGLNativeWindowType native_window);
54 #ifdef __cplusplus
56 #endif
58 #endif /* __eglplatform_shim_h */