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

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

Issue 1311583005: Add special case circle blur for Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix no-GPU build Created 5 years, 3 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 | « gyp/effects.gypi ('k') | include/core/SkMaskFilter.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 SkColorPriv_DEFINED 8 #ifndef SkColorPriv_DEFINED
9 #define SkColorPriv_DEFINED 9 #define SkColorPriv_DEFINED
10 10
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 static inline int SkAlphaBlend255(S16CPU src, S16CPU dst, U8CPU alpha) { 211 static inline int SkAlphaBlend255(S16CPU src, S16CPU dst, U8CPU alpha) {
212 SkASSERT((int16_t)src == src); 212 SkASSERT((int16_t)src == src);
213 SkASSERT((int16_t)dst == dst); 213 SkASSERT((int16_t)dst == dst);
214 SkASSERT((uint8_t)alpha == alpha); 214 SkASSERT((uint8_t)alpha == alpha);
215 215
216 int prod = (src - dst) * alpha + 128; 216 int prod = (src - dst) * alpha + 128;
217 prod = (prod + (prod >> 8)) >> 8; 217 prod = (prod + (prod >> 8)) >> 8;
218 return dst + prod; 218 return dst + prod;
219 } 219 }
220 220
221 static inline U8CPU SkUnitScalarClampToByte(SkScalar x) {
222 if (x < 0) {
223 return 0;
224 }
225 if (x >= SK_Scalar1) {
226 return 255;
227 }
228 return SkScalarToFixed(x) >> 8;
229 }
230
221 #define SK_R16_BITS 5 231 #define SK_R16_BITS 5
222 #define SK_G16_BITS 6 232 #define SK_G16_BITS 6
223 #define SK_B16_BITS 5 233 #define SK_B16_BITS 5
224 234
225 #define SK_R16_SHIFT (SK_B16_BITS + SK_G16_BITS) 235 #define SK_R16_SHIFT (SK_B16_BITS + SK_G16_BITS)
226 #define SK_G16_SHIFT (SK_B16_BITS) 236 #define SK_G16_SHIFT (SK_B16_BITS)
227 #define SK_B16_SHIFT 0 237 #define SK_B16_SHIFT 0
228 238
229 #define SK_R16_MASK ((1 << SK_R16_BITS) - 1) 239 #define SK_R16_MASK ((1 << SK_R16_BITS) - 1)
230 #define SK_G16_MASK ((1 << SK_G16_BITS) - 1) 240 #define SK_G16_MASK ((1 << SK_G16_BITS) - 1)
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 int srcG = SkColorGetG(src); 1053 int srcG = SkColorGetG(src);
1044 int srcB = SkColorGetB(src); 1054 int srcB = SkColorGetB(src);
1045 1055
1046 for (int i = 0; i < width; i++) { 1056 for (int i = 0; i < width; i++) {
1047 dst[i] = SkBlendLCD16Opaque(srcR, srcG, srcB, dst[i], mask[i], 1057 dst[i] = SkBlendLCD16Opaque(srcR, srcG, srcB, dst[i], mask[i],
1048 opaqueDst); 1058 opaqueDst);
1049 } 1059 }
1050 } 1060 }
1051 1061
1052 #endif 1062 #endif
OLDNEW
« no previous file with comments | « gyp/effects.gypi ('k') | include/core/SkMaskFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698