diff options
author | 2012-03-19 13:49:50 +0000 | |
---|---|---|
committer | 2012-03-19 13:49:50 +0000 | |
commit | 8dd90a926a8660da2bacc7af149f4ac5b2e7c64c (patch) | |
tree | 98464f9b4f989508f0807355ffc74773a6a3a01a /include/core/SkBlitRow.h | |
parent | 26936d071f9e426e11db9a8cf67f5ce86e83feb1 (diff) |
(SSE2) acceleration for rectangular opaque erases.
15% speedup for rectangles < 31 px wide, 5% for larger.
http://codereview.appspot.com/5843050/
git-svn-id: http://skia.googlecode.com/svn/trunk@3423 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkBlitRow.h')
-rw-r--r-- | include/core/SkBlitRow.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/include/core/SkBlitRow.h b/include/core/SkBlitRow.h index fb62f5ab53..973ab4c02a 100644 --- a/include/core/SkBlitRow.h +++ b/include/core/SkBlitRow.h @@ -36,13 +36,6 @@ public: const SkPMColor* 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); ///////////// D32 version @@ -64,6 +57,12 @@ public: static Proc32 Factory32(unsigned flags32); + /** 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); + /** Blend a single color onto a row of S32 pixels, writing the result into a row of D32 pixels. src and dst may be the same memory, but if they are not, they may not overlap. @@ -71,8 +70,20 @@ public: static void Color32(SkPMColor dst[], const SkPMColor src[], int count, SkPMColor color); + //! Public entry-point to return a blit function ptr static ColorProc ColorProcFactory(); + /** Function pointer that blends a single color onto a 32-bit rectangle. */ + typedef void (*ColorRectProc)(SkPMColor* dst, int width, int height, + size_t rowBytes, SkPMColor color); + + /** Blend a single color into a rectangle of D32 pixels. */ + static void ColorRect32(SkPMColor* dst, int width, int height, + size_t rowBytes, SkPMColor color); + + //! Public entry-point to return a blit function ptr + static ColorRectProc ColorRectProcFactory(); + /** These static functions are called by the Factory and Factory32 functions, and should return either NULL, or a platform-specific function-ptr to be used in place of the |