diff options
author | John Reck <jreck@google.com> | 2012-03-14 21:06:41 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2012-03-20 09:56:23 -0700 |
commit | a144ac64329978c258faadf3bc484cf4ae6c5d0d (patch) | |
tree | ebc3fdbea6ac1561330d4a94e67305aae495c6b7 /Source/WebCore/platform/graphics/android/TransferQueue.cpp | |
parent | 640bfa989e82aad4ff79ff786f31a6962c37d8fd (diff) | |
download | external_webkit-a144ac64329978c258faadf3bc484cf4ae6c5d0d.zip external_webkit-a144ac64329978c258faadf3bc484cf4ae6c5d0d.tar.gz external_webkit-a144ac64329978c258faadf3bc484cf4ae6c5d0d.tar.bz2 |
Canvas on a texture
Change-Id: I841b3e021298738c91701068992798a55290a520
Diffstat (limited to 'Source/WebCore/platform/graphics/android/TransferQueue.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/TransferQueue.cpp | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/Source/WebCore/platform/graphics/android/TransferQueue.cpp b/Source/WebCore/platform/graphics/android/TransferQueue.cpp index ac45112..8e41d15 100644 --- a/Source/WebCore/platform/graphics/android/TransferQueue.cpp +++ b/Source/WebCore/platform/graphics/android/TransferQueue.cpp @@ -463,33 +463,8 @@ bool TransferQueue::tryUpdateQueueWithBitmap(const TileRenderInfo* renderInfo, return false; } - ANativeWindow_Buffer buffer; - if (ANativeWindow_lock(m_ANW.get(), &buffer, 0)) + if (!GLUtils::updateSharedSurfaceTextureWithBitmap(m_ANW.get(), bitmap)) return false; - - uint8_t* img = (uint8_t*)buffer.bits; - int row; - int bpp = 4; // Now we only deal with RGBA8888 format. - int width = TilesManager::instance()->tileWidth(); - int height = TilesManager::instance()->tileHeight(); - if (bitmap.width() == width && bitmap.height() == height) { - bitmap.lockPixels(); - uint8_t* bitmapOrigin = static_cast<uint8_t*>(bitmap.getPixels()); - - if (buffer.stride != bitmap.width()) - // Copied line by line since we need to handle the offsets and stride. - for (row = 0 ; row < bitmap.height(); row ++) { - uint8_t* dst = &(img[buffer.stride * row * bpp]); - uint8_t* src = &(bitmapOrigin[bitmap.width() * row * bpp]); - memcpy(dst, src, bpp * bitmap.width()); - } - else - memcpy(img, bitmapOrigin, bpp * bitmap.width() * bitmap.height()); - - bitmap.unlockPixels(); - } - - ANativeWindow_unlockAndPost(m_ANW.get()); } // b) After update the Surface Texture, now udpate the transfer queue info. |