diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2010-12-13 15:27:20 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2010-12-13 15:27:20 +0000 |
commit | c3856384e4ab9a7ad5902696a5c972ab595b8467 (patch) | |
tree | 0025aae7299eb0025598d8a647b4479598941859 /include/core | |
parent | ec7a30cc8688923e0ccfff4c8f81c5e577c4c9ab (diff) |
SSE2 optimizations for 32bit Color operation.
[Patch from weiwei.li@intel.com]
SSE2 optimization has been added by Stephen White before, this improves the skia
performance on SSE2-supporting platform. (please refer to below issues)
Issue 171055: More SSE2ification
Issue 157141: More SSE2ification
Issue 150060: minor tweaks to SSE2 code for -fPIC
Issue 144072: SSE2 optimizations for 32bit blending blitters
This CL implements SSE2 optimizations for the 32bit Color operation. Like above
issues, it uses CPUID to detect for SSE2 and changes the platform procs at
runtime as well. The 32bit Color operation is heavily used on Chrome HTML5
canvas operations. Take Microsoft IE test drives Pulsating Bubbles as example
(http://ie.microsoft.com/testdrive/Performance/PulsatingBubbles/Default.xhtml),
if running this cases on Chrome, the overhead of 32bit Color operation is about
40~50%. So this CL will make skia performance more better, and also make Chrome
HTML5 canvas performance more better.
Additional, this CL has passed the skia bench & tests validation, the result is
pretty good. We also apply this CL to the latest chromium, and re-run Microsoft
IE test drives Pulsating Bubbles, the performance is improved by almost 9~10%.
git-svn-id: http://skia.googlecode.com/svn/trunk@633 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkBlitRow.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/core/SkBlitRow.h b/include/core/SkBlitRow.h index 7d48b0cadc..a592167f70 100644 --- a/include/core/SkBlitRow.h +++ b/include/core/SkBlitRow.h @@ -29,6 +29,12 @@ public: const SkPMColor* SK_RESTRICT src, int count, U8CPU alpha, int x, int y); + /** Function pointer that blends a single color with a row of 32-bit colors + onto a 32-bit destination + */ + typedef void (*ColorProc)(SkPMColor* dst, const SkPMColor* src, int count, + SkPMColor color); + //! Public entry-point to return a blit function ptr static Proc Factory(unsigned flags, SkBitmap::Config); @@ -49,6 +55,9 @@ public: const SkPMColor* SK_RESTRICT src, int count, U8CPU alpha); + static void Color32_BlitRow32(SkPMColor dst[], const SkPMColor src[], + int count, SkPMColor color); + static Proc32 Factory32(unsigned flags32); /** Blend a single color onto a row of S32 pixels, writing the result @@ -74,6 +83,7 @@ public: static Proc32 PlatformProcs32(unsigned flags); static Proc PlatformProcs565(unsigned flags); static Proc PlatformProcs4444(unsigned flags); + static ColorProc PlatformColorProc(); private: enum { |