remove libagl's dependency on gralloc_priv.h

This commit is contained in:
Mathias Agopian
2009-07-15 18:53:32 -07:00
parent f3ea3e0968
commit a2fb72e08f
4 changed files with 8 additions and 23 deletions

View File

@@ -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\"

View File

@@ -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;
}

View File

@@ -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;
}
}

View File

@@ -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