From f9b7c71dcb7e4da11ba1fa03f71464f5f62efd9c Mon Sep 17 00:00:00 2001 From: Teng-Hui Zhu Date: Mon, 20 Jun 2011 14:24:59 -0700 Subject: Copied into Surface Texture line by line instead of pixel by pixel. Change-Id: Ide38fce4ba0be0eb506cb4c5497915e11812b6bd --- Source/WebCore/platform/graphics/android/GLUtils.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Source/WebCore/platform/graphics/android/GLUtils.cpp b/Source/WebCore/platform/graphics/android/GLUtils.cpp index a7ddbbd..29608cf 100644 --- a/Source/WebCore/platform/graphics/android/GLUtils.cpp +++ b/Source/WebCore/platform/graphics/android/GLUtils.cpp @@ -418,14 +418,11 @@ void GLUtils::updateSurfaceTextureWithBitmap(TextureInfo* texture, int x, int y, bitmap.lockPixels(); uint8_t* bitmapOrigin = static_cast(bitmap.getPixels()); - - // Copied pixel by pixel since we need to handle the offsets and stride. + // Copied line by line since we need to handle the offsets and stride. for (row = 0 ; row < bitmap.height(); row ++) { - for (col = 0 ; col < bitmap.width(); col ++) { - uint8_t* dst = &(img[(buf->getStride() * (row + x) + (col + y)) * bpp]); - uint8_t* src = &(bitmapOrigin[(bitmap.width() * row + col) * bpp]); - memcpy(dst, src, bpp); - } + uint8_t* dst = &(img[(buf->getStride() * (row + x) + y) * bpp]); + uint8_t* src = &(bitmapOrigin[bitmap.width() * row * bpp]); + memcpy(dst, src, bpp * bitmap.width()); } bitmap.unlockPixels(); } -- cgit v1.1