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

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

Issue 551253004: Changes to remove program effects builder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 3 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 2012 Google Inc. 2 * Copyright 2012 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 "GrConfigConversionEffect.h" 8 #include "GrConfigConversionEffect.h"
9 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrTBackendEffectFactory.h" 10 #include "GrTBackendEffectFactory.h"
(...skipping 22 matching lines...) Expand all
33 // Using highp for GLES here in order to avoid some precision issues on specific GPUs. 33 // Using highp for GLES here in order to avoid some precision issues on specific GPUs.
34 GrGLShaderVar tmpVar("tmpColor", kVec4f_GrSLType, 0, GrGLShaderVar::kHig h_Precision); 34 GrGLShaderVar tmpVar("tmpColor", kVec4f_GrSLType, 0, GrGLShaderVar::kHig h_Precision);
35 SkString tmpDecl; 35 SkString tmpDecl;
36 tmpVar.appendDecl(builder->ctxInfo(), &tmpDecl); 36 tmpVar.appendDecl(builder->ctxInfo(), &tmpDecl);
37 37
38 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder (); 38 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder ();
39 39
40 fsBuilder->codeAppendf("%s;", tmpDecl.c_str()); 40 fsBuilder->codeAppendf("%s;", tmpDecl.c_str());
41 41
42 fsBuilder->codeAppendf("%s = ", tmpVar.c_str()); 42 fsBuilder->codeAppendf("%s = ", tmpVar.c_str());
43 fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), coords[0] .type()); 43 fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), coords[0] .getType());
44 fsBuilder->codeAppend(";"); 44 fsBuilder->codeAppend(";");
45 45
46 if (GrConfigConversionEffect::kNone_PMConversion == fPMConversion) { 46 if (GrConfigConversionEffect::kNone_PMConversion == fPMConversion) {
47 SkASSERT(fSwapRedAndBlue); 47 SkASSERT(fSwapRedAndBlue);
48 fsBuilder->codeAppendf("%s = %s.bgra;", outputColor, tmpVar.c_str()) ; 48 fsBuilder->codeAppendf("%s = %s.bgra;", outputColor, tmpVar.c_str()) ;
49 } else { 49 } else {
50 const char* swiz = fSwapRedAndBlue ? "bgr" : "rgb"; 50 const char* swiz = fSwapRedAndBlue ? "bgr" : "rgb";
51 switch (fPMConversion) { 51 switch (fPMConversion) {
52 case GrConfigConversionEffect::kMulByAlpha_RoundUp_PMConversion: 52 case GrConfigConversionEffect::kMulByAlpha_RoundUp_PMConversion:
53 fsBuilder->codeAppendf( 53 fsBuilder->codeAppendf(
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 kNone_PMConversion != pmConversion) { 278 kNone_PMConversion != pmConversion) {
279 // The PM conversions assume colors are 0..255 279 // The PM conversions assume colors are 0..255
280 return NULL; 280 return NULL;
281 } 281 }
282 return SkNEW_ARGS(GrConfigConversionEffect, (texture, 282 return SkNEW_ARGS(GrConfigConversionEffect, (texture,
283 swapRedAndBlue, 283 swapRedAndBlue,
284 pmConversion, 284 pmConversion,
285 matrix)); 285 matrix));
286 } 286 }
287 } 287 }
OLDNEW
« no previous file with comments | « src/effects/gradients/SkTwoPointRadialGradient.cpp ('k') | src/gpu/effects/GrSimpleTextureEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698