The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 The Android Open Source Project |
| 3 | * |
| 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 |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 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. |
| 15 | */ |
| 16 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 17 | #include <stdlib.h> |
| 18 | #include <stdio.h> |
| 19 | #include <string.h> |
| 20 | #include <math.h> |
| 21 | |
| 22 | #include <cutils/properties.h> |
| 23 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 24 | #include <utils/RefBase.h> |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | #include <utils/Log.h> |
| 26 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 27 | #include <ui/PixelFormat.h> |
Mathias Agopian | 0926f50 | 2009-05-04 14:17:04 -0700 | [diff] [blame] | 28 | #include <ui/FramebufferNativeWindow.h> |
Mathias Agopian | 6cf50a7 | 2009-08-06 16:05:39 -0700 | [diff] [blame] | 29 | #include <ui/EGLUtils.h> |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 30 | |
| 31 | #include <GLES/gl.h> |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 32 | #include <EGL/egl.h> |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 33 | #include <EGL/eglext.h> |
| 34 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 35 | #include <pixelflinger/pixelflinger.h> |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 36 | |
| 37 | #include "DisplayHardware/DisplayHardware.h" |
| 38 | |
| 39 | #include <hardware/copybit.h> |
| 40 | #include <hardware/overlay.h> |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 41 | #include <hardware/gralloc.h> |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 42 | |
Mathias Agopian | 1f7bec6 | 2010-06-25 18:02:21 -0700 | [diff] [blame^] | 43 | #include "GLExtensions.h" |
| 44 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | using namespace android; |
| 46 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 47 | |
| 48 | static __attribute__((noinline)) |
| 49 | void checkGLErrors() |
| 50 | { |
Mathias Agopian | cbb288b | 2009-09-07 16:32:45 -0700 | [diff] [blame] | 51 | do { |
| 52 | // there could be more than one error flag |
| 53 | GLenum error = glGetError(); |
| 54 | if (error == GL_NO_ERROR) |
| 55 | break; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 56 | LOGE("GL error 0x%04x", int(error)); |
Mathias Agopian | cbb288b | 2009-09-07 16:32:45 -0700 | [diff] [blame] | 57 | } while(true); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | static __attribute__((noinline)) |
| 61 | void checkEGLErrors(const char* token) |
| 62 | { |
| 63 | EGLint error = eglGetError(); |
Mathias Agopian | cbb288b | 2009-09-07 16:32:45 -0700 | [diff] [blame] | 64 | if (error && error != EGL_SUCCESS) { |
| 65 | LOGE("%s: EGL error 0x%04x (%s)", |
Mathias Agopian | 0928e31 | 2009-08-07 16:38:10 -0700 | [diff] [blame] | 66 | token, int(error), EGLUtils::strerror(error)); |
Mathias Agopian | cbb288b | 2009-09-07 16:32:45 -0700 | [diff] [blame] | 67 | } |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 68 | } |
| 69 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 70 | /* |
| 71 | * Initialize the display to the specified values. |
| 72 | * |
| 73 | */ |
| 74 | |
| 75 | DisplayHardware::DisplayHardware( |
| 76 | const sp<SurfaceFlinger>& flinger, |
| 77 | uint32_t dpy) |
Mathias Agopian | 1f7bec6 | 2010-06-25 18:02:21 -0700 | [diff] [blame^] | 78 | : DisplayHardwareBase(flinger, dpy), |
| 79 | mFlags(0) |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 80 | { |
| 81 | init(dpy); |
| 82 | } |
| 83 | |
| 84 | DisplayHardware::~DisplayHardware() |
| 85 | { |
| 86 | fini(); |
| 87 | } |
| 88 | |
| 89 | float DisplayHardware::getDpiX() const { return mDpiX; } |
| 90 | float DisplayHardware::getDpiY() const { return mDpiY; } |
| 91 | float DisplayHardware::getDensity() const { return mDensity; } |
| 92 | float DisplayHardware::getRefreshRate() const { return mRefreshRate; } |
| 93 | int DisplayHardware::getWidth() const { return mWidth; } |
| 94 | int DisplayHardware::getHeight() const { return mHeight; } |
| 95 | PixelFormat DisplayHardware::getFormat() const { return mFormat; } |
Mathias Agopian | ca99fb8 | 2010-04-14 16:43:44 -0700 | [diff] [blame] | 96 | uint32_t DisplayHardware::getMaxTextureSize() const { return mMaxTextureSize; } |
| 97 | uint32_t DisplayHardware::getMaxViewportDims() const { return mMaxViewportDims; } |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 98 | |
| 99 | void DisplayHardware::init(uint32_t dpy) |
| 100 | { |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 101 | mNativeWindow = new FramebufferNativeWindow(); |
Mathias Agopian | 0928e31 | 2009-08-07 16:38:10 -0700 | [diff] [blame] | 102 | framebuffer_device_t const * fbDev = mNativeWindow->getDevice(); |
Mathias Agopian | 1f7bec6 | 2010-06-25 18:02:21 -0700 | [diff] [blame^] | 103 | mDpiX = mNativeWindow->xdpi; |
| 104 | mDpiY = mNativeWindow->ydpi; |
| 105 | mRefreshRate = fbDev->fps; |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 106 | |
| 107 | mOverlayEngine = NULL; |
Mathias Agopian | 0928e31 | 2009-08-07 16:38:10 -0700 | [diff] [blame] | 108 | hw_module_t const* module; |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 109 | if (hw_get_module(OVERLAY_HARDWARE_MODULE_ID, &module) == 0) { |
| 110 | overlay_control_open(module, &mOverlayEngine); |
| 111 | } |
| 112 | |
Mathias Agopian | 1f7bec6 | 2010-06-25 18:02:21 -0700 | [diff] [blame^] | 113 | EGLint w, h, dummy; |
| 114 | EGLint numConfigs=0; |
| 115 | EGLSurface surface; |
| 116 | EGLContext context; |
| 117 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 118 | // initialize EGL |
Mathias Agopian | a5b02e0 | 2009-09-04 18:49:03 -0700 | [diff] [blame] | 119 | EGLint attribs[] = { |
Mathias Agopian | 0928e31 | 2009-08-07 16:38:10 -0700 | [diff] [blame] | 120 | EGL_SURFACE_TYPE, EGL_WINDOW_BIT, |
Mathias Agopian | a5b02e0 | 2009-09-04 18:49:03 -0700 | [diff] [blame] | 121 | EGL_NONE, 0, |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 122 | EGL_NONE |
| 123 | }; |
Mathias Agopian | a5b02e0 | 2009-09-04 18:49:03 -0700 | [diff] [blame] | 124 | |
| 125 | // debug: disable h/w rendering |
| 126 | char property[PROPERTY_VALUE_MAX]; |
| 127 | if (property_get("debug.sf.hw", property, NULL) > 0) { |
| 128 | if (atoi(property) == 0) { |
| 129 | LOGW("H/W composition disabled"); |
| 130 | attribs[2] = EGL_CONFIG_CAVEAT; |
| 131 | attribs[3] = EGL_SLOW_CONFIG; |
| 132 | } |
| 133 | } |
| 134 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 135 | // TODO: all the extensions below should be queried through |
| 136 | // eglGetProcAddress(). |
| 137 | |
| 138 | EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); |
| 139 | eglInitialize(display, NULL, NULL); |
| 140 | eglGetConfigs(display, NULL, 0, &numConfigs); |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 141 | |
Mathias Agopian | 6cf50a7 | 2009-08-06 16:05:39 -0700 | [diff] [blame] | 142 | EGLConfig config; |
Mathias Agopian | 0928e31 | 2009-08-07 16:38:10 -0700 | [diff] [blame] | 143 | status_t err = EGLUtils::selectConfigForNativeWindow( |
| 144 | display, attribs, mNativeWindow.get(), &config); |
Mathias Agopian | 6cf50a7 | 2009-08-06 16:05:39 -0700 | [diff] [blame] | 145 | LOGE_IF(err, "couldn't find an EGLConfig matching the screen format"); |
| 146 | |
Mathias Agopian | 0928e31 | 2009-08-07 16:38:10 -0700 | [diff] [blame] | 147 | EGLint r,g,b,a; |
| 148 | eglGetConfigAttrib(display, config, EGL_RED_SIZE, &r); |
| 149 | eglGetConfigAttrib(display, config, EGL_GREEN_SIZE, &g); |
| 150 | eglGetConfigAttrib(display, config, EGL_BLUE_SIZE, &b); |
| 151 | eglGetConfigAttrib(display, config, EGL_ALPHA_SIZE, &a); |
| 152 | |
Mathias Agopian | 1e16b13 | 2009-05-07 17:40:23 -0700 | [diff] [blame] | 153 | if (mNativeWindow->isUpdateOnDemand()) { |
Mathias Agopian | 95a666b | 2009-09-24 14:57:26 -0700 | [diff] [blame] | 154 | mFlags |= PARTIAL_UPDATES; |
Mathias Agopian | 1e16b13 | 2009-05-07 17:40:23 -0700 | [diff] [blame] | 155 | } |
| 156 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 157 | if (eglGetConfigAttrib(display, config, EGL_CONFIG_CAVEAT, &dummy) == EGL_TRUE) { |
| 158 | if (dummy == EGL_SLOW_CONFIG) |
| 159 | mFlags |= SLOW_CONFIG; |
| 160 | } |
| 161 | |
| 162 | /* |
| 163 | * Create our main surface |
| 164 | */ |
| 165 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 166 | surface = eglCreateWindowSurface(display, config, mNativeWindow.get(), NULL); |
Mathias Agopian | 1f7bec6 | 2010-06-25 18:02:21 -0700 | [diff] [blame^] | 167 | eglQuerySurface(display, surface, EGL_WIDTH, &mWidth); |
| 168 | eglQuerySurface(display, surface, EGL_HEIGHT, &mHeight); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 169 | |
Mathias Agopian | 95a666b | 2009-09-24 14:57:26 -0700 | [diff] [blame] | 170 | if (mFlags & PARTIAL_UPDATES) { |
| 171 | // if we have partial updates, we definitely don't need to |
| 172 | // preserve the backbuffer, which may be costly. |
Mathias Agopian | 0928bee | 2009-09-16 20:15:42 -0700 | [diff] [blame] | 173 | eglSurfaceAttrib(display, surface, |
| 174 | EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED); |
| 175 | } |
| 176 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 177 | if (eglQuerySurface(display, surface, EGL_SWAP_BEHAVIOR, &dummy) == EGL_TRUE) { |
| 178 | if (dummy == EGL_BUFFER_PRESERVED) { |
| 179 | mFlags |= BUFFER_PRESERVED; |
| 180 | } |
| 181 | } |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 182 | |
David 'Digit' Turner | ae71acc | 2009-06-19 04:41:12 +0200 | [diff] [blame] | 183 | /* Read density from build-specific ro.sf.lcd_density property |
Mathias Agopian | 24e5f52 | 2009-08-12 21:18:15 -0700 | [diff] [blame] | 184 | * except if it is overridden by qemu.sf.lcd_density. |
David 'Digit' Turner | ae71acc | 2009-06-19 04:41:12 +0200 | [diff] [blame] | 185 | */ |
| 186 | if (property_get("qemu.sf.lcd_density", property, NULL) <= 0) { |
| 187 | if (property_get("ro.sf.lcd_density", property, NULL) <= 0) { |
| 188 | LOGW("ro.sf.lcd_density not defined, using 160 dpi by default."); |
| 189 | strcpy(property, "160"); |
David 'Digit' Turner | 694e10b | 2009-06-18 04:30:32 +0200 | [diff] [blame] | 190 | } |
David 'Digit' Turner | 31469e1 | 2009-07-29 00:38:58 +0200 | [diff] [blame] | 191 | } else { |
| 192 | /* for the emulator case, reset the dpi values too */ |
| 193 | mDpiX = mDpiY = atoi(property); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 194 | } |
| 195 | mDensity = atoi(property) * (1.0f/160.0f); |
| 196 | |
| 197 | |
| 198 | /* |
| 199 | * Create our OpenGL ES context |
| 200 | */ |
| 201 | |
| 202 | context = eglCreateContext(display, config, NULL, NULL); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 203 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 204 | mDisplay = display; |
| 205 | mConfig = config; |
| 206 | mSurface = surface; |
| 207 | mContext = context; |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 208 | mFormat = fbDev->format; |
| 209 | mPageFlipCount = 0; |
Mathias Agopian | 1f7bec6 | 2010-06-25 18:02:21 -0700 | [diff] [blame^] | 210 | |
| 211 | /* |
| 212 | * Gather OpenGL ES extensions |
| 213 | */ |
| 214 | |
| 215 | eglMakeCurrent(display, surface, surface, context); |
| 216 | |
| 217 | GLExtensions& extensions(GLExtensions::getInstance()); |
| 218 | extensions.initWithGLStrings( |
| 219 | glGetString(GL_VENDOR), |
| 220 | glGetString(GL_RENDERER), |
| 221 | glGetString(GL_VERSION), |
| 222 | glGetString(GL_EXTENSIONS), |
| 223 | eglQueryString(display, EGL_VENDOR), |
| 224 | eglQueryString(display, EGL_VERSION), |
| 225 | eglQueryString(display, EGL_EXTENSIONS)); |
| 226 | |
| 227 | glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize); |
| 228 | glGetIntegerv(GL_MAX_VIEWPORT_DIMS, &mMaxViewportDims); |
| 229 | |
| 230 | |
| 231 | #ifdef EGL_ANDROID_swap_rectangle |
| 232 | if (extensions.hasExtension("EGL_ANDROID_swap_rectangle")) { |
| 233 | if (eglSetSwapRectangleANDROID(display, surface, |
| 234 | 0, 0, mWidth, mHeight) == EGL_TRUE) { |
| 235 | // This could fail if this extension is not supported by this |
| 236 | // specific surface (of config) |
| 237 | mFlags |= SWAP_RECTANGLE; |
| 238 | } |
| 239 | } |
| 240 | // when we have the choice between PARTIAL_UPDATES and SWAP_RECTANGLE |
| 241 | // choose PARTIAL_UPDATES, which should be more efficient |
| 242 | if (mFlags & PARTIAL_UPDATES) |
| 243 | mFlags &= ~SWAP_RECTANGLE; |
| 244 | #endif |
| 245 | |
| 246 | LOGI("EGL informations:"); |
| 247 | LOGI("# of configs : %d", numConfigs); |
| 248 | LOGI("vendor : %s", extensions.getEglVendor()); |
| 249 | LOGI("version : %s", extensions.getEglVersion()); |
| 250 | LOGI("extensions: %s", extensions.getEglExtension()); |
| 251 | LOGI("Client API: %s", eglQueryString(display, EGL_CLIENT_APIS)?:"Not Supported"); |
| 252 | LOGI("EGLSurface: %d-%d-%d-%d, config=%p", r, g, b, a, config); |
| 253 | |
| 254 | LOGI("OpenGL informations:"); |
| 255 | LOGI("vendor : %s", extensions.getVendor()); |
| 256 | LOGI("renderer : %s", extensions.getRenderer()); |
| 257 | LOGI("version : %s", extensions.getVersion()); |
| 258 | LOGI("extensions: %s", extensions.getExtension()); |
| 259 | LOGI("GL_MAX_TEXTURE_SIZE = %d", mMaxTextureSize); |
| 260 | LOGI("GL_MAX_VIEWPORT_DIMS = %d", mMaxViewportDims); |
| 261 | LOGI("flags = %08x", mFlags); |
| 262 | |
| 263 | // Unbind the context from this thread |
| 264 | eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | /* |
| 268 | * Clean up. Throw out our local state. |
| 269 | * |
| 270 | * (It's entirely possible we'll never get here, since this is meant |
| 271 | * for real hardware, which doesn't restart.) |
| 272 | */ |
| 273 | |
| 274 | void DisplayHardware::fini() |
| 275 | { |
| 276 | eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); |
| 277 | eglTerminate(mDisplay); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 278 | overlay_control_close(mOverlayEngine); |
| 279 | } |
| 280 | |
| 281 | void DisplayHardware::releaseScreen() const |
| 282 | { |
| 283 | DisplayHardwareBase::releaseScreen(); |
| 284 | } |
| 285 | |
| 286 | void DisplayHardware::acquireScreen() const |
| 287 | { |
| 288 | DisplayHardwareBase::acquireScreen(); |
| 289 | } |
| 290 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 291 | uint32_t DisplayHardware::getPageFlipCount() const { |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 292 | return mPageFlipCount; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 293 | } |
| 294 | |
Mathias Agopian | 74faca2 | 2009-09-17 16:18:16 -0700 | [diff] [blame] | 295 | status_t DisplayHardware::compositionComplete() const { |
| 296 | return mNativeWindow->compositionComplete(); |
| 297 | } |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 298 | |
| 299 | void DisplayHardware::flip(const Region& dirty) const |
| 300 | { |
| 301 | checkGLErrors(); |
| 302 | |
| 303 | EGLDisplay dpy = mDisplay; |
| 304 | EGLSurface surface = mSurface; |
| 305 | |
Mathias Agopian | 5e78e09 | 2009-06-11 17:19:54 -0700 | [diff] [blame] | 306 | #ifdef EGL_ANDROID_swap_rectangle |
Mathias Agopian | df3ca30 | 2009-05-04 19:29:25 -0700 | [diff] [blame] | 307 | if (mFlags & SWAP_RECTANGLE) { |
Mathias Agopian | b8a5560 | 2009-06-26 19:06:36 -0700 | [diff] [blame] | 308 | const Region newDirty(dirty.intersect(bounds())); |
| 309 | const Rect b(newDirty.getBounds()); |
Mathias Agopian | df3ca30 | 2009-05-04 19:29:25 -0700 | [diff] [blame] | 310 | eglSetSwapRectangleANDROID(dpy, surface, |
| 311 | b.left, b.top, b.width(), b.height()); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 312 | } |
Mathias Agopian | 5e78e09 | 2009-06-11 17:19:54 -0700 | [diff] [blame] | 313 | #endif |
| 314 | |
Mathias Agopian | 95a666b | 2009-09-24 14:57:26 -0700 | [diff] [blame] | 315 | if (mFlags & PARTIAL_UPDATES) { |
Mathias Agopian | 29d06ac | 2009-06-29 18:49:56 -0700 | [diff] [blame] | 316 | mNativeWindow->setUpdateRectangle(dirty.getBounds()); |
Mathias Agopian | 1e16b13 | 2009-05-07 17:40:23 -0700 | [diff] [blame] | 317 | } |
| 318 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 319 | mPageFlipCount++; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 320 | eglSwapBuffers(dpy, surface); |
| 321 | checkEGLErrors("eglSwapBuffers"); |
| 322 | |
| 323 | // for debugging |
| 324 | //glClearColor(1,0,0,0); |
| 325 | //glClear(GL_COLOR_BUFFER_BIT); |
| 326 | } |
| 327 | |
| 328 | uint32_t DisplayHardware::getFlags() const |
| 329 | { |
| 330 | return mFlags; |
| 331 | } |
| 332 | |
| 333 | void DisplayHardware::makeCurrent() const |
| 334 | { |
| 335 | eglMakeCurrent(mDisplay, mSurface, mSurface, mContext); |
| 336 | } |