aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/DeferredCanvasTest.cpp
diff options
context:
space:
mode:
authorGravatar henrik.smiding <henrik.smiding@intel.com>2014-06-27 08:03:17 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-27 08:03:17 -0700
commit3bb195ef0d9691384027d7b61b0b8ef8379aaf5d (patch)
treef230b9c2bf5fb6b6309196c77f326a053110251e /tests/DeferredCanvasTest.cpp
parent982542dce8acbd2f3e7642268b21e76b93230daf (diff)
Add SSE4 optimization of S32A_Opaque_Blitrow
Adds optimization of Skia S32A_Opaque_Blitrow blitter using SSE4.2 SIMD instruction set. Special case for when alpha is zero or opaque. Performance increase of 10%-400% compared to the existing SSE2 optimization (measured on Silvermont architecture). Noticeable in ~25 different skia bench subtests, especially in bitmap_8888_*, repeatTile_*, and morph_*. bitmap_8888_A - 100% faster bitmap_8888_A_source_transparent - 250% faster bitmap_8888_A_source_opaque - 25% faster bitmap_8888_A_scale_bicubic - 75% faster Signed-off-by: Henrik Smiding <henrik.smiding@intel.com> Committed: https://skia.googlesource.com/skia/+/e2527b147679b0c43019fae7d59cc3777d2d097e Committed: https://skia.googlesource.com/skia/+/b5c281e1e06af3be804309877de1dac6145686b9 R=reed@google.com, mtklein@google.com, tomhudson@google.com, djsollen@google.com, joakim.landberg@intel.com Author: henrik.smiding@intel.com Review URL: https://codereview.chromium.org/289473009
Diffstat (limited to 'tests/DeferredCanvasTest.cpp')
-rw-r--r--tests/DeferredCanvasTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/DeferredCanvasTest.cpp b/tests/DeferredCanvasTest.cpp
index 747b23b9ab..8aaeaed5f3 100644
--- a/tests/DeferredCanvasTest.cpp
+++ b/tests/DeferredCanvasTest.cpp
@@ -487,6 +487,7 @@ static void TestDeferredCanvasMemoryLimit(skiatest::Reporter* reporter) {
SkBitmap sourceImage;
// 100 by 100 image, takes 40,000 bytes in memory
sourceImage.allocN32Pixels(100, 100);
+ sourceImage.eraseColor(SK_ColorGREEN);
for (int i = 0; i < 5; i++) {
sourceImage.notifyPixelsChanged(); // to force re-serialization
@@ -520,6 +521,7 @@ static void TestDeferredCanvasBitmapCaching(skiatest::Reporter* reporter) {
SkBitmap sourceImages[imageCount];
for (int i = 0; i < imageCount; i++) {
sourceImages[i].allocN32Pixels(100, 100);
+ sourceImages[i].eraseColor(SK_ColorGREEN);
}
size_t bitmapSize = sourceImages[0].getSize();
@@ -619,6 +621,7 @@ static void TestDeferredCanvasBitmapShaderNoLeak(skiatest::Reporter* reporter) {
SkPaint paint;
SkBitmap paintPattern;
paintPattern.allocN32Pixels(10, 10);
+ paintPattern.eraseColor(SK_ColorGREEN);
paint.setShader(SkNEW_ARGS(SkBitmapProcShader,
(paintPattern, SkShader::kClamp_TileMode, SkShader::kClamp_TileMode)))->unref();
canvas->drawPaint(paint);
@@ -647,6 +650,7 @@ static void TestDeferredCanvasBitmapSizeThreshold(skiatest::Reporter* reporter)
SkBitmap sourceImage;
// 100 by 100 image, takes 40,000 bytes in memory
sourceImage.allocN32Pixels(100, 100);
+ sourceImage.eraseColor(SK_ColorGREEN);
// 1 under : should not store the image
{