Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(510)

Issue 3980041: SSE2 optimization for blitmask

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 8 months ago by yaojie.yan
Modified:
13 years, 6 months ago
Reviewers:
Stephen White, reed1
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

this improves the skia performance on SSE2-supporting platform. (please refer to below issues) Issue 2765043: SSE2 optimizations for 32bit Color operation 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 ARGB32 blitmask. Like above issues, it uses CPUID to detect for SSE2 and changes the platform procs at runtime as well. blitmask is very common operations for blend source image to a destination background. With the workload http://www.feedtank.com/labs/html_canvas/, SkARGB32_Blitter::blitMask() occupies (10-12)% cpu cycles of chrome (the performance data is from oprofile in Meego). this patch just focus on SkARGB32_Blitter, but it is extendable to other Blitter. 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 http://www.feedtank.com/labs/html_canvas/, the performance is improved by almost 6~8%.

Patch Set 1 #

Patch Set 2 : updated version to implement a completed framework for blitmask #

Patch Set 3 : new patch for 2nd review #

Total comments: 1

Patch Set 4 : upload a new patch diff from the recent code base, thanks #

Patch Set 5 : Minor changes to pass "full" rowBytes to the proc. Please provide your comments, thanks Reed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+315 lines, -13 lines) Patch
bench/RectBench.cpp View 1 2 3 4 4 chunks +110 lines, -0 lines 0 comments Download
include/core/SkBlitRow.h View 1 2 3 4 1 chunk +21 lines, -0 lines 0 comments Download
src/core/SkBlitRow_D32.cpp View 1 2 3 4 1 chunk +40 lines, -0 lines 0 comments Download
src/core/SkBlitter_ARGB32.cpp View 1 2 3 4 2 chunks +5 lines, -13 lines 0 comments Download
src/core/SkCoreBlitters.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
src/opts/SkBlitRow_opts_SSE2.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
src/opts/SkBlitRow_opts_SSE2.cpp View 1 2 3 4 1 chunk +97 lines, -0 lines 0 comments Download
src/opts/SkBlitRow_opts_arm.cpp View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
src/opts/SkBlitRow_opts_none.cpp View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
src/opts/opts_check_SSE2.cpp View 1 2 3 4 1 chunk +22 lines, -0 lines 0 comments Download

Messages

Total messages: 13
yaojie.yan
13 years, 8 months ago (2011-01-13 09:22:38 UTC) #1
reed1
trying out the patch...
13 years, 8 months ago (2011-01-17 16:13:39 UTC) #2
reed1
A good start, but a few issues. 1) need a more complete framework, to handle ...
13 years, 8 months ago (2011-01-17 18:29:28 UTC) #3
yaojie.yan
thanks for your good comments, and I am not familiar with Skia design mechanism, so ...
13 years, 8 months ago (2011-01-19 03:44:36 UTC) #4
yaojie.yan
updated version to implement a completed framework for blitmask
13 years, 8 months ago (2011-01-27 07:38:05 UTC) #5
yaojie.yan
Hi Reed, Thanks a lot for your comments! Could you please review this updated patch, ...
13 years, 8 months ago (2011-01-27 07:40:43 UTC) #6
reed1
I think we don't need/want to follow BlitRow's pattern of Proc and Proc32. That is ...
13 years, 7 months ago (2011-02-24 16:09:47 UTC) #7
reed1
ah, I see that you have TODOs for the other default implementations.
13 years, 7 months ago (2011-02-24 16:11:08 UTC) #8
yaojie.yan
Hi Reed, According to your comments, some changes are made in this version. It has ...
13 years, 7 months ago (2011-03-02 09:13:09 UTC) #9
yaojie.yan
new patch for 2nd review
13 years, 7 months ago (2011-03-02 09:16:05 UTC) #10
yaojie.yan
upload a new patch diff from the recent code base, thanks
13 years, 7 months ago (2011-03-07 09:47:30 UTC) #11
yaojie.yan
Minor changes to pass "full" rowBytes to the proc. Please provide your comments, thanks Reed
13 years, 7 months ago (2011-03-09 09:18:45 UTC) #12
reed1
13 years, 6 months ago (2011-03-18 21:04:34 UTC) #13
This has been committed.

http://codereview.appspot.com/3980041/diff/12001/include/core/SkBlitRow.h
File include/core/SkBlitRow.h (right):

http://codereview.appspot.com/3980041/diff/12001/include/core/SkBlitRow.h#new...
include/core/SkBlitRow.h:91: *  but each scanline is offset by dstRB (rowbytes)
and srcRB respectively.
The dstRB and maskRB should both be complete values, meaning they are the true
distance between rows. It looks like from SkBlitter_ARGB32.cpp, that you are
passing in the "leftover" amounts after taking into account the width. I know
that is what my original code did, but I think this new interface should not
specify that. The implementation can always perform that substract before its
loop.

Lets document this here, and update the call site and impls. (should be trivial)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b