Loading include/private/opengles/gl_context.h +3 −1 Original line number Original line Diff line number Diff line Loading @@ -32,6 +32,8 @@ #include <GLES/gl.h> #include <GLES/gl.h> #include <GLES/glext.h> #include <GLES/glext.h> struct android_native_buffer_t; namespace android { namespace android { const unsigned int OGLES_NUM_COMPRESSED_TEXTURE_FORMATS = 10; const unsigned int OGLES_NUM_COMPRESSED_TEXTURE_FORMATS = 10; Loading Loading @@ -602,7 +604,7 @@ struct copybits_context_t { copybit_device_t* blitEngine; copybit_device_t* blitEngine; int32_t minScale; int32_t minScale; int32_t maxScale; int32_t maxScale; buffer_handle_t drawSurfaceBuffer; android_native_buffer_t* drawSurfaceBuffer; }; }; struct ogles_context_t { struct ogles_context_t { Loading include/ui/GraphicBuffer.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -93,6 +93,8 @@ public: void setIndex(int index); void setIndex(int index); int getIndex() const; int getIndex() const; void setVerticalStride(uint32_t vstride); uint32_t getVerticalStride() const; protected: protected: GraphicBuffer(const Parcel& reply); GraphicBuffer(const Parcel& reply); Loading libs/surfaceflinger/LayerBuffer.cpp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -444,6 +444,8 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const GraphicBuffer::USAGE_HW_TEXTURE, GraphicBuffer::USAGE_HW_TEXTURE, src.img.w, src.img.handle, false); src.img.w, src.img.handle, false); graphicBuffer->setVerticalStride(src.img.h); err = mLayer.initializeEglImage(graphicBuffer, &mTexture); err = mLayer.initializeEglImage(graphicBuffer, &mTexture); } } #endif #endif Loading libs/ui/GraphicBuffer.cpp +8 −0 Original line number Original line Diff line number Diff line Loading @@ -226,6 +226,14 @@ int GraphicBuffer::getIndex() const { return mIndex; return mIndex; } } void GraphicBuffer::setVerticalStride(uint32_t vstride) { mVStride = vstride; } uint32_t GraphicBuffer::getVerticalStride() const { return mVStride; } // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- }; // namespace android }; // namespace android opengl/libagl/copybit.cpp +18 −7 Original line number Original line Diff line number Diff line Loading @@ -46,13 +46,24 @@ namespace android { static void textureToCopyBitImage( static void textureToCopyBitImage( const GGLSurface* surface, int32_t opFormat, 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->w = surface->stride; img->h = surface->height; img->h = vstride ? vstride : surface->height; img->format = opFormat; img->format = opFormat; img->base = surface->data; img->base = surface->data; img->handle = (native_handle_t *)buffer; img->handle = (native_handle_t *)buffer->handle; } } struct clipRectRegion : public copybit_region_t { struct clipRectRegion : public copybit_region_t { Loading Loading @@ -279,8 +290,8 @@ static bool copybit(GLint x, GLint y, copybit_device_t* copybit = c->copybits.blitEngine; copybit_device_t* copybit = c->copybits.blitEngine; copybit_image_t src; copybit_image_t src; buffer_handle_t source_hnd = textureObject->buffer->handle; textureToCopyBitImage(&textureObject->surface, opFormat, textureToCopyBitImage(&textureObject->surface, opFormat, source_hnd, &src); textureObject->buffer, &src); copybit_rect_t srect = { Ucr, Vcr + Hcr, Ucr + Wcr, Vcr }; copybit_rect_t srect = { Ucr, Vcr + Hcr, Ucr + Wcr, Vcr }; /* /* Loading Loading @@ -360,8 +371,8 @@ static bool copybit(GLint x, GLint y, } } copybit_image_t dst; copybit_image_t dst; buffer_handle_t target_hnd = c->copybits.drawSurfaceBuffer; textureToCopyBitImage(&cbSurface, cbSurface.format, textureToCopyBitImage(&cbSurface, cbSurface.format, target_hnd, &dst); c->copybits.drawSurfaceBuffer, &dst); copybit_rect_t drect = {x, y, x+w, y+h}; copybit_rect_t drect = {x, y, x+w, y+h}; Loading Loading
include/private/opengles/gl_context.h +3 −1 Original line number Original line Diff line number Diff line Loading @@ -32,6 +32,8 @@ #include <GLES/gl.h> #include <GLES/gl.h> #include <GLES/glext.h> #include <GLES/glext.h> struct android_native_buffer_t; namespace android { namespace android { const unsigned int OGLES_NUM_COMPRESSED_TEXTURE_FORMATS = 10; const unsigned int OGLES_NUM_COMPRESSED_TEXTURE_FORMATS = 10; Loading Loading @@ -602,7 +604,7 @@ struct copybits_context_t { copybit_device_t* blitEngine; copybit_device_t* blitEngine; int32_t minScale; int32_t minScale; int32_t maxScale; int32_t maxScale; buffer_handle_t drawSurfaceBuffer; android_native_buffer_t* drawSurfaceBuffer; }; }; struct ogles_context_t { struct ogles_context_t { Loading
include/ui/GraphicBuffer.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -93,6 +93,8 @@ public: void setIndex(int index); void setIndex(int index); int getIndex() const; int getIndex() const; void setVerticalStride(uint32_t vstride); uint32_t getVerticalStride() const; protected: protected: GraphicBuffer(const Parcel& reply); GraphicBuffer(const Parcel& reply); Loading
libs/surfaceflinger/LayerBuffer.cpp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -444,6 +444,8 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const GraphicBuffer::USAGE_HW_TEXTURE, GraphicBuffer::USAGE_HW_TEXTURE, src.img.w, src.img.handle, false); src.img.w, src.img.handle, false); graphicBuffer->setVerticalStride(src.img.h); err = mLayer.initializeEglImage(graphicBuffer, &mTexture); err = mLayer.initializeEglImage(graphicBuffer, &mTexture); } } #endif #endif Loading
libs/ui/GraphicBuffer.cpp +8 −0 Original line number Original line Diff line number Diff line Loading @@ -226,6 +226,14 @@ int GraphicBuffer::getIndex() const { return mIndex; return mIndex; } } void GraphicBuffer::setVerticalStride(uint32_t vstride) { mVStride = vstride; } uint32_t GraphicBuffer::getVerticalStride() const { return mVStride; } // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- }; // namespace android }; // namespace android
opengl/libagl/copybit.cpp +18 −7 Original line number Original line Diff line number Diff line Loading @@ -46,13 +46,24 @@ namespace android { static void textureToCopyBitImage( static void textureToCopyBitImage( const GGLSurface* surface, int32_t opFormat, 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->w = surface->stride; img->h = surface->height; img->h = vstride ? vstride : surface->height; img->format = opFormat; img->format = opFormat; img->base = surface->data; img->base = surface->data; img->handle = (native_handle_t *)buffer; img->handle = (native_handle_t *)buffer->handle; } } struct clipRectRegion : public copybit_region_t { struct clipRectRegion : public copybit_region_t { Loading Loading @@ -279,8 +290,8 @@ static bool copybit(GLint x, GLint y, copybit_device_t* copybit = c->copybits.blitEngine; copybit_device_t* copybit = c->copybits.blitEngine; copybit_image_t src; copybit_image_t src; buffer_handle_t source_hnd = textureObject->buffer->handle; textureToCopyBitImage(&textureObject->surface, opFormat, textureToCopyBitImage(&textureObject->surface, opFormat, source_hnd, &src); textureObject->buffer, &src); copybit_rect_t srect = { Ucr, Vcr + Hcr, Ucr + Wcr, Vcr }; copybit_rect_t srect = { Ucr, Vcr + Hcr, Ucr + Wcr, Vcr }; /* /* Loading Loading @@ -360,8 +371,8 @@ static bool copybit(GLint x, GLint y, } } copybit_image_t dst; copybit_image_t dst; buffer_handle_t target_hnd = c->copybits.drawSurfaceBuffer; textureToCopyBitImage(&cbSurface, cbSurface.format, textureToCopyBitImage(&cbSurface, cbSurface.format, target_hnd, &dst); c->copybits.drawSurfaceBuffer, &dst); copybit_rect_t drect = {x, y, x+w, y+h}; copybit_rect_t drect = {x, y, x+w, y+h}; Loading