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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 SkShader::kRepeat_TileMode, | 172 SkShader::kRepeat_TileMode, |
173 SkShader::kMirror_TileMode, | 173 SkShader::kMirror_TileMode, |
174 }; | 174 }; |
175 SkShader::TileMode tileModes[] = { | 175 SkShader::TileMode tileModes[] = { |
176 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 176 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
177 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 177 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
178 }; | 178 }; |
179 GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams::
kBilerp_FilterMode : | 179 GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams::
kBilerp_FilterMode : |
180 GrTextureParams::kNon
e_FilterMode); | 180 GrTextureParams::kNon
e_FilterMode); |
181 | 181 |
182 GrMaskFormat format; | 182 GrMaskFormat format = kARGB_GrMaskFormat; // init to avoid warning |
183 switch (d->fRandom->nextULessThan(3)) { | 183 switch (d->fRandom->nextULessThan(3)) { |
184 case 0: | 184 case 0: |
185 format = kA8_GrMaskFormat; | 185 format = kA8_GrMaskFormat; |
186 break; | 186 break; |
187 case 1: | 187 case 1: |
188 format = kA565_GrMaskFormat; | 188 format = kA565_GrMaskFormat; |
189 break; | 189 break; |
190 case 2: | 190 case 2: |
191 format = kARGB_GrMaskFormat; | 191 format = kARGB_GrMaskFormat; |
192 break; | 192 break; |
193 } | 193 } |
194 | 194 |
195 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t
exIdx], params, | 195 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t
exIdx], params, |
196 format, GrTest::TestMatrix(d->fRandom), | 196 format, GrTest::TestMatrix(d->fRandom), |
197 d->fRandom->nextBool()); | 197 d->fRandom->nextBool()); |
198 } | 198 } |
OLD | NEW |