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

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

Issue 1110033004: Make XPFragmentBuilder only Builder with access to DstCopy. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « src/gpu/effects/GrBitmapTextGeoProc.cpp ('k') | src/gpu/effects/GrConstColorProcessor.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 15 matching lines...) Expand all
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) override { 30 const TextureSamplerArray& samplers) 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, kHigh_GrSLPrecision ); 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 GrGLFragmentBuilder* 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(";");
43 43
44 if (GrConfigConversionEffect::kNone_PMConversion == fPMConversion) { 44 if (GrConfigConversionEffect::kNone_PMConversion == fPMConversion) {
45 SkASSERT(fSwapRedAndBlue); 45 SkASSERT(fSwapRedAndBlue);
46 fsBuilder->codeAppendf("%s = %s.bgra;", outputColor, tmpVar.c_str()) ; 46 fsBuilder->codeAppendf("%s = %s.bgra;", outputColor, tmpVar.c_str()) ;
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 kNone_PMConversion != pmConversion) { 289 kNone_PMConversion != pmConversion) {
290 // The PM conversions assume colors are 0..255 290 // The PM conversions assume colors are 0..255
291 return NULL; 291 return NULL;
292 } 292 }
293 return SkNEW_ARGS(GrConfigConversionEffect, (texture, 293 return SkNEW_ARGS(GrConfigConversionEffect, (texture,
294 swapRedAndBlue, 294 swapRedAndBlue,
295 pmConversion, 295 pmConversion,
296 matrix)); 296 matrix));
297 } 297 }
298 } 298 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBitmapTextGeoProc.cpp ('k') | src/gpu/effects/GrConstColorProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698