OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 // Using egl_native from gles2_conform_support |
| 6 // TODO: We may want to phase out the old gles2_conform support in preference |
| 7 // of this implementation. So eventually we'll need to move the egl_native |
| 8 // stuff here or to a shareable location/path. |
| 9 #include "gpu/gles2_conform_support/egl/display.h" |
| 10 |
| 11 #include "third_party/khronos_conform/framework/egl/tcuEglPlatform.hpp" |
| 12 |
| 13 namespace egl { |
| 14 namespace native { |
| 15 namespace windowless { |
| 16 |
| 17 class Window : public tcu::NativeWindow { |
| 18 public: |
| 19 Window(tcu::egl::Display& display, EGLConfig config, |
| 20 const EGLint* attribList, int width, int height) |
| 21 : tcu::NativeWindow::NativeWindow(), |
| 22 eglDisplay_(display), |
| 23 eglSurface_(display, config, (EGLNativeWindowType)NULL, attribList) { |
| 24 } |
| 25 |
| 26 virtual ~Window() { |
| 27 } |
| 28 |
| 29 tcu::egl::Display& getEglDisplay() { |
| 30 return eglDisplay_; |
| 31 } |
| 32 |
| 33 tcu::egl::WindowSurface& getEglSurface() { |
| 34 return eglSurface_; |
| 35 } |
| 36 |
| 37 void processEvents() { |
| 38 return; |
| 39 } |
| 40 |
| 41 private: |
| 42 tcu::egl::Display& eglDisplay_; |
| 43 tcu::egl::WindowSurface eglSurface_; |
| 44 }; |
| 45 |
| 46 class Platform : public tcu::EglPlatform { |
| 47 public: |
| 48 Platform() |
| 49 : tcu::EglPlatform::EglPlatform() { |
| 50 } |
| 51 |
| 52 virtual ~Platform() { |
| 53 } |
| 54 |
| 55 tcu::NativeWindow* createWindow(tcu::NativeDisplay& dpy, |
| 56 EGLConfig config, |
| 57 const EGLint* attribList, |
| 58 int width, int height, |
| 59 qpVisibility visibility) { |
| 60 tcu::egl::Display& eglDisplay = dpy.getEglDisplay(); |
| 61 egl::Display* display = static_cast<egl::Display*>( |
| 62 eglDisplay.getEGLDisplay()); |
| 63 display->SetCreateOffscreen(width, height); |
| 64 return new Window(eglDisplay, config, attribList, width, height); |
| 65 } |
| 66 }; |
| 67 |
| 68 } // namespace windowless |
| 69 } // namespace native |
| 70 } // namespace egl |
| 71 |
| 72 tcu::Platform* createPlatform (void) |
| 73 { |
| 74 return new egl::native::windowless::Platform(); |
| 75 } |
OLD | NEW |