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

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

Issue 25048002: Express (GLSL expression, possibly known value) pairs as a class (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: addressing review comments Created 7 years, 2 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 | src/effects/SkArithmeticMode.cpp » ('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 /* 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 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 builder->fsCodeAppendf("\t\tvec4 %s = ", dstColor); 937 builder->fsCodeAppendf("\t\tvec4 %s = ", dstColor);
938 builder->fsAppendTextureLookup(samplers[0], coords[0].c_str(), c oords[0].type()); 938 builder->fsAppendTextureLookup(samplers[0], coords[0].c_str(), c oords[0].type());
939 builder->fsCodeAppendf(";\n"); 939 builder->fsCodeAppendf(";\n");
940 } else { 940 } else {
941 dstColor = builder->dstColor(); 941 dstColor = builder->dstColor();
942 } 942 }
943 SkASSERT(NULL != dstColor); 943 SkASSERT(NULL != dstColor);
944 944
945 // We don't try to optimize for this case at all 945 // We don't try to optimize for this case at all
946 if (NULL == inputColor) { 946 if (NULL == inputColor) {
947 builder->fsCodeAppendf("\t\tconst vec4 ones = %s;\n", GrGLSLOnes Vecf(4)); 947 builder->fsCodeAppendf("\t\tconst vec4 ones = vec4(1);\n");
948 inputColor = "ones"; 948 inputColor = "ones";
949 } 949 }
950 builder->fsCodeAppendf("\t\t// SkXfermode::Mode: %s\n", SkXfermode:: ModeName(mode)); 950 builder->fsCodeAppendf("\t\t// SkXfermode::Mode: %s\n", SkXfermode:: ModeName(mode));
951 951
952 // These all perform src-over on the alpha channel. 952 // These all perform src-over on the alpha channel.
953 builder->fsCodeAppendf("\t\t%s.a = %s.a + (1.0 - %s.a) * %s.a;\n", 953 builder->fsCodeAppendf("\t\t%s.a = %s.a + (1.0 - %s.a) * %s.a;\n",
954 outputColor, inputColor, inputColor, dstColo r); 954 outputColor, inputColor, inputColor, dstColo r);
955 955
956 switch (mode) { 956 switch (mode) {
957 case SkXfermode::kOverlay_Mode: 957 case SkXfermode::kOverlay_Mode:
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
1944 return proc16; 1944 return proc16;
1945 } 1945 }
1946 1946
1947 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) 1947 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode)
1948 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) 1948 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode)
1949 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkClearXfermode) 1949 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkClearXfermode)
1950 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSrcXfermode) 1950 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSrcXfermode)
1951 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstInXfermode) 1951 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstInXfermode)
1952 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstOutXfermode) 1952 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstOutXfermode)
1953 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1953 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « no previous file | src/effects/SkArithmeticMode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698