summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/DisplayHardware
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-06-11 17:19:54 -0700
committerMathias Agopian <mathias@google.com>2009-06-11 17:19:54 -0700
commite19476214a2fe718c82461f54e6b56cee7faa5f4 (patch)
treee0b6501e4435552756aabbbf9c886f73752d7551 /libs/surfaceflinger/DisplayHardware
parent350d651706d8f484d9aeb539d491526f822fa84a (diff)
downloadframeworks_base-e19476214a2fe718c82461f54e6b56cee7faa5f4.zip
frameworks_base-e19476214a2fe718c82461f54e6b56cee7faa5f4.tar.gz
frameworks_base-e19476214a2fe718c82461f54e6b56cee7faa5f4.tar.bz2
protect ANDROID specific egl extension with #define
Diffstat (limited to 'libs/surfaceflinger/DisplayHardware')
-rw-r--r--libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp
index 52b0f68..3f19c85 100644
--- a/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp
+++ b/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp
@@ -199,7 +199,7 @@ void DisplayHardware::init(uint32_t dpy)
*/
surface = eglCreateWindowSurface(display, config, mNativeWindow.get(), NULL);
- checkEGLErrors("eglCreateDisplaySurfaceANDROID");
+ checkEGLErrors("eglCreateWindowSurface");
if (eglQuerySurface(display, surface, EGL_SWAP_BEHAVIOR, &dummy) == EGL_TRUE) {
if (dummy == EGL_BUFFER_PRESERVED) {
@@ -207,9 +207,11 @@ void DisplayHardware::init(uint32_t dpy)
}
}
+#ifdef EGL_ANDROID_swap_rectangle
if (strstr(egl_extensions, "EGL_ANDROID_swap_rectangle")) {
mFlags |= SWAP_RECTANGLE;
}
+#endif
mDpiX = mNativeWindow->xdpi;
mDpiX = mNativeWindow->ydpi;
@@ -309,6 +311,7 @@ void DisplayHardware::flip(const Region& dirty) const
EGLDisplay dpy = mDisplay;
EGLSurface surface = mSurface;
+#ifdef EGL_ANDROID_swap_rectangle
if (mFlags & SWAP_RECTANGLE) {
Region newDirty(dirty);
newDirty.andSelf(Rect(mWidth, mHeight));
@@ -316,7 +319,8 @@ void DisplayHardware::flip(const Region& dirty) const
eglSetSwapRectangleANDROID(dpy, surface,
b.left, b.top, b.width(), b.height());
}
-
+#endif
+
if (mFlags & UPDATE_ON_DEMAND) {
mNativeWindow->setUpdateRectangle(dirty.bounds());
}