| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkBlitRow_DEFINED | 8 #ifndef SkBlitRow_DEFINED |
| 9 #define SkBlitRow_DEFINED | 9 #define SkBlitRow_DEFINED |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 /** Function pointer that blends 32bit colors onto a 32bit destination. | 57 /** Function pointer that blends 32bit colors onto a 32bit destination. |
| 58 @param dst array of dst 32bit colors | 58 @param dst array of dst 32bit colors |
| 59 @param src array of src 32bit colors (w/ or w/o alpha) | 59 @param src array of src 32bit colors (w/ or w/o alpha) |
| 60 @param count number of colors to blend | 60 @param count number of colors to blend |
| 61 @param alpha global alpha to be applied to all src colors | 61 @param alpha global alpha to be applied to all src colors |
| 62 */ | 62 */ |
| 63 typedef void (*Proc32)(uint32_t dst[], const SkPMColor src[], int count, U8C
PU alpha); | 63 typedef void (*Proc32)(uint32_t dst[], const SkPMColor src[], int count, U8C
PU alpha); |
| 64 | 64 |
| 65 static Proc32 Factory32(unsigned flags32); | 65 static Proc32 Factory32(unsigned flags32); |
| 66 | 66 |
| 67 /** Function pointer that blends a single color with a row of 32-bit colors |
| 68 onto a 32-bit destination |
| 69 */ |
| 70 typedef void (*ColorProc)(SkPMColor dst[], const SkPMColor src[], int count,
SkPMColor color); |
| 71 |
| 67 /** Blend a single color onto a row of S32 pixels, writing the result | 72 /** Blend a single color onto a row of S32 pixels, writing the result |
| 68 into a row of D32 pixels. src and dst may be the same memory, but | 73 into a row of D32 pixels. src and dst may be the same memory, but |
| 69 if they are not, they may not overlap. | 74 if they are not, they may not overlap. |
| 70 */ | 75 */ |
| 71 static void Color32(SkPMColor dst[], const SkPMColor src[], int count, SkPMC
olor color); | 76 static void Color32(SkPMColor dst[], const SkPMColor src[], int count, SkPMC
olor color); |
| 72 | 77 |
| 78 //! Public entry-point to return a blit function ptr |
| 79 static ColorProc ColorProcFactory(); |
| 80 |
| 73 /** These static functions are called by the Factory and Factory32 | 81 /** These static functions are called by the Factory and Factory32 |
| 74 functions, and should return either NULL, or a | 82 functions, and should return either NULL, or a |
| 75 platform-specific function-ptr to be used in place of the | 83 platform-specific function-ptr to be used in place of the |
| 76 system default. | 84 system default. |
| 77 */ | 85 */ |
| 78 | 86 |
| 79 static Proc32 PlatformProcs32(unsigned flags); | 87 static Proc32 PlatformProcs32(unsigned flags); |
| 88 static ColorProc PlatformColorProc(); |
| 80 | 89 |
| 81 static Proc16 PlatformFactory565(unsigned flags); | 90 static Proc16 PlatformFactory565(unsigned flags); |
| 82 static ColorProc16 PlatformColorFactory565(unsigned flags); | 91 static ColorProc16 PlatformColorFactory565(unsigned flags); |
| 83 | 92 |
| 84 private: | 93 private: |
| 85 enum { | 94 enum { |
| 86 kFlags16_Mask = 7, | 95 kFlags16_Mask = 7, |
| 87 kFlags32_Mask = 3 | 96 kFlags32_Mask = 3 |
| 88 }; | 97 }; |
| 89 }; | 98 }; |
| 90 | 99 |
| 91 #endif | 100 #endif |
| OLD | NEW |