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

Side by Side Diff: src/effects/SkLumaXfermode.cpp

Issue 23453004: Update SkLumaMaskXfermode partial coverage handling. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Always lerp to dst. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 2013 Google Inc. 2 * Copyright 2013 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 "SkLumaXfermode.h" 8 #include "SkLumaXfermode.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkFlattenableBuffers.h" 10 #include "SkFlattenableBuffers.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 int count, const SkAlpha aa[]) const { 69 int count, const SkAlpha aa[]) const {
70 const SkPMColor* a = lumaOpA<SkPMColor>(fMode, src, dst); 70 const SkPMColor* a = lumaOpA<SkPMColor>(fMode, src, dst);
71 const SkPMColor* b = lumaOpB<SkPMColor>(fMode, src, dst); 71 const SkPMColor* b = lumaOpB<SkPMColor>(fMode, src, dst);
72 72
73 if (aa) { 73 if (aa) {
74 for (int i = 0; i < count; ++i) { 74 for (int i = 0; i < count; ++i) {
75 unsigned cov = aa[i]; 75 unsigned cov = aa[i];
76 if (cov) { 76 if (cov) {
77 unsigned resC = luma_proc(a[i], b[i]); 77 unsigned resC = luma_proc(a[i], b[i]);
78 if (cov < 255) { 78 if (cov < 255) {
79 resC = SkAlphaMulQ(resC, SkAlpha255To256(cov)); 79 resC = SkFastFourByteInterp256(resC, dst[i],
80 SkAlpha255To256(cov));
80 } 81 }
81 dst[i] = resC; 82 dst[i] = resC;
82 } 83 }
83 } 84 }
84 } else { 85 } else {
85 for (int i = 0; i < count; ++i) { 86 for (int i = 0; i < count; ++i) {
86 dst[i] = luma_proc(a[i], b[i]); 87 dst[i] = luma_proc(a[i], b[i]);
87 } 88 }
88 } 89 }
89 } 90 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 // No background texture support. 213 // No background texture support.
213 if (effect && !background) { 214 if (effect && !background) {
214 *effect = GrLumaMaskEffect::Create(fMode); 215 *effect = GrLumaMaskEffect::Create(fMode);
215 return true; 216 return true;
216 } 217 }
217 218
218 return false; 219 return false;
219 } 220 }
220 221
221 #endif // SK_SUPPORT_GPU 222 #endif // SK_SUPPORT_GPU
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698