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

Side by Side Diff: src/core/SkXfermode.cpp

Issue 101623007: Fixed more issues (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
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 8
9 9
10 #include "SkXfermode.h" 10 #include "SkXfermode.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 setSaturationComponents(g, b, r, s); 461 setSaturationComponents(g, b, r, s);
462 } else { 462 } else {
463 setSaturationComponents(b, g, r, s); 463 setSaturationComponents(b, g, r, s);
464 } 464 }
465 } 465 }
466 466
467 static inline void clipColor(int* r, int* g, int* b, int a) { 467 static inline void clipColor(int* r, int* g, int* b, int a) {
468 int L = Lum(*r, *g, *b); 468 int L = Lum(*r, *g, *b);
469 int n = minimum(*r, *g, *b); 469 int n = minimum(*r, *g, *b);
470 int x = maximum(*r, *g, *b); 470 int x = maximum(*r, *g, *b);
471 if(n < 0) { 471 if((n < 0) && (n = L - n)) { // Store denom in 'n' and make sure it's non ze ro
Stephen White 2013/12/09 21:16:12 Mike (or Florin? not sure who wrote this) should p
reed1 2013/12/09 21:20:49 I don't know who wrote this. For readability, I'd
fmalita_google_do_not_use 2013/12/09 21:29:12 FWIW, this was added by Rik (https://chromiumcoder
472 *r = L + SkMulDiv(*r - L, L, L - n); 472 *r = L + SkMulDiv(*r - L, L, n);
473 *g = L + SkMulDiv(*g - L, L, L - n); 473 *g = L + SkMulDiv(*g - L, L, n);
474 *b = L + SkMulDiv(*b - L, L, L - n); 474 *b = L + SkMulDiv(*b - L, L, n);
475 } 475 }
476 476
477 if (x > a) { 477 if ((x > a) && (x = x - L)) { // Store denom in 'x' and make sure it's non z ero
478 *r = L + SkMulDiv(*r - L, a - L, x - L); 478 n = a - L; // Store numer in 'n'
479 *g = L + SkMulDiv(*g - L, a - L, x - L); 479 *r = L + SkMulDiv(*r - L, n, x);
480 *b = L + SkMulDiv(*b - L, a - L, x - L); 480 *g = L + SkMulDiv(*g - L, n, x);
481 *b = L + SkMulDiv(*b - L, n, x);
481 } 482 }
482 } 483 }
483 484
484 static inline void SetLum(int* r, int* g, int* b, int a, int l) { 485 static inline void SetLum(int* r, int* g, int* b, int a, int l) {
485 int d = l - Lum(*r, *g, *b); 486 int d = l - Lum(*r, *g, *b);
486 *r += d; 487 *r += d;
487 *g += d; 488 *g += d;
488 *b += d; 489 *b += d;
489 490
490 clipColor(r, g, b, a); 491 clipColor(r, g, b, a);
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after
1968 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) 1969 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode)
1969 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) 1970 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode)
1970 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkClearXfermode) 1971 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkClearXfermode)
1971 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSrcXfermode) 1972 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSrcXfermode)
1972 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstInXfermode) 1973 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstInXfermode)
1973 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstOutXfermode) 1974 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstOutXfermode)
1974 #if !SK_ARM_NEON_IS_NONE 1975 #if !SK_ARM_NEON_IS_NONE
1975 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkNEONProcCoeffXfermode) 1976 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkNEONProcCoeffXfermode)
1976 #endif 1977 #endif
1977 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1978 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « no previous file | src/effects/SkDisplacementMapEffect.cpp » ('j') | src/effects/SkDisplacementMapEffect.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698