[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 18:30:01 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 0458085cbfae51f7392c2ffca2de16d8a160843e
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Dec 13 09:11:59 2010 +0000
2010-12-13 Noel Gordon <noel.gordon at gmail.com>
Reviewed by Eric Seidel.
[chromium] Reduce canvas.toDataURL("image/jpeg") run-time cost by 10%
https://bugs.webkit.org/show_bug.cgi?id=50804
Follow on from r73173, unroll the SkUnPreMultiply::PMColorToColor() call
viz., compute the unpremultiplatcion in-place. This reduces the run-time
cost of jpeg encoding by 10-15% for my image test set.
No new tests: canvas.toDataURL() is covered by existing tests.
* platform/image-encoders/skia/JPEGImageEncoder.cpp:
(WebCore::preMultipliedBGRAtoRGB):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73890 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0fc895d..711b333 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-12-13 Noel Gordon <noel.gordon at gmail.com>
+
+ Reviewed by Eric Seidel.
+
+ [chromium] Reduce canvas.toDataURL("image/jpeg") run-time cost by 10%
+ https://bugs.webkit.org/show_bug.cgi?id=50804
+
+ Follow on from r73173, unroll the SkUnPreMultiply::PMColorToColor() call
+ viz., compute the unpremultiplatcion in-place. This reduces the run-time
+ cost of jpeg encoding by 10-15% for my image test set.
+
+ No new tests: canvas.toDataURL() is covered by existing tests.
+
+ * platform/image-encoders/skia/JPEGImageEncoder.cpp:
+ (WebCore::preMultipliedBGRAtoRGB):
+
2010-12-13 Helder Correia <helder at sencha.com>
Reviewed by Eric Seidel.
diff --git a/WebCore/platform/image-encoders/skia/JPEGImageEncoder.cpp b/WebCore/platform/image-encoders/skia/JPEGImageEncoder.cpp
index c04019d..d4e1481 100644
--- a/WebCore/platform/image-encoders/skia/JPEGImageEncoder.cpp
+++ b/WebCore/platform/image-encoders/skia/JPEGImageEncoder.cpp
@@ -34,6 +34,7 @@
#include "IntSize.h"
#include "SkBitmap.h"
#include "SkUnPreMultiply.h"
+#include "SkColorPriv.h"
extern "C" {
#include <stdio.h> // jpeglib.h needs stdio.h FILE
#include "jpeglib.h"
@@ -82,11 +83,19 @@ static void handleError(j_common_ptr common)
// be ignored? See bug http://webkit.org/b/40147.
void preMultipliedBGRAtoRGB(const SkPMColor* input, unsigned int pixels, unsigned char* output)
{
- while (pixels-- > 0) {
- SkColor unmultiplied = SkUnPreMultiply::PMColorToColor(*input++);
- *output++ = SkColorGetR(unmultiplied);
- *output++ = SkColorGetG(unmultiplied);
- *output++ = SkColorGetB(unmultiplied);
+ static const SkUnPreMultiply::Scale* scale = SkUnPreMultiply::GetScaleTable();
+
+ for (; pixels-- > 0; ++input) {
+ const unsigned alpha = SkGetPackedA32(*input);
+ if ((alpha != 0) && (alpha != 255)) {
+ *output++ = SkUnPreMultiply::ApplyScale(scale[alpha], SkGetPackedR32(*input));
+ *output++ = SkUnPreMultiply::ApplyScale(scale[alpha], SkGetPackedG32(*input));
+ *output++ = SkUnPreMultiply::ApplyScale(scale[alpha], SkGetPackedB32(*input));
+ } else {
+ *output++ = SkGetPackedR32(*input);
+ *output++ = SkGetPackedG32(*input);
+ *output++ = SkGetPackedB32(*input);
+ }
}
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list