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

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

Issue 777443003: Move shader precision out of GrShaderVar (Closed) Base URL: https://skia.googlesource.com/skia.git@prec
Patch Set: rebase Created 6 years 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/GrBezierEffect.cpp ('k') | src/gpu/gl/GrGLCaps.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 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 "GrInvariantOutput.h" 10 #include "GrInvariantOutput.h"
(...skipping 11 matching lines...) Expand all
22 fPMConversion = configConversionEffect.pmConversion(); 22 fPMConversion = configConversionEffect.pmConversion();
23 } 23 }
24 24
25 virtual void emitCode(GrGLFPBuilder* builder, 25 virtual void emitCode(GrGLFPBuilder* builder,
26 const GrFragmentProcessor&, 26 const GrFragmentProcessor&,
27 const char* outputColor, 27 const char* outputColor,
28 const char* inputColor, 28 const char* inputColor,
29 const TransformedCoordsArray& coords, 29 const TransformedCoordsArray& coords,
30 const TextureSamplerArray& samplers) SK_OVERRIDE { 30 const TextureSamplerArray& samplers) SK_OVERRIDE {
31 // Using highp for GLES here in order to avoid some precision issues on specific GPUs. 31 // Using highp for GLES here in order to avoid some precision issues on specific GPUs.
32 GrGLShaderVar tmpVar("tmpColor", kVec4f_GrSLType, 0, GrGLShaderVar::kHig h_Precision); 32 GrGLShaderVar tmpVar("tmpColor", kVec4f_GrSLType, 0, kHigh_GrSLPrecision );
33 SkString tmpDecl; 33 SkString tmpDecl;
34 tmpVar.appendDecl(builder->ctxInfo(), &tmpDecl); 34 tmpVar.appendDecl(builder->ctxInfo(), &tmpDecl);
35 35
36 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder(); 36 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
37 37
38 fsBuilder->codeAppendf("%s;", tmpDecl.c_str()); 38 fsBuilder->codeAppendf("%s;", tmpDecl.c_str());
39 39
40 fsBuilder->codeAppendf("%s = ", tmpVar.c_str()); 40 fsBuilder->codeAppendf("%s = ", tmpVar.c_str());
41 fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), coords[0] .getType()); 41 fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), coords[0] .getType());
42 fsBuilder->codeAppend(";"); 42 fsBuilder->codeAppend(";");
(...skipping 235 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/gpu/effects/GrBezierEffect.cpp ('k') | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698