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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 GrColorToRGBAFloat(btgp.color(), c); | 91 GrColorToRGBAFloat(btgp.color(), c); |
92 pdman.set4fv(fColorUniform, 1, c); | 92 pdman.set4fv(fColorUniform, 1, c); |
93 fColor = btgp.color(); | 93 fColor = btgp.color(); |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 void setTransformData(const GrPrimitiveProcessor& primProc, | 97 void setTransformData(const GrPrimitiveProcessor& primProc, |
98 const GrGLSLProgramDataManager& pdman, | 98 const GrGLSLProgramDataManager& pdman, |
99 int index, | 99 int index, |
100 const SkTArray<const GrCoordTransform*, true>& transfo
rms) override { | 100 const SkTArray<const GrCoordTransform*, true>& transfo
rms) override { |
101 this->setTransformDataHelper<GrBitmapTextGeoProc>(primProc, pdman, index
, transforms); | 101 this->setTransformDataHelper(primProc.cast<GrBitmapTextGeoProc>().localM
atrix(), pdman, |
| 102 index, transforms); |
102 } | 103 } |
103 | 104 |
104 static inline void GenKey(const GrGeometryProcessor& proc, | 105 static inline void GenKey(const GrGeometryProcessor& proc, |
105 const GrGLSLCaps&, | 106 const GrGLSLCaps&, |
106 GrProcessorKeyBuilder* b) { | 107 GrProcessorKeyBuilder* b) { |
107 const GrBitmapTextGeoProc& gp = proc.cast<GrBitmapTextGeoProc>(); | 108 const GrBitmapTextGeoProc& gp = proc.cast<GrBitmapTextGeoProc>(); |
108 uint32_t key = 0; | 109 uint32_t key = 0; |
109 key |= gp.usesLocalCoords() && gp.localMatrix().hasPerspective() ? 0x1 :
0x0; | 110 key |= gp.usesLocalCoords() && gp.localMatrix().hasPerspective() ? 0x1 :
0x0; |
110 key |= gp.colorIgnored() ? 0x2 : 0x0; | 111 key |= gp.colorIgnored() ? 0x2 : 0x0; |
111 key |= gp.maskFormat() << 3; | 112 key |= gp.maskFormat() << 3; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 break; | 190 break; |
190 case 2: | 191 case 2: |
191 format = kARGB_GrMaskFormat; | 192 format = kARGB_GrMaskFormat; |
192 break; | 193 break; |
193 } | 194 } |
194 | 195 |
195 return GrBitmapTextGeoProc::Make(GrRandomColor(d->fRandom), d->fTextures[tex
Idx], params, | 196 return GrBitmapTextGeoProc::Make(GrRandomColor(d->fRandom), d->fTextures[tex
Idx], params, |
196 format, GrTest::TestMatrix(d->fRandom), | 197 format, GrTest::TestMatrix(d->fRandom), |
197 d->fRandom->nextBool()); | 198 d->fRandom->nextBool()); |
198 } | 199 } |
OLD | NEW |