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