OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 // Using egl_native from gles2_conform_support | 5 // Using egl_native from gles2_conform_support |
6 // TODO: We may want to phase out the old gles2_conform support in preference | 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 | 7 // of this implementation. So eventually we'll need to move the egl_native |
8 // stuff here or to a shareable location/path. | 8 // stuff here or to a shareable location/path. |
9 #include "gpu/gles2_conform_support/egl/display.h" | 9 #include "gpu/gles2_conform_support/egl/display.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 const EGLint* attribList, | 21 const EGLint* attribList, |
22 int width, | 22 int width, |
23 int height) | 23 int height) |
24 : tcu::egl::WindowSurface(display, | 24 : tcu::egl::WindowSurface(display, |
25 config, | 25 config, |
26 (EGLNativeWindowType)NULL, | 26 (EGLNativeWindowType)NULL, |
27 attribList), | 27 attribList), |
28 width_(width), | 28 width_(width), |
29 height_(height) {} | 29 height_(height) {} |
30 | 30 |
31 int getWidth() const { return width_; } | 31 int getWidth() const override { return width_; } |
32 | 32 |
33 int getHeight() const { return height_; } | 33 int getHeight() const override { return height_; } |
34 | 34 |
35 private: | 35 private: |
36 const int width_; | 36 const int width_; |
37 const int height_; | 37 const int height_; |
38 }; | 38 }; |
39 | 39 |
40 class Window : public tcu::NativeWindow { | 40 class Window : public tcu::NativeWindow { |
41 public: | 41 public: |
42 Window(tcu::egl::Display& display, | 42 Window(tcu::egl::Display& display, |
43 EGLConfig config, | 43 EGLConfig config, |
44 const EGLint* attribList, | 44 const EGLint* attribList, |
45 int width, | 45 int width, |
46 int height) | 46 int height) |
47 : tcu::NativeWindow::NativeWindow(), | 47 : tcu::NativeWindow::NativeWindow(), |
48 eglDisplay_(display), | 48 eglDisplay_(display), |
49 surface_(display, config, attribList, width, height) {} | 49 surface_(display, config, attribList, width, height) {} |
50 | 50 |
51 virtual ~Window() {} | 51 ~Window() override {} |
52 | 52 |
53 tcu::egl::Display& getEglDisplay() { return eglDisplay_; } | 53 tcu::egl::Display& getEglDisplay() override { return eglDisplay_; } |
54 | 54 |
55 tcu::egl::WindowSurface& getEglSurface() { return surface_; } | 55 tcu::egl::WindowSurface& getEglSurface() override { return surface_; } |
56 | 56 |
57 void processEvents() { return; } | 57 void processEvents() override { return; } |
58 | 58 |
59 private: | 59 private: |
60 tcu::egl::Display& eglDisplay_; | 60 tcu::egl::Display& eglDisplay_; |
61 Surface surface_; | 61 Surface surface_; |
62 }; | 62 }; |
63 | 63 |
64 class Platform : public tcu::EglPlatform { | 64 class Platform : public tcu::EglPlatform { |
65 public: | 65 public: |
66 Platform() : tcu::EglPlatform::EglPlatform() {} | 66 Platform() : tcu::EglPlatform::EglPlatform() {} |
67 | 67 |
68 virtual ~Platform() {} | 68 ~Platform() override {} |
69 | 69 |
70 tcu::NativeWindow* createWindow(tcu::NativeDisplay& dpy, | 70 tcu::NativeWindow* createWindow(tcu::NativeDisplay& dpy, |
71 EGLConfig config, | 71 EGLConfig config, |
72 const EGLint* attribList, | 72 const EGLint* attribList, |
73 int width, | 73 int width, |
74 int height, | 74 int height, |
75 qpVisibility visibility) { | 75 qpVisibility visibility) override { |
76 tcu::egl::Display& eglDisplay = dpy.getEglDisplay(); | 76 tcu::egl::Display& eglDisplay = dpy.getEglDisplay(); |
77 egl::Display* display = | 77 egl::Display* display = |
78 static_cast<egl::Display*>(eglDisplay.getEGLDisplay()); | 78 static_cast<egl::Display*>(eglDisplay.getEGLDisplay()); |
79 display->SetCreateOffscreen(width, height); | 79 display->SetCreateOffscreen(width, height); |
80 return new Window(eglDisplay, config, attribList, width, height); | 80 return new Window(eglDisplay, config, attribList, width, height); |
81 } | 81 } |
82 }; | 82 }; |
83 | 83 |
84 } // namespace windowless | 84 } // namespace windowless |
85 } // namespace native | 85 } // namespace native |
86 } // namespace egl | 86 } // namespace egl |
87 | 87 |
88 tcu::Platform* createPlatform(void) { | 88 tcu::Platform* createPlatform(void) { |
89 return new egl::native::windowless::Platform(); | 89 return new egl::native::windowless::Platform(); |
90 } | 90 } |
OLD | NEW |