| 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 "GrInvariantOutput.h" | 9 #include "GrInvariantOutput.h" |
| 10 #include "GrTexture.h" | 10 #include "GrTexture.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 vsBuilder->emitAttributes(cte); | 36 vsBuilder->emitAttributes(cte); |
| 37 | 37 |
| 38 GrGLVertToFrag v(kVec2f_GrSLType); | 38 GrGLVertToFrag v(kVec2f_GrSLType); |
| 39 pb->addVarying("TextureCoords", &v); | 39 pb->addVarying("TextureCoords", &v); |
| 40 vsBuilder->codeAppendf("%s = %s;", v.vsOut(), cte.inTextureCoords()->fNa
me); | 40 vsBuilder->codeAppendf("%s = %s;", v.vsOut(), cte.inTextureCoords()->fNa
me); |
| 41 | 41 |
| 42 // Setup pass through color | 42 // Setup pass through color |
| 43 this->setupColorPassThrough(pb, local.fInputColorType, args.fOutputColor
, cte.inColor(), | 43 this->setupColorPassThrough(pb, local.fInputColorType, args.fOutputColor
, cte.inColor(), |
| 44 &fColorUniform); | 44 &fColorUniform); |
| 45 | 45 |
| 46 // setup uniform viewMatrix | |
| 47 this->addUniformViewMatrix(pb); | |
| 48 | |
| 49 // Setup position | 46 // Setup position |
| 50 SetupPosition(vsBuilder, gpArgs, cte.inPosition()->fName, cte.viewMatrix
(), this->uViewM()); | 47 this->setupPosition(pb, gpArgs, cte.inPosition()->fName, cte.viewMatrix(
)); |
| 51 | 48 |
| 52 // emit transforms | 49 // emit transforms |
| 53 this->emitTransforms(args.fPB, gpArgs->fPositionVar, cte.inPosition()->f
Name, | 50 this->emitTransforms(args.fPB, gpArgs->fPositionVar, cte.inPosition()->f
Name, |
| 54 cte.localMatrix(), args.fTransformsIn, args.fTransf
ormsOut); | 51 cte.localMatrix(), args.fTransformsIn, args.fTransf
ormsOut); |
| 55 | 52 |
| 56 GrGLGPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder(); | 53 GrGLGPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder(); |
| 57 if (cte.maskFormat() == kARGB_GrMaskFormat) { | 54 if (cte.maskFormat() == kARGB_GrMaskFormat) { |
| 58 fsBuilder->codeAppendf("%s = ", args.fOutputColor); | 55 fsBuilder->codeAppendf("%s = ", args.fOutputColor); |
| 59 fsBuilder->appendTextureLookupAndModulate(args.fOutputColor, | 56 fsBuilder->appendTextureLookupAndModulate(args.fOutputColor, |
| 60 args.fSamplers[0], | 57 args.fSamplers[0], |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 break; | 217 break; |
| 221 case 2: | 218 case 2: |
| 222 format = kARGB_GrMaskFormat; | 219 format = kARGB_GrMaskFormat; |
| 223 break; | 220 break; |
| 224 } | 221 } |
| 225 | 222 |
| 226 return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx],
params, | 223 return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx],
params, |
| 227 format, random->nextBool(), | 224 format, random->nextBool(), |
| 228 GrProcessorUnitTest::TestMatrix(random)); | 225 GrProcessorUnitTest::TestMatrix(random)); |
| 229 } | 226 } |
| OLD | NEW |