diff options
author | Jamie Gennis <jgennis@google.com> | 2013-09-23 17:22:10 -0700 |
---|---|---|
committer | Jamie Gennis <jgennis@google.com> | 2013-10-02 17:34:35 +0000 |
commit | dbe9245e2e362b12e184cd33b9a27b0901f81244 (patch) | |
tree | 2ec66077c2872d9df9659eb71562cfeea556b902 /opengl | |
parent | 93573e91c22ba8329222c69cd7f099f5703fb444 (diff) | |
download | frameworks_native-dbe9245e2e362b12e184cd33b9a27b0901f81244.zip frameworks_native-dbe9245e2e362b12e184cd33b9a27b0901f81244.tar.gz frameworks_native-dbe9245e2e362b12e184cd33b9a27b0901f81244.tar.bz2 |
GLConsumer: start using EGL_ANDROID_image_crop
This change makes GLConsumer use the EGL_ANDROID_image_crop extension when
available on a device. The crop rectangle is passed to the EGL driver when
creating EGLImages, allowing the crop to be performed by the driver rather than
using the texture transform matrix.
Bug: 10897141
Change-Id: I63e9a5d5c85067376abc420e3639154468346311
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/include/EGL/eglext.h | 8 | ||||
-rw-r--r-- | opengl/libs/EGL/eglApi.cpp | 4 | ||||
-rw-r--r-- | opengl/specs/README | 6 |
3 files changed, 15 insertions, 3 deletions
diff --git a/opengl/include/EGL/eglext.h b/opengl/include/EGL/eglext.h index 6c505ed..3b2984a 100644 --- a/opengl/include/EGL/eglext.h +++ b/opengl/include/EGL/eglext.h @@ -494,6 +494,14 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC)(EGLDisplay dpy, #define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147 #endif +#ifndef EGL_ANDROID_image_crop +#define EGL_ANDROID_image_crop 1 +#define EGL_IMAGE_CROP_LEFT_ANDROID 0x3148 +#define EGL_IMAGE_CROP_TOP_ANDROID 0x3149 +#define EGL_IMAGE_CROP_RIGHT_ANDROID 0x314A +#define EGL_IMAGE_CROP_BOTTOM_ANDROID 0x314B +#endif + #ifndef EGL_ANDROID_blob_cache #define EGL_ANDROID_blob_cache 1 typedef khronos_ssize_t EGLsizeiANDROID; diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index 04d5f45..0cc5265 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -99,6 +99,7 @@ extern char const * const gExtensionString = "EGL_NV_system_time " "EGL_ANDROID_image_native_buffer " // mandatory "EGL_KHR_wait_sync " // strongly recommended + "EGL_ANDROID_recordable " // mandatory ; // extensions not exposed to applications but used by the ANDROID system @@ -106,8 +107,7 @@ extern char const * const gExtensionString = // "EGL_IMG_hibernate_process " // optional // "EGL_ANDROID_native_fence_sync " // strongly recommended // "EGL_ANDROID_framebuffer_target " // mandatory for HWC 1.1 -// "EGL_ANDROID_recordable " // mandatory - +// "EGL_ANDROID_image_crop " // optional /* * EGL Extensions entry-points exposed to 3rd party applications diff --git a/opengl/specs/README b/opengl/specs/README index eb86869..f4de1b3 100644 --- a/opengl/specs/README +++ b/opengl/specs/README @@ -14,4 +14,8 @@ for use by Android extensions. 0x3145 EGL_SYNC_NATIVE_FENCE_FD_ANDROID (EGL_ANDROID_native_fence_sync) 0x3146 EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID (EGL_ANDROID_native_fence_sync) 0x3147 EGL_FRAMEBUFFER_TARGET_ANDROID (EGL_ANDROID_framebuffer_target) -0x3148 - 0x314F (unused) +0x3148 EGL_IMAGE_CROP_LEFT_ANDROID (EGL_ANDROID_image_crop) +0x3149 EGL_IMAGE_CROP_TOP_ANDROID (EGL_ANDROID_image_crop) +0x314A EGL_IMAGE_CROP_RIGHT_ANDROID (EGL_ANDROID_image_crop) +0x314B EGL_IMAGE_CROP_BOTTOM_ANDROID (EGL_ANDROID_image_crop) +0x314C - 0x314F (unused) |