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

Side by Side Diff: src/gpu/gl/GrGLSL.cpp

Issue 25023003: Implement color filter as GrGLEffect (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address 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 | « src/gpu/gl/GrGLSL.h ('k') | src/gpu/gl/GrGLSL_impl.h » ('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 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "GrGLSL.h" 8 #include "GrGLSL.h"
9 #include "GrGLShaderVar.h" 9 #include "GrGLShaderVar.h"
10 #include "SkString.h" 10 #include "SkString.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 int cnt = GrMin((int)GR_ARRAY_COUNT(kTabs), tabCnt); 70 int cnt = GrMin((int)GR_ARRAY_COUNT(kTabs), tabCnt);
71 outAppend->append(kTabs, cnt); 71 outAppend->append(kTabs, cnt);
72 tabCnt -= cnt; 72 tabCnt -= cnt;
73 } 73 }
74 } 74 }
75 } 75 }
76 76
77 void GrGLSLMulVarBy4f(SkString* outAppend, 77 void GrGLSLMulVarBy4f(SkString* outAppend,
78 unsigned tabCnt, 78 unsigned tabCnt,
79 const char* vec4VarName, 79 const char* vec4VarName,
80 const GrGLSLExpr<4>& mulFactor) { 80 const GrGLSLExpr4& mulFactor) {
81 if (mulFactor.isOnes()) { 81 if (mulFactor.isOnes()) {
82 *outAppend = SkString(); 82 *outAppend = SkString();
83 } 83 }
84 84
85 append_tabs(outAppend, tabCnt); 85 append_tabs(outAppend, tabCnt);
86 86
87 if (mulFactor.isZeros()) { 87 if (mulFactor.isZeros()) {
88 outAppend->appendf("%s = vec4(0);\n", vec4VarName); 88 outAppend->appendf("%s = vec4(0);\n", vec4VarName);
89 } 89 }
90 outAppend->appendf("%s *= %s;\n", vec4VarName, mulFactor.c_str()); 90 outAppend->appendf("%s *= %s;\n", vec4VarName, mulFactor.c_str());
91 } 91 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLSL.h ('k') | src/gpu/gl/GrGLSL_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698