summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2011-09-08 09:40:28 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-08 09:40:28 -0700
commitcbc4e72fe1d9522411cacae1f71b443229865e7b (patch)
tree6b0ead1858e55a186cb6fdd079cf635d9396f773 /Source/WebCore/platform
parentbd46ce51b0f1d7af8a543961df3799e4d9aab4ed (diff)
parent971c16ea709cb4f93e0327431ea27a920d5ad1d2 (diff)
downloadexternal_webkit-cbc4e72fe1d9522411cacae1f71b443229865e7b.zip
external_webkit-cbc4e72fe1d9522411cacae1f71b443229865e7b.tar.gz
external_webkit-cbc4e72fe1d9522411cacae1f71b443229865e7b.tar.bz2
Merge "The CPU code path for uploading the textures"
Diffstat (limited to 'Source/WebCore/platform')
-rw-r--r--Source/WebCore/platform/graphics/android/BaseTileTexture.h5
-rw-r--r--Source/WebCore/platform/graphics/android/TransferQueue.cpp9
2 files changed, 14 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseTileTexture.h b/Source/WebCore/platform/graphics/android/BaseTileTexture.h
index 9c94a53..c11ef95 100644
--- a/Source/WebCore/platform/graphics/android/BaseTileTexture.h
+++ b/Source/WebCore/platform/graphics/android/BaseTileTexture.h
@@ -34,6 +34,8 @@
class SkCanvas;
+#define DEBUG_TRANSFER_USING_CPU_UPLOAD 0
+
namespace WebCore {
class BaseTile;
@@ -86,6 +88,9 @@ public:
TransferItemStatus status;
BaseTile* savedBaseTilePtr;
TextureTileInfo tileInfo;
+#if DEBUG_TRANSFER_USING_CPU_UPLOAD
+ SkBitmap bitmap;
+#endif
};
// DoubleBufferedTexture using a SkBitmap as backing mechanism
diff --git a/Source/WebCore/platform/graphics/android/TransferQueue.cpp b/Source/WebCore/platform/graphics/android/TransferQueue.cpp
index b73f388..a13474a 100644
--- a/Source/WebCore/platform/graphics/android/TransferQueue.cpp
+++ b/Source/WebCore/platform/graphics/android/TransferQueue.cpp
@@ -260,9 +260,15 @@ void TransferQueue::updateDirtyBaseTiles()
continue;
}
+#if DEBUG_TRANSFER_USING_CPU_UPLOAD
+ // Here we just need to upload the bitmap content to the GL Texture
+ GLUtils::updateTextureWithBitmap(destTexture->m_ownTextureId, 0, 0,
+ m_transferQueue[index].bitmap);
+#else
blitTileFromQueue(m_fboID, destTexture,
m_sharedSurfaceTextureId,
m_sharedSurfaceTexture->getCurrentTextureTarget());
+#endif
// After the base tile copied into the GL texture, we need to
// update the texture's info such that at draw time, readyFor
@@ -336,6 +342,9 @@ void TransferQueue::updateQueueWithBitmap(const TileRenderInfo* renderInfo,
m_transferQueueItemLocks.lock();
// b) After update the Surface Texture, now udpate the transfer queue info.
addItemInTransferQueue(renderInfo);
+#if DEBUG_TRANSFER_USING_CPU_UPLOAD
+ bitmap.copyTo(&(m_transferQueue[m_transferQueueIndex].bitmap), bitmap.config());
+#endif
m_transferQueueItemLocks.unlock();
XLOG("Bitmap updated x, y %d %d, baseTile %p",
renderInfo->x, renderInfo->y, renderInfo->baseTile);