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

Side by Side Diff: src/core/SkBitmapProcState_sample.h

Issue 1753903002: fission bitmapprocstate (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use real types instead of uint8_t, fix formatting Created 4 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 | « src/core/SkBitmapProcState_matrixProcs.cpp ('k') | src/core/SkBitmapProcState_shaderproc.h » ('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 #include "SkUtils.h" 8 #include "SkUtils.h"
9 9
10 // declare functions externally to suppress warnings. 10 // declare functions externally to suppress warnings.
11 void MAKENAME(_nofilter_DXDY)(const SkBitmapProcState& s, 11 void MAKENAME(_nofilter_DXDY)(const SkBitmapProcState& s,
12 const uint32_t* SK_RESTRICT xy, 12 const uint32_t* SK_RESTRICT xy,
13 int count, SkPMColor* SK_RESTRICT colors); 13 int count, SkPMColor* SK_RESTRICT colors);
14 void MAKENAME(_nofilter_DX)(const SkBitmapProcState& s, 14 void MAKENAME(_nofilter_DX)(const SkBitmapProcState& s,
15 const uint32_t* SK_RESTRICT xy, 15 const uint32_t* SK_RESTRICT xy,
16 int count, SkPMColor* SK_RESTRICT colors); 16 int count, SkPMColor* SK_RESTRICT colors);
17 void MAKENAME(_filter_DX)(const SkBitmapProcState& s, 17 void MAKENAME(_filter_DX)(const SkBitmapProcState& s,
18 const uint32_t* SK_RESTRICT xy, 18 const uint32_t* SK_RESTRICT xy,
19 int count, SkPMColor* SK_RESTRICT colors); 19 int count, SkPMColor* SK_RESTRICT colors);
20 void MAKENAME(_filter_DXDY)(const SkBitmapProcState& s, 20 void MAKENAME(_filter_DXDY)(const SkBitmapProcState& s,
21 const uint32_t* SK_RESTRICT xy, 21 const uint32_t* SK_RESTRICT xy,
22 int count, SkPMColor* SK_RESTRICT colors); 22 int count, SkPMColor* SK_RESTRICT colors);
23 23
24 void MAKENAME(_nofilter_DXDY)(const SkBitmapProcState& s, 24 void MAKENAME(_nofilter_DXDY)(const SkBitmapProcState& s,
25 const uint32_t* SK_RESTRICT xy, 25 const uint32_t* SK_RESTRICT xy,
26 int count, SkPMColor* SK_RESTRICT colors) { 26 int count, SkPMColor* SK_RESTRICT colors) {
27 SkASSERT(count > 0 && colors != nullptr); 27 SkASSERT(count > 0 && colors != nullptr);
28 SkASSERT(kNone_SkFilterQuality == s.fFilterLevel); 28 SkASSERT(kNone_SkFilterQuality == s.fFilterQuality);
29 SkDEBUGCODE(CHECKSTATE(s);) 29 SkDEBUGCODE(CHECKSTATE(s);)
30 30
31 #ifdef PREAMBLE 31 #ifdef PREAMBLE
32 PREAMBLE(s); 32 PREAMBLE(s);
33 #endif 33 #endif
34 const char* SK_RESTRICT srcAddr = (const char*)s.fPixmap.addr(); 34 const char* SK_RESTRICT srcAddr = (const char*)s.fPixmap.addr();
35 size_t rb = s.fPixmap.rowBytes(); 35 size_t rb = s.fPixmap.rowBytes();
36 36
37 uint32_t XY; 37 uint32_t XY;
38 SRCTYPE src; 38 SRCTYPE src;
(...skipping 22 matching lines...) Expand all
61 #ifdef POSTAMBLE 61 #ifdef POSTAMBLE
62 POSTAMBLE(s); 62 POSTAMBLE(s);
63 #endif 63 #endif
64 } 64 }
65 65
66 void MAKENAME(_nofilter_DX)(const SkBitmapProcState& s, 66 void MAKENAME(_nofilter_DX)(const SkBitmapProcState& s,
67 const uint32_t* SK_RESTRICT xy, 67 const uint32_t* SK_RESTRICT xy,
68 int count, SkPMColor* SK_RESTRICT colors) { 68 int count, SkPMColor* SK_RESTRICT colors) {
69 SkASSERT(count > 0 && colors != nullptr); 69 SkASSERT(count > 0 && colors != nullptr);
70 SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)); 70 SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask));
71 SkASSERT(kNone_SkFilterQuality == s.fFilterLevel); 71 SkASSERT(kNone_SkFilterQuality == s.fFilterQuality);
72 SkDEBUGCODE(CHECKSTATE(s);) 72 SkDEBUGCODE(CHECKSTATE(s);)
73 73
74 #ifdef PREAMBLE 74 #ifdef PREAMBLE
75 PREAMBLE(s); 75 PREAMBLE(s);
76 #endif 76 #endif
77 const SRCTYPE* SK_RESTRICT srcAddr = (const SRCTYPE*)s.fPixmap.addr(); 77 const SRCTYPE* SK_RESTRICT srcAddr = (const SRCTYPE*)s.fPixmap.addr();
78 78
79 // buffer is y32, x16, x16, x16, x16, x16 79 // buffer is y32, x16, x16, x16, x16, x16
80 // bump srcAddr to the proper row, since we're told Y never changes 80 // bump srcAddr to the proper row, since we're told Y never changes
81 SkASSERT((unsigned)xy[0] < (unsigned)s.fPixmap.height()); 81 SkASSERT((unsigned)xy[0] < (unsigned)s.fPixmap.height());
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 POSTAMBLE(s); 115 POSTAMBLE(s);
116 #endif 116 #endif
117 } 117 }
118 118
119 /////////////////////////////////////////////////////////////////////////////// 119 ///////////////////////////////////////////////////////////////////////////////
120 120
121 void MAKENAME(_filter_DX)(const SkBitmapProcState& s, 121 void MAKENAME(_filter_DX)(const SkBitmapProcState& s,
122 const uint32_t* SK_RESTRICT xy, 122 const uint32_t* SK_RESTRICT xy,
123 int count, SkPMColor* SK_RESTRICT colors) { 123 int count, SkPMColor* SK_RESTRICT colors) {
124 SkASSERT(count > 0 && colors != nullptr); 124 SkASSERT(count > 0 && colors != nullptr);
125 SkASSERT(s.fFilterLevel != kNone_SkFilterQuality); 125 SkASSERT(s.fFilterQuality != kNone_SkFilterQuality);
126 SkDEBUGCODE(CHECKSTATE(s);) 126 SkDEBUGCODE(CHECKSTATE(s);)
127 127
128 #ifdef PREAMBLE 128 #ifdef PREAMBLE
129 PREAMBLE(s); 129 PREAMBLE(s);
130 #endif 130 #endif
131 const char* SK_RESTRICT srcAddr = (const char*)s.fPixmap.addr(); 131 const char* SK_RESTRICT srcAddr = (const char*)s.fPixmap.addr();
132 size_t rb = s.fPixmap.rowBytes(); 132 size_t rb = s.fPixmap.rowBytes();
133 unsigned subY; 133 unsigned subY;
134 const SRCTYPE* SK_RESTRICT row0; 134 const SRCTYPE* SK_RESTRICT row0;
135 const SRCTYPE* SK_RESTRICT row1; 135 const SRCTYPE* SK_RESTRICT row1;
(...skipping 25 matching lines...) Expand all
161 } while (--count != 0); 161 } while (--count != 0);
162 162
163 #ifdef POSTAMBLE 163 #ifdef POSTAMBLE
164 POSTAMBLE(s); 164 POSTAMBLE(s);
165 #endif 165 #endif
166 } 166 }
167 void MAKENAME(_filter_DXDY)(const SkBitmapProcState& s, 167 void MAKENAME(_filter_DXDY)(const SkBitmapProcState& s,
168 const uint32_t* SK_RESTRICT xy, 168 const uint32_t* SK_RESTRICT xy,
169 int count, SkPMColor* SK_RESTRICT colors) { 169 int count, SkPMColor* SK_RESTRICT colors) {
170 SkASSERT(count > 0 && colors != nullptr); 170 SkASSERT(count > 0 && colors != nullptr);
171 SkASSERT(s.fFilterLevel != kNone_SkFilterQuality); 171 SkASSERT(s.fFilterQuality != kNone_SkFilterQuality);
172 SkDEBUGCODE(CHECKSTATE(s);) 172 SkDEBUGCODE(CHECKSTATE(s);)
173 173
174 #ifdef PREAMBLE 174 #ifdef PREAMBLE
175 PREAMBLE(s); 175 PREAMBLE(s);
176 #endif 176 #endif
177 const char* SK_RESTRICT srcAddr = (const char*)s.fPixmap.addr(); 177 const char* SK_RESTRICT srcAddr = (const char*)s.fPixmap.addr();
178 size_t rb = s.fPixmap.rowBytes(); 178 size_t rb = s.fPixmap.rowBytes();
179 179
180 do { 180 do {
181 uint32_t data = *xy++; 181 uint32_t data = *xy++;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 #endif 219 #endif
220 #ifdef POSTAMBLE 220 #ifdef POSTAMBLE
221 #undef POSTAMBLE 221 #undef POSTAMBLE
222 #endif 222 #endif
223 223
224 #undef FILTER_PROC_TYPE 224 #undef FILTER_PROC_TYPE
225 #undef GET_FILTER_TABLE 225 #undef GET_FILTER_TABLE
226 #undef GET_FILTER_ROW 226 #undef GET_FILTER_ROW
227 #undef GET_FILTER_ROW_PROC 227 #undef GET_FILTER_ROW_PROC
228 #undef GET_FILTER_PROC 228 #undef GET_FILTER_PROC
OLDNEW
« no previous file with comments | « src/core/SkBitmapProcState_matrixProcs.cpp ('k') | src/core/SkBitmapProcState_shaderproc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698