summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-07-15 18:53:32 -0700
committerMathias Agopian <mathias@google.com>2009-07-15 18:53:32 -0700
commita2fb72e08f41a67bbed534eb1035ba5bfc2df0e1 (patch)
tree2fb407fd0012f37cd7812aa4d8f4eae2291c2397 /opengl
parentf3ea3e09684c82016e13140d68019b968c793190 (diff)
downloadframeworks_base-a2fb72e08f41a67bbed534eb1035ba5bfc2df0e1.zip
frameworks_base-a2fb72e08f41a67bbed534eb1035ba5bfc2df0e1.tar.gz
frameworks_base-a2fb72e08f41a67bbed534eb1035ba5bfc2df0e1.tar.bz2
remove libagl's dependency on gralloc_priv.h
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libagl/Android.mk1
-rw-r--r--opengl/libagl/copybit.cpp3
-rw-r--r--opengl/libagl/egl.cpp13
-rw-r--r--opengl/libagl/texture.cpp14
4 files changed, 8 insertions, 23 deletions
diff --git a/opengl/libagl/Android.mk b/opengl/libagl/Android.mk
index d1ed82e..2522656 100644
--- a/opengl/libagl/Android.mk
+++ b/opengl/libagl/Android.mk
@@ -38,7 +38,6 @@ endif
ifeq ($(LIBAGL_USE_GRALLOC_COPYBITS),1)
LOCAL_CFLAGS += -DLIBAGL_USE_GRALLOC_COPYBITS
LOCAL_SRC_FILES += copybit.cpp
- LOCAL_C_INCLUDES += hardware/libhardware/modules/gralloc
endif
LOCAL_CFLAGS += -DLOG_TAG=\"libagl\"
diff --git a/opengl/libagl/copybit.cpp b/opengl/libagl/copybit.cpp
index 3331026..3c5bcdf 100644
--- a/opengl/libagl/copybit.cpp
+++ b/opengl/libagl/copybit.cpp
@@ -295,6 +295,9 @@ static bool copybit(GLint x, GLint y,
clipRectRegion it(c);
status_t err = copybit->stretch(copybit, &dst, &src, &drect, &srect, &it);
+ if (err != NO_ERROR) {
+ c->textures.tmu[0].texture->try_copybit = false;
+ }
return err == NO_ERROR ? true : false;
}
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp
index 6f6656a..7afcae7 100644
--- a/opengl/libagl/egl.cpp
+++ b/opengl/libagl/egl.cpp
@@ -48,10 +48,6 @@
#include "texture.h"
#include "matrix.h"
-#ifdef LIBAGL_USE_GRALLOC_COPYBITS
-#include "gralloc_priv.h"
-#endif // LIBAGL_USE_GRALLOC_COPYBITS
-
#undef NELEM
#define NELEM(x) (sizeof(x)/sizeof(*(x)))
@@ -622,11 +618,10 @@ EGLBoolean egl_window_surface_v2_t::bindDrawSurface(ogles_context_t* gl)
#ifdef LIBAGL_USE_GRALLOC_COPYBITS
gl->copybits.drawSurfaceBuffer = 0;
- if (supportedCopybitsDestinationFormat(buffer.format)) {
- buffer_handle_t handle = this->buffer->handle;
- if (handle != NULL) {
- private_handle_t* hand = private_handle_t::dynamicCast(handle);
- if (hand != NULL && hand->usesPhysicallyContiguousMemory()) {
+ if (gl->copybits.blitEngine != NULL) {
+ if (supportedCopybitsDestinationFormat(buffer.format)) {
+ buffer_handle_t handle = this->buffer->handle;
+ if (handle != NULL) {
gl->copybits.drawSurfaceBuffer = handle;
}
}
diff --git a/opengl/libagl/texture.cpp b/opengl/libagl/texture.cpp
index d767c31..4d3c2f4 100644
--- a/opengl/libagl/texture.cpp
+++ b/opengl/libagl/texture.cpp
@@ -27,7 +27,6 @@
#ifdef LIBAGL_USE_GRALLOC_COPYBITS
#include "copybit.h"
-#include "gralloc_priv.h"
#endif // LIBAGL_USE_GRALLOC_COPYBITS
namespace android {
@@ -1540,20 +1539,9 @@ void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
sp<EGLTextureObject> tex = getAndBindActiveTextureObject(c);
tex->setImage(native_buffer);
- /*
- * Here an implementation can retrieve the buffer_handle_t of this buffer
- * which gives it access to an arbitrary-defined kernel resource
- * (or anything else for that matter).
- * There needs to be an intimate knowledge between GLES and buffer_handle_t,
- * so make sure to validate the handle before using it.
- * Typically, buffer_handle_t comes from the gralloc HAL which is provided
- * by the implementor of GLES.
- *
- */
#ifdef LIBAGL_USE_GRALLOC_COPYBITS
tex->try_copybit = false;
- private_handle_t* hnd = private_handle_t::dynamicCast(native_buffer->handle);
- if (hnd && hnd->usesPhysicallyContiguousMemory()) {
+ if (c->copybits.blitEngine != NULL) {
tex->try_copybit = true;
}
#endif // LIBAGL_USE_GRALLOC_COPYBITS