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

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

Issue 227233007: Fix EffectKey for XferEffect (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 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 /* 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 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 outputColor, inputColor, dstColor, ds tColor, inputColor); 1072 outputColor, inputColor, dstColor, ds tColor, inputColor);
1073 break; 1073 break;
1074 } 1074 }
1075 default: 1075 default:
1076 GrCrash("Unknown XferEffect mode."); 1076 GrCrash("Unknown XferEffect mode.");
1077 break; 1077 break;
1078 } 1078 }
1079 } 1079 }
1080 1080
1081 static inline EffectKey GenKey(const GrDrawEffect& drawEffect, const GrG LCaps&) { 1081 static inline EffectKey GenKey(const GrDrawEffect& drawEffect, const GrG LCaps&) {
1082 return drawEffect.castEffect<XferEffect>().mode(); 1082 // The background may come from the dst or from a texture.
1083 int numTextures = (*drawEffect.effect())->numTextures();
1084 SkASSERT(numTextures <= 1);
1085 return (drawEffect.castEffect<XferEffect>().mode() << 1) | numTextur es;
1083 } 1086 }
1084 1087
1085 private: 1088 private:
1086 static void HardLight(GrGLShaderBuilder* builder, 1089 static void HardLight(GrGLShaderBuilder* builder,
1087 const char* final, 1090 const char* final,
1088 const char* src, 1091 const char* src,
1089 const char* dst) { 1092 const char* dst) {
1090 static const char kComponents[] = {'r', 'g', 'b'}; 1093 static const char kComponents[] = {'r', 'g', 'b'};
1091 for (size_t i = 0; i < SK_ARRAY_COUNT(kComponents); ++i) { 1094 for (size_t i = 0; i < SK_ARRAY_COUNT(kComponents); ++i) {
1092 char component = kComponents[i]; 1095 char component = kComponents[i];
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1987 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) 1990 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode)
1988 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) 1991 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode)
1989 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkClearXfermode) 1992 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkClearXfermode)
1990 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSrcXfermode) 1993 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSrcXfermode)
1991 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstInXfermode) 1994 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstInXfermode)
1992 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstOutXfermode) 1995 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstOutXfermode)
1993 #if !SK_ARM_NEON_IS_NONE 1996 #if !SK_ARM_NEON_IS_NONE
1994 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkNEONProcCoeffXfermode) 1997 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkNEONProcCoeffXfermode)
1995 #endif 1998 #endif
1996 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1999 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
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