00001 #ifndef SkBlitRow_DEFINED 00002 #define SkBlitRow_DEFINED 00003 00004 #include "SkBitmap.h" 00005 #include "SkColor.h" 00006 00007 class SkBlitRow { 00008 public: 00009 enum Flags16 { 00011 kGlobalAlpha_Flag = 0x01, 00013 kSrcPixelAlpha_Flag = 0x02, 00015 kDither_Flag = 0x04 00016 }; 00017 00028 typedef void (*Proc)(uint16_t* SK_RESTRICT dst, 00029 const SkPMColor* SK_RESTRICT src, 00030 int count, U8CPU alpha, int x, int y); 00031 00033 static Proc Factory(unsigned flags, SkBitmap::Config); 00034 00036 00037 enum Flags32 { 00038 kGlobalAlpha_Flag32 = 1 << 0, 00039 kSrcPixelAlpha_Flag32 = 1 << 1, 00040 }; 00041 00048 typedef void (*Proc32)(uint32_t* SK_RESTRICT dst, 00049 const SkPMColor* SK_RESTRICT src, 00050 int count, U8CPU alpha); 00051 00052 static Proc32 Factory32(unsigned flags32); 00053 00058 static void Color32(SkPMColor dst[], const SkPMColor src[], int count, 00059 SkPMColor color); 00060 00064 static void Color32(SkPMColor row[], int count, SkPMColor color) { 00065 Color32(row, row, count, color); 00066 } 00067 00068 private: 00069 enum { 00070 kFlags16_Mask = 7, 00071 kFlags32_Mask = 3 00072 }; 00077 static const Proc gPlatform_565_Procs[]; 00078 static const Proc gPlatform_4444_Procs[]; 00079 static const Proc32 gPlatform_Procs32[]; 00080 }; 00081 00082 #endif