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

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

Issue 1709153002: Add more specialized fragment builders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make MSVC happy Created 4 years, 10 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/GrBicubicEffect.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.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 2013 Google Inc. 2 * Copyright 2013 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 "GrBitmapTextGeoProc.h" 8 #include "GrBitmapTextGeoProc.h"
9 #include "GrInvariantOutput.h" 9 #include "GrInvariantOutput.h"
10 #include "GrTexture.h" 10 #include "GrTexture.h"
(...skipping 25 matching lines...) Expand all
36 SkScalar recipWidth = 1.0f / atlas->width(); 36 SkScalar recipWidth = 1.0f / atlas->width();
37 SkScalar recipHeight = 1.0f / atlas->height(); 37 SkScalar recipHeight = 1.0f / atlas->height();
38 38
39 GrGLSLVertToFrag v(kVec2f_GrSLType); 39 GrGLSLVertToFrag v(kVec2f_GrSLType);
40 varyingHandler->addVarying("TextureCoords", &v); 40 varyingHandler->addVarying("TextureCoords", &v);
41 vertBuilder->codeAppendf("%s = vec2(%.*f, %.*f) * %s;", v.vsOut(), 41 vertBuilder->codeAppendf("%s = vec2(%.*f, %.*f) * %s;", v.vsOut(),
42 GR_SIGNIFICANT_POW2_DECIMAL_DIG, recipWidth, 42 GR_SIGNIFICANT_POW2_DECIMAL_DIG, recipWidth,
43 GR_SIGNIFICANT_POW2_DECIMAL_DIG, recipHeight, 43 GR_SIGNIFICANT_POW2_DECIMAL_DIG, recipHeight,
44 cte.inTextureCoords()->fName); 44 cte.inTextureCoords()->fName);
45 45
46 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 46 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder;
47 // Setup pass through color 47 // Setup pass through color
48 if (!cte.colorIgnored()) { 48 if (!cte.colorIgnored()) {
49 if (cte.hasVertexColor()) { 49 if (cte.hasVertexColor()) {
50 varyingHandler->addPassThroughAttribute(cte.inColor(), args.fOut putColor); 50 varyingHandler->addPassThroughAttribute(cte.inColor(), args.fOut putColor);
51 } else { 51 } else {
52 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutpu tColor, 52 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutpu tColor,
53 &fColorUniform); 53 &fColorUniform);
54 } 54 }
55 } 55 }
56 56
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 break; 192 break;
193 case 2: 193 case 2:
194 format = kARGB_GrMaskFormat; 194 format = kARGB_GrMaskFormat;
195 break; 195 break;
196 } 196 }
197 197
198 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t exIdx], params, 198 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t exIdx], params,
199 format, GrTest::TestMatrix(d->fRandom), 199 format, GrTest::TestMatrix(d->fRandom),
200 d->fRandom->nextBool()); 200 d->fRandom->nextBool());
201 } 201 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBicubicEffect.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698