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

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

Issue 994303003: Adjust atlas sizes to fix Mali400 precision issues (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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/GrFontCache.cpp ('k') | src/gpu/effects/GrDistanceFieldTextureEffect.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 "GrFontAtlasSizes.h" 9 #include "GrFontAtlasSizes.h"
10 #include "GrInvariantOutput.h" 10 #include "GrInvariantOutput.h"
(...skipping 21 matching lines...) Expand all
32 32
33 GrGLGPBuilder* pb = args.fPB; 33 GrGLGPBuilder* pb = args.fPB;
34 GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder(); 34 GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
35 35
36 // emit attributes 36 // emit attributes
37 vsBuilder->emitAttributes(cte); 37 vsBuilder->emitAttributes(cte);
38 38
39 GrGLVertToFrag v(kVec2f_GrSLType); 39 GrGLVertToFrag v(kVec2f_GrSLType);
40 pb->addVarying("TextureCoords", &v); 40 pb->addVarying("TextureCoords", &v);
41 // this is only used with text, so our texture bounds always match the g lyph atlas 41 // this is only used with text, so our texture bounds always match the g lyph atlas
42 vsBuilder->codeAppendf("%s = vec2(" GR_FONT_ATLAS_RECIP_WIDTH ", " 42 if (cte.maskFormat() == kA8_GrMaskFormat) {
43 GR_FONT_ATLAS_RECIP_HEIGHT ")*%s;", v.vsOut(), 43 vsBuilder->codeAppendf("%s = vec2(" GR_FONT_ATLAS_A8_RECIP_WIDTH ", "
44 cte.inTextureCoords()->fName); 44 GR_FONT_ATLAS_RECIP_HEIGHT ")*%s;", v.vsOut() ,
45 cte.inTextureCoords()->fName);
46 } else {
47 vsBuilder->codeAppendf("%s = vec2(" GR_FONT_ATLAS_RECIP_WIDTH ", "
48 GR_FONT_ATLAS_RECIP_HEIGHT ")*%s;", v.vsOut() ,
49 cte.inTextureCoords()->fName);
50 }
45 51
46 // Setup pass through color 52 // Setup pass through color
47 this->setupColorPassThrough(pb, local.fInputColorType, args.fOutputColor , cte.inColor(), 53 this->setupColorPassThrough(pb, local.fInputColorType, args.fOutputColor , cte.inColor(),
48 &fColorUniform); 54 &fColorUniform);
49 55
50 // Setup position 56 // Setup position
51 this->setupPosition(pb, gpArgs, cte.inPosition()->fName, cte.viewMatrix( )); 57 this->setupPosition(pb, gpArgs, cte.inPosition()->fName, cte.viewMatrix( ));
52 58
53 // emit transforms 59 // emit transforms
54 this->emitTransforms(args.fPB, gpArgs->fPositionVar, cte.inPosition()->f Name, 60 this->emitTransforms(args.fPB, gpArgs->fPositionVar, cte.inPosition()->f Name,
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 break; 227 break;
222 case 2: 228 case 2:
223 format = kARGB_GrMaskFormat; 229 format = kARGB_GrMaskFormat;
224 break; 230 break;
225 } 231 }
226 232
227 return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx], params, 233 return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx], params,
228 format, random->nextBool(), 234 format, random->nextBool(),
229 GrProcessorUnitTest::TestMatrix(random)); 235 GrProcessorUnitTest::TestMatrix(random));
230 } 236 }
OLDNEW
« no previous file with comments | « src/gpu/GrFontCache.cpp ('k') | src/gpu/effects/GrDistanceFieldTextureEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698