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

Side by Side Diff: src/gpu/effects/GrCustomXfermode.cpp

Issue 1416423003: Make GrGLSLProgramBuilder base class for ProgramBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 5 years, 1 month 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
« no previous file with comments | « src/gpu/effects/GrConvexPolyEffect.cpp ('k') | src/gpu/effects/GrDashingEffect.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 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "effects/GrCustomXfermode.h" 8 #include "effects/GrCustomXfermode.h"
9 9
10 #include "GrCoordTransform.h" 10 #include "GrCoordTransform.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 // Apply coverage by multiplying it into the src color before blending. Mixed samples will 153 // Apply coverage by multiplying it into the src color before blending. Mixed samples will
154 // "just work" automatically. (See onGetOptimizations()) 154 // "just work" automatically. (See onGetOptimizations())
155 if (xp.readsCoverage()) { 155 if (xp.readsCoverage()) {
156 fsBuilder->codeAppendf("%s = %s * %s;", 156 fsBuilder->codeAppendf("%s = %s * %s;",
157 args.fOutputPrimary, args.fInputCoverage, arg s.fInputColor); 157 args.fOutputPrimary, args.fInputCoverage, arg s.fInputColor);
158 } else { 158 } else {
159 fsBuilder->codeAppendf("%s = %s;", args.fOutputPrimary, args.fInputC olor); 159 fsBuilder->codeAppendf("%s = %s;", args.fOutputPrimary, args.fInputC olor);
160 } 160 }
161 } 161 }
162 162
163 void emitBlendCodeForDstRead(GrGLXPBuilder* pb, const char* srcColor, const char* dstColor, 163 void emitBlendCodeForDstRead(GrGLSLXPBuilder* pb, const char* srcColor, cons t char* dstColor,
164 const char* outColor, const GrXferProcessor& pr oc) override { 164 const char* outColor, const GrXferProcessor& pr oc) override {
165 const CustomXP& xp = proc.cast<CustomXP>(); 165 const CustomXP& xp = proc.cast<CustomXP>();
166 SkASSERT(!xp.hasHWBlendEquation()); 166 SkASSERT(!xp.hasHWBlendEquation());
167 167
168 GrGLXPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder(); 168 GrGLXPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
169 GrGLSLBlend::AppendMode(fsBuilder, srcColor, dstColor, outColor, xp.mode ()); 169 GrGLSLBlend::AppendMode(fsBuilder, srcColor, dstColor, outColor, xp.mode ());
170 } 170 }
171 171
172 void onSetData(const GrGLSLProgramDataManager&, const GrXferProcessor&) over ride {} 172 void onSetData(const GrGLSLProgramDataManager&, const GrXferProcessor&) over ride {}
173 173
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 393
394 /////////////////////////////////////////////////////////////////////////////// 394 ///////////////////////////////////////////////////////////////////////////////
395 395
396 GrXPFactory* GrCustomXfermode::CreateXPFactory(SkXfermode::Mode mode) { 396 GrXPFactory* GrCustomXfermode::CreateXPFactory(SkXfermode::Mode mode) {
397 if (!GrCustomXfermode::IsSupportedMode(mode)) { 397 if (!GrCustomXfermode::IsSupportedMode(mode)) {
398 return nullptr; 398 return nullptr;
399 } else { 399 } else {
400 return new CustomXPFactory(mode); 400 return new CustomXPFactory(mode);
401 } 401 }
402 } 402 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConvexPolyEffect.cpp ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698