aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBlitRow.h
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-07-30 02:22:31 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-07-30 02:22:31 +0000
commit7d2e322beeb9361f93a7983193bdf20ac972d341 (patch)
treef1663ffd71979fbb71291e4cfc9984b70c1946f1 /src/core/SkBlitRow.h
parentb6137c3139b1b1da99ad9f6c28ac0d9e8f910ff6 (diff)
add optimization table for blitproc functions
git-svn-id: http://skia.googlecode.com/svn/trunk@295 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkBlitRow.h')
-rw-r--r--src/core/SkBlitRow.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/core/SkBlitRow.h b/src/core/SkBlitRow.h
index bb6a29b829..473c925b4d 100644
--- a/src/core/SkBlitRow.h
+++ b/src/core/SkBlitRow.h
@@ -7,16 +7,38 @@
class SkBlitRow {
public:
enum {
+ //! If set, the alpha parameter will be != 255
kGlobalAlpha_Flag = 0x01,
+ //! If set, the src colors may have alpha != 255
kSrcPixelAlpha_Flag = 0x02,
+ //! If set, the resulting 16bit colors should be dithered
kDither_Flag = 0x04
};
+ /** Function pointer that reads a scanline of src SkPMColors, and writes
+ a corresponding scanline of 16bit colors (specific format based on the
+ config passed to the Factory.
+
+ The x,y params are useful just for dithering
+
+ @param alpha A global alpha to be applied to all of the src colors
+ @param x The x coordinate of the beginning of the scanline
+ @param y THe y coordinate of the scanline
+ */
typedef void (*Proc)(uint16_t* SK_RESTRICT dst,
const SkPMColor* SK_RESTRICT src,
int count, U8CPU alpha, int x, int y);
+ //! Public entry-point to return a blit function ptr
static Proc Factory(unsigned flags, SkBitmap::Config);
+
+private:
+ /** These global arrays are indexed using the flags parameterr to Factory,
+ and contain either NULL, or a platform-specific function-ptr to be used
+ in place of the system default.
+ */
+ static const Proc gPlatform_565_Procs[];
+ static const Proc gPlatform_4444_Procs[];
};
#endif