[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
jamesr at google.com
jamesr at google.com
Wed Dec 22 13:16:11 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit aec7b5959b4099163339db405b9e9bcfe3e2fa0d
Author: jamesr at google.com <jamesr at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Sep 10 02:44:59 2010 +0000
2010-09-09 James Robinson <jamesr at chromium.org>
Reviewed by Kenneth Russell.
[chromium] Clear only the uploaded portion of the software backing store when in mixed mode
https://bugs.webkit.org/show_bug.cgi?id=45503
This clears out only the dirty region of the software backing store when uploading results
to hardware rather than clearing out the entire software backing store. This is a significant
performance improvement when the dirty rects are small relative to the whole canvas.
This also implements the non-swizzle path of copySubRect() using memcpy() to copy the rows, which
is another respectable performance increase.
* html/canvas/CanvasRenderingContext2D.cpp:
* platform/graphics/gpu/Texture.cpp:
(WebCore::copySubRect):
* platform/graphics/skia/PlatformContextSkia.cpp:
(WebCore::PlatformContextSkia::prepareForSoftwareDraw):
(WebCore::PlatformContextSkia::uploadSoftwareToHardware):
(WebCore::PlatformContextSkia::readbackHardwareToSoftware):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a38418e..d29c0fa 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-09-09 James Robinson <jamesr at chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ [chromium] Clear only the uploaded portion of the software backing store when in mixed mode
+ https://bugs.webkit.org/show_bug.cgi?id=45503
+
+ This clears out only the dirty region of the software backing store when uploading results
+ to hardware rather than clearing out the entire software backing store. This is a significant
+ performance improvement when the dirty rects are small relative to the whole canvas.
+
+ This also implements the non-swizzle path of copySubRect() using memcpy() to copy the rows, which
+ is another respectable performance increase.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ * platform/graphics/gpu/Texture.cpp:
+ (WebCore::copySubRect):
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (WebCore::PlatformContextSkia::prepareForSoftwareDraw):
+ (WebCore::PlatformContextSkia::uploadSoftwareToHardware):
+ (WebCore::PlatformContextSkia::readbackHardwareToSoftware):
+
2010-09-09 Kenneth Russell <kbr at google.com>
Reviewed by James Robinson.
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
old mode 100644
new mode 100755
diff --git a/WebCore/platform/graphics/gpu/Texture.cpp b/WebCore/platform/graphics/gpu/Texture.cpp
index c2c3804..95436ba 100644
--- a/WebCore/platform/graphics/gpu/Texture.cpp
+++ b/WebCore/platform/graphics/gpu/Texture.cpp
@@ -124,15 +124,18 @@ static uint32_t* copySubRect(uint32_t* src, int srcX, int srcY, uint32_t* dst, i
if (!swizzle && width == srcStride)
return srcOffset;
- uint32_t* dstPixel = dst;
- for (int y = 0; y < height; y++) {
- for (int x = 0; x < width ; x++) {
- uint32_t pixel = srcOffset[x + y * srcStride];
- if (swizzle)
+ if (swizzle) {
+ uint32_t* dstPixel = dst;
+ for (int y = 0; y < height; ++y) {
+ for (int x = 0; x < width ; ++x) {
+ uint32_t pixel = srcOffset[x + y * srcStride];
*dstPixel = pixel & 0xFF00FF00 | ((pixel & 0x00FF0000) >> 16) | ((pixel & 0x000000FF) << 16);
- else
- *dstPixel = pixel;
- dstPixel++;
+ dstPixel++;
+ }
+ }
+ } else {
+ for (int y = 0; y < height; ++y) {
+ memcpy(dst + y * width, srcOffset + y * srcStride, 4 * width);
}
}
return dst;
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
old mode 100644
new mode 100755
index f0d6548..dfcbd9a
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -747,9 +747,7 @@ void PlatformContextSkia::prepareForSoftwareDraw() const
// of a compositing operation).
if (m_state->m_xferMode == SkXfermode::kSrcOver_Mode) {
- // Last drawn on hardware; clear out the canvas.
- m_canvas->getDevice()->eraseColor(0);
- // Start compositing into the empty canvas.
+ // Note that we have rendering results in both the hardware and software backing stores.
m_backingStoreState = Mixed;
} else {
readbackHardwareToSoftware();
@@ -830,6 +828,13 @@ void PlatformContextSkia::uploadSoftwareToHardware(CompositeOperator op) const
m_uploadTexture->updateSubRect(bitmap.getPixels(), m_softwareDirtyRect);
AffineTransform identity;
gpuCanvas()->drawTexturedRect(m_uploadTexture.get(), m_softwareDirtyRect, m_softwareDirtyRect, identity, 1.0, DeviceColorSpace, op);
+ // Clear out the region of the software canvas we just uploaded.
+ m_canvas->save();
+ m_canvas->resetMatrix();
+ SkRect bounds = m_softwareDirtyRect;
+ m_canvas->clipRect(bounds, SkRegion::kReplace_Op);
+ m_canvas->drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode);
+ m_canvas->restore();
m_softwareDirtyRect.setWidth(0); // Clear dirty rect.
}
@@ -855,6 +860,7 @@ void PlatformContextSkia::readbackHardwareToSoftware() const
}
}
}
+ m_softwareDirtyRect.unite(IntRect(0, 0, width, height)); // Mark everything as dirty.
}
} // namespace WebCore
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list