summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp b/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
index 7206c98..32f353c 100644
--- a/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
@@ -418,10 +418,6 @@ bool GLUtils::skipTransferForPureColor(const TileRenderInfo* renderInfo,
bool skipTransfer = false;
Tile* tilePtr = renderInfo->baseTile;
- // TODO: use pure color for partial invals as well
- if (renderInfo->invalRect)
- return false;
-
if (tilePtr) {
TileTexture* tileTexture = tilePtr->backTexture();
// Check the bitmap, and make everything ready here.
@@ -611,6 +607,33 @@ void GLUtils::clearBackgroundIfOpaque(const Color* backgroundColor)
}
}
+bool GLUtils::deepCopyBitmapSubset(const SkBitmap& sourceBitmap,
+ SkBitmap& subset, int leftOffset, int topOffset)
+{
+ sourceBitmap.lockPixels();
+ subset.lockPixels();
+ char* srcPixels = (char*) sourceBitmap.getPixels();
+ char* dstPixels = (char*) subset.getPixels();
+ if (!dstPixels || !srcPixels || !subset.lockPixelsAreWritable()) {
+ ALOGD("no pixels :( %p, %p (writable=%d)", srcPixels, dstPixels,
+ subset.lockPixelsAreWritable());
+ subset.unlockPixels();
+ sourceBitmap.unlockPixels();
+ return false;
+ }
+ int srcRowSize = sourceBitmap.rowBytes();
+ int destRowSize = subset.rowBytes();
+ for (int i = 0; i < subset.height(); i++) {
+ int srcOffset = (i + topOffset) * srcRowSize;
+ srcOffset += (leftOffset * sourceBitmap.bytesPerPixel());
+ int dstOffset = i * destRowSize;
+ memcpy(dstPixels + dstOffset, srcPixels + srcOffset, destRowSize);
+ }
+ subset.unlockPixels();
+ sourceBitmap.unlockPixels();
+ return true;
+}
+
} // namespace WebCore
#endif // USE(ACCELERATED_COMPOSITING)