summaryrefslogtreecommitdiff
path: root/opengl/libagl/TextureObjectManager.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-05-04 14:17:04 -0700
committerMathias Agopian <mathias@google.com>2009-05-04 14:17:04 -0700
commitdff8e58d47ede6e748c0b02e128ca33b42a4f362 (patch)
tree716d70cda74aa625d6e67c4debc2eb7c6b81bfc9 /opengl/libagl/TextureObjectManager.cpp
parentfa6eda01a9f3df0102ce6a65302c8674cc9c7e50 (diff)
update surfaceflinger, libui and libagl to the new gralloc api
- Currently the lock/unlock path is naive and is done for each drawing operation (glDrawElements and glDrawArrays). this should be improved eventually. - factor all the lock/unlock code in SurfaceBuffer. - fixed "showupdate" so it works even when we don't have preserving eglSwapBuffers(). - improved the situation with the dirty-region and fixed a problem that caused GL apps to not update. - make use of LightRefBase() where needed, instead of duplicating its implementation - add LightRefBase::getStrongCount() - renamed EGLNativeWindowSurface.cpp to FramebufferNativeWindow.cpp - disabled copybits test, since it clashes with the new gralloc api - Camera/Video will be fixed later when we rework the overlay apis
Diffstat (limited to 'opengl/libagl/TextureObjectManager.cpp')
-rw-r--r--opengl/libagl/TextureObjectManager.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/opengl/libagl/TextureObjectManager.cpp b/opengl/libagl/TextureObjectManager.cpp
index f927de95ecae..9eb99f0bc231 100644
--- a/opengl/libagl/TextureObjectManager.cpp
+++ b/opengl/libagl/TextureObjectManager.cpp
@@ -23,7 +23,7 @@ namespace android {
// ----------------------------------------------------------------------------
EGLTextureObject::EGLTextureObject()
- : mCount(0), mSize(0)
+ : mSize(0)
{
init();
}
@@ -56,6 +56,7 @@ void EGLTextureObject::init()
#ifdef LIBAGL_USE_GRALLOC_COPYBITS
copybits_fd = -1;
#endif // LIBAGL_USE_GRALLOC_COPYBITS
+ buffer = 0;
}
void EGLTextureObject::copyParameters(const sp<EGLTextureObject>& old)
@@ -126,6 +127,7 @@ status_t EGLTextureObject::setSurface(GGLSurface const* s)
}
surface = *s;
internalformat = 0;
+ buffer = 0;
// we should keep the crop_rect, but it's delicate because
// the new size of the surface could make it invalid.
@@ -144,6 +146,20 @@ status_t EGLTextureObject::setSurface(GGLSurface const* s)
return NO_ERROR;
}
+status_t EGLTextureObject::setImage(android_native_buffer_t* native_buffer)
+{
+ GGLSurface sur;
+ sur.version = sizeof(GGLSurface);
+ sur.width = native_buffer->width;
+ sur.height= native_buffer->height;
+ sur.stride= native_buffer->stride;
+ sur.format= native_buffer->format;
+ sur.data = 0;
+ setSurface(&sur);
+ buffer = native_buffer;
+ return NO_ERROR;
+}
+
status_t EGLTextureObject::reallocate(
GLint level, int w, int h, int s,
int format, int compressedFormat, int bpr)
@@ -227,7 +243,7 @@ status_t EGLTextureObject::reallocate(
// ----------------------------------------------------------------------------
EGLSurfaceManager::EGLSurfaceManager()
- : TokenManager(), mCount(0)
+ : TokenManager()
{
}