OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 #include "gpu/gles2_conform_support/egl/display.h" |
| 6 |
5 extern "C" { | 7 extern "C" { |
6 #if defined(GLES2_CONFORM_SUPPORT_ONLY) | 8 #if defined(GLES2_CONFORM_SUPPORT_ONLY) |
7 #include "gpu/gles2_conform_support/gtf/gtf_stubs.h" | 9 #include "gpu/gles2_conform_support/gtf/gtf_stubs.h" |
8 #else | 10 #else |
9 #include "third_party/gles2_conform/GTF_ES/glsl/GTF/Source/eglNative.h" | 11 #include "third_party/gles2_conform/GTF_ES/glsl/GTF/Source/eglNative.h" |
10 #endif | 12 #endif |
11 | 13 |
12 GTFbool GTFNativeCreateDisplay(EGLNativeDisplayType *pNativeDisplay) { | 14 GTFbool GTFNativeCreateDisplay(EGLNativeDisplayType *pNativeDisplay) { |
13 *pNativeDisplay = EGL_DEFAULT_DISPLAY; | 15 *pNativeDisplay = EGL_DEFAULT_DISPLAY; |
14 return GTFtrue; | 16 return GTFtrue; |
15 } | 17 } |
16 | 18 |
17 void GTFNativeDestroyDisplay(EGLNativeDisplayType nativeDisplay) { | 19 void GTFNativeDestroyDisplay(EGLNativeDisplayType nativeDisplay) { |
18 // Nothing to destroy since we are using EGL_DEFAULT_DISPLAY | 20 // Nothing to destroy since we are using EGL_DEFAULT_DISPLAY |
19 } | 21 } |
20 | 22 |
21 GTFbool GTFNativeCreateWindow(EGLNativeDisplayType nativeDisplay, | 23 GTFbool GTFNativeCreateWindow(EGLNativeDisplayType nativeDisplay, |
22 EGLDisplay eglDisplay, EGLConfig eglConfig, | 24 EGLDisplay eglDisplay, EGLConfig eglConfig, |
23 const char* title, int width, int height, | 25 const char* title, int width, int height, |
24 EGLNativeWindowType *pNativeWindow) { | 26 EGLNativeWindowType *pNativeWindow) { |
25 // GTF should use EGL pbuffer interface directly. | 27 egl::Display* display = static_cast<egl::Display*>(eglDisplay); |
26 return GTFfalse; | 28 display->SetCreateOffscreen(width, height); |
| 29 return GTFtrue; |
27 } | 30 } |
28 | 31 |
29 void GTFNativeDestroyWindow(EGLNativeDisplayType nativeDisplay, | 32 void GTFNativeDestroyWindow(EGLNativeDisplayType nativeDisplay, |
30 EGLNativeWindowType nativeWindow) { | 33 EGLNativeWindowType nativeWindow) { |
31 } | 34 } |
32 | 35 |
33 EGLImageKHR GTFCreateEGLImage(int width, int height, | 36 EGLImageKHR GTFCreateEGLImage(int width, int height, |
34 GLenum format, GLenum type) { | 37 GLenum format, GLenum type) { |
35 return (EGLImageKHR)NULL; | 38 return (EGLImageKHR)NULL; |
36 } | 39 } |
37 | 40 |
38 void GTFDestroyEGLImage(EGLImageKHR image) { | 41 void GTFDestroyEGLImage(EGLImageKHR image) { |
39 } | 42 } |
40 | 43 |
41 } // extern "C" | 44 } // extern "C" |
42 | 45 |
OLD | NEW |