| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "SkUtils.h" | 8 #include "SkUtils.h" |
| 9 | 9 |
| 10 #if DSTSIZE==32 | 10 #if DSTSIZE==32 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 const uint32_t* SK_RESTRICT xy, | 35 const uint32_t* SK_RESTRICT xy, |
| 36 int count, DSTTYPE* SK_RESTRICT colors); | 36 int count, DSTTYPE* SK_RESTRICT colors); |
| 37 void MAKENAME(_filter_DXDY)(const SkBitmapProcState& s, | 37 void MAKENAME(_filter_DXDY)(const SkBitmapProcState& s, |
| 38 const uint32_t* SK_RESTRICT xy, | 38 const uint32_t* SK_RESTRICT xy, |
| 39 int count, DSTTYPE* SK_RESTRICT colors); | 39 int count, DSTTYPE* SK_RESTRICT colors); |
| 40 | 40 |
| 41 void MAKENAME(_nofilter_DXDY)(const SkBitmapProcState& s, | 41 void MAKENAME(_nofilter_DXDY)(const SkBitmapProcState& s, |
| 42 const uint32_t* SK_RESTRICT xy, | 42 const uint32_t* SK_RESTRICT xy, |
| 43 int count, DSTTYPE* SK_RESTRICT colors) { | 43 int count, DSTTYPE* SK_RESTRICT colors) { |
| 44 SkASSERT(count > 0 && colors != NULL); | 44 SkASSERT(count > 0 && colors != NULL); |
| 45 SkASSERT(SkBitmapProcState::kNone_BitmapFilter == s.fFilterQuality); | 45 SkASSERT(SkPaint::kNone_FilterLevel == s.fFilterLevel); |
| 46 SkDEBUGCODE(CHECKSTATE(s);) | 46 SkDEBUGCODE(CHECKSTATE(s);) |
| 47 | 47 |
| 48 #ifdef PREAMBLE | 48 #ifdef PREAMBLE |
| 49 PREAMBLE(s); | 49 PREAMBLE(s); |
| 50 #endif | 50 #endif |
| 51 const char* SK_RESTRICT srcAddr = (const char*)s.fBitmap->getPixels(); | 51 const char* SK_RESTRICT srcAddr = (const char*)s.fBitmap->getPixels(); |
| 52 size_t rb = s.fBitmap->rowBytes(); | 52 size_t rb = s.fBitmap->rowBytes(); |
| 53 | 53 |
| 54 uint32_t XY; | 54 uint32_t XY; |
| 55 SRCTYPE src; | 55 SRCTYPE src; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 78 #ifdef POSTAMBLE | 78 #ifdef POSTAMBLE |
| 79 POSTAMBLE(s); | 79 POSTAMBLE(s); |
| 80 #endif | 80 #endif |
| 81 } | 81 } |
| 82 | 82 |
| 83 void MAKENAME(_nofilter_DX)(const SkBitmapProcState& s, | 83 void MAKENAME(_nofilter_DX)(const SkBitmapProcState& s, |
| 84 const uint32_t* SK_RESTRICT xy, | 84 const uint32_t* SK_RESTRICT xy, |
| 85 int count, DSTTYPE* SK_RESTRICT colors) { | 85 int count, DSTTYPE* SK_RESTRICT colors) { |
| 86 SkASSERT(count > 0 && colors != NULL); | 86 SkASSERT(count > 0 && colors != NULL); |
| 87 SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)); | 87 SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)); |
| 88 SkASSERT(SkBitmapProcState::kNone_BitmapFilter == s.fFilterQuality); | 88 SkASSERT(SkPaint::kNone_FilterLevel == s.fFilterLevel); |
| 89 SkDEBUGCODE(CHECKSTATE(s);) | 89 SkDEBUGCODE(CHECKSTATE(s);) |
| 90 | 90 |
| 91 #ifdef PREAMBLE | 91 #ifdef PREAMBLE |
| 92 PREAMBLE(s); | 92 PREAMBLE(s); |
| 93 #endif | 93 #endif |
| 94 const SRCTYPE* SK_RESTRICT srcAddr = (const SRCTYPE*)s.fBitmap->getPixels(); | 94 const SRCTYPE* SK_RESTRICT srcAddr = (const SRCTYPE*)s.fBitmap->getPixels(); |
| 95 | 95 |
| 96 // buffer is y32, x16, x16, x16, x16, x16 | 96 // buffer is y32, x16, x16, x16, x16, x16 |
| 97 // bump srcAddr to the proper row, since we're told Y never changes | 97 // bump srcAddr to the proper row, since we're told Y never changes |
| 98 SkASSERT((unsigned)xy[0] < (unsigned)s.fBitmap->height()); | 98 SkASSERT((unsigned)xy[0] < (unsigned)s.fBitmap->height()); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 POSTAMBLE(s); | 132 POSTAMBLE(s); |
| 133 #endif | 133 #endif |
| 134 } | 134 } |
| 135 | 135 |
| 136 /////////////////////////////////////////////////////////////////////////////// | 136 /////////////////////////////////////////////////////////////////////////////// |
| 137 | 137 |
| 138 void MAKENAME(_filter_DX)(const SkBitmapProcState& s, | 138 void MAKENAME(_filter_DX)(const SkBitmapProcState& s, |
| 139 const uint32_t* SK_RESTRICT xy, | 139 const uint32_t* SK_RESTRICT xy, |
| 140 int count, DSTTYPE* SK_RESTRICT colors) { | 140 int count, DSTTYPE* SK_RESTRICT colors) { |
| 141 SkASSERT(count > 0 && colors != NULL); | 141 SkASSERT(count > 0 && colors != NULL); |
| 142 SkASSERT(s.fFilterQuality != SkBitmapProcState::kNone_BitmapFilter); | 142 SkASSERT(s.fFilterLevel != SkPaint::kNone_FilterLevel); |
| 143 SkDEBUGCODE(CHECKSTATE(s);) | 143 SkDEBUGCODE(CHECKSTATE(s);) |
| 144 | 144 |
| 145 #ifdef PREAMBLE | 145 #ifdef PREAMBLE |
| 146 PREAMBLE(s); | 146 PREAMBLE(s); |
| 147 #endif | 147 #endif |
| 148 const char* SK_RESTRICT srcAddr = (const char*)s.fBitmap->getPixels(); | 148 const char* SK_RESTRICT srcAddr = (const char*)s.fBitmap->getPixels(); |
| 149 size_t rb = s.fBitmap->rowBytes(); | 149 size_t rb = s.fBitmap->rowBytes(); |
| 150 unsigned subY; | 150 unsigned subY; |
| 151 const SRCTYPE* SK_RESTRICT row0; | 151 const SRCTYPE* SK_RESTRICT row0; |
| 152 const SRCTYPE* SK_RESTRICT row1; | 152 const SRCTYPE* SK_RESTRICT row1; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 178 } while (--count != 0); | 178 } while (--count != 0); |
| 179 | 179 |
| 180 #ifdef POSTAMBLE | 180 #ifdef POSTAMBLE |
| 181 POSTAMBLE(s); | 181 POSTAMBLE(s); |
| 182 #endif | 182 #endif |
| 183 } | 183 } |
| 184 void MAKENAME(_filter_DXDY)(const SkBitmapProcState& s, | 184 void MAKENAME(_filter_DXDY)(const SkBitmapProcState& s, |
| 185 const uint32_t* SK_RESTRICT xy, | 185 const uint32_t* SK_RESTRICT xy, |
| 186 int count, DSTTYPE* SK_RESTRICT colors) { | 186 int count, DSTTYPE* SK_RESTRICT colors) { |
| 187 SkASSERT(count > 0 && colors != NULL); | 187 SkASSERT(count > 0 && colors != NULL); |
| 188 SkASSERT(s.fFilterQuality != SkBitmapProcState::kNone_BitmapFilter); | 188 SkASSERT(s.fFilterLevel != SkPaint::kNone_FilterLevel); |
| 189 SkDEBUGCODE(CHECKSTATE(s);) | 189 SkDEBUGCODE(CHECKSTATE(s);) |
| 190 | 190 |
| 191 #ifdef PREAMBLE | 191 #ifdef PREAMBLE |
| 192 PREAMBLE(s); | 192 PREAMBLE(s); |
| 193 #endif | 193 #endif |
| 194 const char* SK_RESTRICT srcAddr = (const char*)s.fBitmap->getPixels(); | 194 const char* SK_RESTRICT srcAddr = (const char*)s.fBitmap->getPixels(); |
| 195 size_t rb = s.fBitmap->rowBytes(); | 195 size_t rb = s.fBitmap->rowBytes(); |
| 196 | 196 |
| 197 do { | 197 do { |
| 198 uint32_t data = *xy++; | 198 uint32_t data = *xy++; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 #ifdef POSTAMBLE | 239 #ifdef POSTAMBLE |
| 240 #undef POSTAMBLE | 240 #undef POSTAMBLE |
| 241 #endif | 241 #endif |
| 242 | 242 |
| 243 #undef FILTER_PROC_TYPE | 243 #undef FILTER_PROC_TYPE |
| 244 #undef GET_FILTER_TABLE | 244 #undef GET_FILTER_TABLE |
| 245 #undef GET_FILTER_ROW | 245 #undef GET_FILTER_ROW |
| 246 #undef GET_FILTER_ROW_PROC | 246 #undef GET_FILTER_ROW_PROC |
| 247 #undef GET_FILTER_PROC | 247 #undef GET_FILTER_PROC |
| 248 #undef BITMAPPROC_MEMSET | 248 #undef BITMAPPROC_MEMSET |
| OLD | NEW |