diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2011-06-20 14:24:59 -0700 |
---|---|---|
committer | Teng-Hui Zhu <ztenghui@google.com> | 2011-06-20 14:30:41 -0700 |
commit | f9b7c71dcb7e4da11ba1fa03f71464f5f62efd9c (patch) | |
tree | 7d39f3caf68922fc928baad4fbf4f6cfc3e33a82 | |
parent | 0a04cffc0086c1a1282618121dd63fcbce5fcc51 (diff) | |
download | external_webkit-f9b7c71dcb7e4da11ba1fa03f71464f5f62efd9c.zip external_webkit-f9b7c71dcb7e4da11ba1fa03f71464f5f62efd9c.tar.gz external_webkit-f9b7c71dcb7e4da11ba1fa03f71464f5f62efd9c.tar.bz2 |
Copied into Surface Texture line by line instead of pixel by pixel.
Change-Id: Ide38fce4ba0be0eb506cb4c5497915e11812b6bd
-rw-r--r-- | Source/WebCore/platform/graphics/android/GLUtils.cpp | 11 |
1 files 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<uint8_t*>(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(); } |