Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: include/core/SkBlitRow.h

Issue 959873002: Clean up ColorRectProc plumbing. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simpler, platform procs specialize anyway Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkBlitRow_D32.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 19 matching lines...) Expand all
30 30
31 @param alpha A global alpha to be applied to all of the src colors 31 @param alpha A global alpha to be applied to all of the src colors
32 @param x The x coordinate of the beginning of the scanline 32 @param x The x coordinate of the beginning of the scanline
33 @param y THe y coordinate of the scanline 33 @param y THe y coordinate of the scanline
34 */ 34 */
35 typedef void (*Proc16)(uint16_t dst[], const SkPMColor src[], int count, 35 typedef void (*Proc16)(uint16_t dst[], const SkPMColor src[], int count,
36 U8CPU alpha, int x, int y); 36 U8CPU alpha, int x, int y);
37 37
38 static Proc16 Factory16(unsigned flags); 38 static Proc16 Factory16(unsigned flags);
39 39
40 /** 40 /**
41 * Function pointer that blends a single src color onto a scaline of dst co lors. 41 * Function pointer that blends a single src color onto a scaline of dst co lors.
42 * 42 *
43 * The x,y params provide the dithering phase for the start of the scanline 43 * The x,y params provide the dithering phase for the start of the scanline
44 */ 44 */
45 typedef void (*ColorProc16)(uint16_t dst[], SkPMColor src, int count, int x, int y); 45 typedef void (*ColorProc16)(uint16_t dst[], SkPMColor src, int count, int x, int y);
46 46
47 // Note : we ignore the kGlobalAlpha_Flag setting, but do respect kSrcPixelA lpha_Flag 47 // Note : we ignore the kGlobalAlpha_Flag setting, but do respect kSrcPixelA lpha_Flag
48 static ColorProc16 ColorFactory16(unsigned flags); 48 static ColorProc16 ColorFactory16(unsigned flags);
49 49
50 ///////////// D32 version 50 ///////////// D32 version
(...skipping 20 matching lines...) Expand all
71 71
72 /** 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
73 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
74 if they are not, they may not overlap. 74 if they are not, they may not overlap.
75 */ 75 */
76 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);
77 77
78 //! Public entry-point to return a blit function ptr 78 //! Public entry-point to return a blit function ptr
79 static ColorProc ColorProcFactory(); 79 static ColorProc ColorProcFactory();
80 80
81 /** Function pointer that blends a single color onto a 32-bit rectangle. */
82 typedef void (*ColorRectProc)(SkPMColor dst[], int width, int height,
83 size_t rowBytes, SkPMColor color);
84
85 /** Blend a single color into a rectangle of D32 pixels. */
86 static void ColorRect32(SkPMColor dst[], int width, int height,
87 size_t rowBytes, SkPMColor color);
88
89 //! Public entry-point to return a blit function ptr
90 static ColorRectProc ColorRectProcFactory();
91
92 /** These static functions are called by the Factory and Factory32 81 /** These static functions are called by the Factory and Factory32
93 functions, and should return either NULL, or a 82 functions, and should return either NULL, or a
94 platform-specific function-ptr to be used in place of the 83 platform-specific function-ptr to be used in place of the
95 system default. 84 system default.
96 */ 85 */
97 86
98 static Proc32 PlatformProcs32(unsigned flags); 87 static Proc32 PlatformProcs32(unsigned flags);
99 static ColorProc PlatformColorProc(); 88 static ColorProc PlatformColorProc();
100 89
101 static Proc16 PlatformFactory565(unsigned flags); 90 static Proc16 PlatformFactory565(unsigned flags);
102 static ColorProc16 PlatformColorFactory565(unsigned flags); 91 static ColorProc16 PlatformColorFactory565(unsigned flags);
103 92
104 private: 93 private:
105 enum { 94 enum {
106 kFlags16_Mask = 7, 95 kFlags16_Mask = 7,
107 kFlags32_Mask = 3 96 kFlags32_Mask = 3
108 }; 97 };
109 }; 98 };
110 99
111 #endif 100 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkBlitRow_D32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698