diff options
author | Mathias Agopian <mathias@google.com> | 2009-11-03 09:33:22 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-11-03 09:33:22 -0800 |
commit | b87e3eb933b4bd8556cd969a222881515b47a356 (patch) | |
tree | 86f72b68c3d86d7eb814525166f51e9bed0e81a8 /opengl | |
parent | f93cf369648b80addb57d637ae952eccaf0efcb4 (diff) | |
parent | 8637759a1d34a4adda292579d5f8790587659235 (diff) | |
download | frameworks_base-b87e3eb933b4bd8556cd969a222881515b47a356.zip frameworks_base-b87e3eb933b4bd8556cd969a222881515b47a356.tar.gz frameworks_base-b87e3eb933b4bd8556cd969a222881515b47a356.tar.bz2 |
am 8637759a: Merge change I36d0184e into eclair
Merge commit '8637759a1d34a4adda292579d5f8790587659235' into eclair-plus-aosp
* commit '8637759a1d34a4adda292579d5f8790587659235':
fix[2228133] pixelflinger ignores the "vertical stride" leading to artifacts when playing back video
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/libagl/copybit.cpp | 25 | ||||
-rw-r--r-- | opengl/libagl/egl.cpp | 2 |
2 files changed, 19 insertions, 8 deletions
diff --git a/opengl/libagl/copybit.cpp b/opengl/libagl/copybit.cpp index 3de5b2b..1bef859 100644 --- a/opengl/libagl/copybit.cpp +++ b/opengl/libagl/copybit.cpp @@ -46,13 +46,24 @@ namespace android { static void textureToCopyBitImage( const GGLSurface* surface, int32_t opFormat, - buffer_handle_t buffer, copybit_image_t* img) + android_native_buffer_t* buffer, copybit_image_t* img) { + uint32_t vstride = 0; + if (opFormat == COPYBIT_FORMAT_YCbCr_422_SP || + opFormat == COPYBIT_FORMAT_YCbCr_420_SP) { + // NOTE: this static_cast is really not safe b/c we can't know for + // sure the buffer passed is of the right type. + // However, since we do this only for YUV formats, we should be safe + // since only SurfaceFlinger makes use of them. + GraphicBuffer* graphicBuffer = static_cast<GraphicBuffer*>(buffer); + vstride = graphicBuffer->getVerticalStride(); + } + img->w = surface->stride; - img->h = surface->height; + img->h = vstride ? vstride : surface->height; img->format = opFormat; img->base = surface->data; - img->handle = (native_handle_t *)buffer; + img->handle = (native_handle_t *)buffer->handle; } struct clipRectRegion : public copybit_region_t { @@ -279,8 +290,8 @@ static bool copybit(GLint x, GLint y, copybit_device_t* copybit = c->copybits.blitEngine; copybit_image_t src; - buffer_handle_t source_hnd = textureObject->buffer->handle; - textureToCopyBitImage(&textureObject->surface, opFormat, source_hnd, &src); + textureToCopyBitImage(&textureObject->surface, opFormat, + textureObject->buffer, &src); copybit_rect_t srect = { Ucr, Vcr + Hcr, Ucr + Wcr, Vcr }; /* @@ -360,8 +371,8 @@ static bool copybit(GLint x, GLint y, } copybit_image_t dst; - buffer_handle_t target_hnd = c->copybits.drawSurfaceBuffer; - textureToCopyBitImage(&cbSurface, cbSurface.format, target_hnd, &dst); + textureToCopyBitImage(&cbSurface, cbSurface.format, + c->copybits.drawSurfaceBuffer, &dst); copybit_rect_t drect = {x, y, x+w, y+h}; diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index d04900e..80ddc02 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -651,7 +651,7 @@ EGLBoolean egl_window_surface_v2_t::bindDrawSurface(ogles_context_t* gl) if (supportedCopybitsDestinationFormat(buffer.format)) { buffer_handle_t handle = this->buffer->handle; if (handle != NULL) { - gl->copybits.drawSurfaceBuffer = handle; + gl->copybits.drawSurfaceBuffer = this->buffer; } } } |