diff options
author | Mathias Agopian <mathias@google.com> | 2009-08-12 21:24:53 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-08-12 21:24:53 -0700 |
commit | 42fd8050ba2dafe0a697fb5a6929ba086ce80426 (patch) | |
tree | 38a8806a8042a67a87113d59f4e700f9fb667b30 /libs/surfaceflinger | |
parent | 88e3e6bd04dcf166ddd92ce3a84e1f9f54ac2f66 (diff) | |
download | frameworks_base-42fd8050ba2dafe0a697fb5a6929ba086ce80426.zip frameworks_base-42fd8050ba2dafe0a697fb5a6929ba086ce80426.tar.gz frameworks_base-42fd8050ba2dafe0a697fb5a6929ba086ce80426.tar.bz2 |
make sure EGL_ANDROID_swap_rectangle is actually supported before using it
Diffstat (limited to 'libs/surfaceflinger')
-rw-r--r-- | libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp index ecd1202..3f607f6 100644 --- a/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp +++ b/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp @@ -166,9 +166,17 @@ void DisplayHardware::init(uint32_t dpy) } } + eglQuerySurface(display, surface, EGL_WIDTH, &mWidth); + eglQuerySurface(display, surface, EGL_HEIGHT, &mHeight); + #ifdef EGL_ANDROID_swap_rectangle if (strstr(egl_extensions, "EGL_ANDROID_swap_rectangle")) { - mFlags |= SWAP_RECTANGLE; + if (eglSetSwapRectangleANDROID(display, surface, + 0, 0, mWidth, mHeight) == EGL_TRUE) { + // This could fail if this extension is not supported by this + // specific surface (of config) + mFlags |= SWAP_RECTANGLE; + } } // when we have the choice between UPDATE_ON_DEMAND and SWAP_RECTANGLE // choose UPDATE_ON_DEMAND, which is more efficient @@ -177,6 +185,8 @@ void DisplayHardware::init(uint32_t dpy) #endif + LOGI("flags : %08x", mFlags); + mDpiX = mNativeWindow->xdpi; mDpiY = mNativeWindow->ydpi; mRefreshRate = fbDev->fps; @@ -204,9 +214,6 @@ void DisplayHardware::init(uint32_t dpy) context = eglCreateContext(display, config, NULL, NULL); //checkEGLErrors("eglCreateContext"); - eglQuerySurface(display, surface, EGL_WIDTH, &mWidth); - eglQuerySurface(display, surface, EGL_HEIGHT, &mHeight); - /* * Gather OpenGL ES extensions |