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

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

Issue 257393004: Convert GrCrash->SkFAIL GrDebugCrash->SkDEBUGFAIL (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: whitespace change Created 6 years, 7 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
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 #include "SkBlitRow.h" 8 #include "SkBlitRow.h"
9 #include "SkColorFilter.h" 9 #include "SkColorFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 * A definition of blend equation for one coefficient. Generates a 138 * A definition of blend equation for one coefficient. Generates a
139 * blend_coeff * value "expression". 139 * blend_coeff * value "expression".
140 */ 140 */
141 template<typename ColorExpr> 141 template<typename ColorExpr>
142 static inline ColorExpr blend_term(SkXfermode::Coeff coeff, 142 static inline ColorExpr blend_term(SkXfermode::Coeff coeff,
143 const ColorExpr& src, 143 const ColorExpr& src,
144 const ColorExpr& dst, 144 const ColorExpr& dst,
145 const ColorExpr& value) { 145 const ColorExpr& value) {
146 switch (coeff) { 146 switch (coeff) {
147 default: 147 default:
148 GrCrash("Unexpected xfer coeff."); 148 SkFAIL("Unexpected xfer coeff.");
149 case SkXfermode::kZero_Coeff: /** 0 */ 149 case SkXfermode::kZero_Coeff: /** 0 */
150 return ColorExpr(0); 150 return ColorExpr(0);
151 case SkXfermode::kOne_Coeff: /** 1 */ 151 case SkXfermode::kOne_Coeff: /** 1 */
152 return value; 152 return value;
153 case SkXfermode::kSC_Coeff: 153 case SkXfermode::kSC_Coeff:
154 return src * value; 154 return src * value;
155 case SkXfermode::kISC_Coeff: 155 case SkXfermode::kISC_Coeff:
156 return (ColorExpr(1) - src) * dst; 156 return (ColorExpr(1) - src) * dst;
157 case SkXfermode::kDC_Coeff: 157 case SkXfermode::kDC_Coeff:
158 return dst * value; 158 return dst * value;
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 SkIntToScalar(SkColorGetB(add)), 558 SkIntToScalar(SkColorGetB(add)),
559 0); 559 0);
560 return SkColorMatrixFilter::Create(matrix); 560 return SkColorMatrixFilter::Create(matrix);
561 } 561 }
562 562
563 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkColorFilter) 563 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkColorFilter)
564 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkModeColorFilter) 564 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkModeColorFilter)
565 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(Src_SkModeColorFilter) 565 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(Src_SkModeColorFilter)
566 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SrcOver_SkModeColorFilter) 566 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SrcOver_SkModeColorFilter)
567 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 567 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698