| OLD | NEW |
| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 this->setupColorPassThrough(pb, local.fInputColorType, args.fOutputColor
, cte.inColor(), | 53 this->setupColorPassThrough(pb, local.fInputColorType, args.fOutputColor
, cte.inColor(), |
| 54 &fColorUniform); | 54 &fColorUniform); |
| 55 | 55 |
| 56 // Setup position | 56 // Setup position |
| 57 this->setupPosition(pb, gpArgs, cte.inPosition()->fName, cte.viewMatrix(
)); | 57 this->setupPosition(pb, gpArgs, cte.inPosition()->fName, cte.viewMatrix(
)); |
| 58 | 58 |
| 59 // emit transforms | 59 // emit transforms |
| 60 this->emitTransforms(args.fPB, gpArgs->fPositionVar, cte.inPosition()->f
Name, | 60 this->emitTransforms(args.fPB, gpArgs->fPositionVar, cte.inPosition()->f
Name, |
| 61 cte.localMatrix(), args.fTransformsIn, args.fTransf
ormsOut); | 61 cte.localMatrix(), args.fTransformsIn, args.fTransf
ormsOut); |
| 62 | 62 |
| 63 GrGLGPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder(); | 63 GrGLFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder(); |
| 64 if (cte.maskFormat() == kARGB_GrMaskFormat) { | 64 if (cte.maskFormat() == kARGB_GrMaskFormat) { |
| 65 fsBuilder->codeAppendf("%s = ", args.fOutputColor); | 65 fsBuilder->codeAppendf("%s = ", args.fOutputColor); |
| 66 fsBuilder->appendTextureLookupAndModulate(args.fOutputColor, | 66 fsBuilder->appendTextureLookupAndModulate(args.fOutputColor, |
| 67 args.fSamplers[0], | 67 args.fSamplers[0], |
| 68 v.fsIn(), | 68 v.fsIn(), |
| 69 kVec2f_GrSLType); | 69 kVec2f_GrSLType); |
| 70 fsBuilder->codeAppend(";"); | 70 fsBuilder->codeAppend(";"); |
| 71 fsBuilder->codeAppendf("%s = vec4(1);", args.fOutputCoverage); | 71 fsBuilder->codeAppendf("%s = vec4(1);", args.fOutputCoverage); |
| 72 } else { | 72 } else { |
| 73 fsBuilder->codeAppendf("%s = ", args.fOutputCoverage); | 73 fsBuilder->codeAppendf("%s = ", args.fOutputCoverage); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 break; | 227 break; |
| 228 case 2: | 228 case 2: |
| 229 format = kARGB_GrMaskFormat; | 229 format = kARGB_GrMaskFormat; |
| 230 break; | 230 break; |
| 231 } | 231 } |
| 232 | 232 |
| 233 return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx],
params, | 233 return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx],
params, |
| 234 format, random->nextBool(), | 234 format, random->nextBool(), |
| 235 GrTest::TestMatrix(random)); | 235 GrTest::TestMatrix(random)); |
| 236 } | 236 } |
| OLD | NEW |