| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrSimpleTextureEffect.h" | 8 #include "GrSimpleTextureEffect.h" |
| 9 #include "gl/GrGLEffect.h" | 9 #include "gl/GrGLEffect.h" |
| 10 #include "gl/GrGLEffectMatrix.h" | 10 #include "gl/GrGLEffectMatrix.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 GrEffectUnitTest::kAlphaTextureIdx; | 103 GrEffectUnitTest::kAlphaTextureIdx; |
| 104 static const SkShader::TileMode kTileModes[] = { | 104 static const SkShader::TileMode kTileModes[] = { |
| 105 SkShader::kClamp_TileMode, | 105 SkShader::kClamp_TileMode, |
| 106 SkShader::kRepeat_TileMode, | 106 SkShader::kRepeat_TileMode, |
| 107 SkShader::kMirror_TileMode, | 107 SkShader::kMirror_TileMode, |
| 108 }; | 108 }; |
| 109 SkShader::TileMode tileModes[] = { | 109 SkShader::TileMode tileModes[] = { |
| 110 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 110 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
| 111 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 111 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
| 112 }; | 112 }; |
| 113 GrTextureParams params(tileModes, random->nextBool()); | 113 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : |
| 114 GrTextureParams::kNon
e_FilterMode); |
| 114 | 115 |
| 115 static const CoordsType kCoordsTypes[] = { | 116 static const CoordsType kCoordsTypes[] = { |
| 116 kLocal_CoordsType, | 117 kLocal_CoordsType, |
| 117 kPosition_CoordsType, | 118 kPosition_CoordsType, |
| 118 kCustom_CoordsType | 119 kCustom_CoordsType |
| 119 }; | 120 }; |
| 120 CoordsType coordsType = kCoordsTypes[random->nextULessThan(GR_ARRAY_COUNT(kC
oordsTypes))]; | 121 CoordsType coordsType = kCoordsTypes[random->nextULessThan(GR_ARRAY_COUNT(kC
oordsTypes))]; |
| 121 | 122 |
| 122 if (kCustom_CoordsType == coordsType) { | 123 if (kCustom_CoordsType == coordsType) { |
| 123 return GrSimpleTextureEffect::CreateWithCustomCoords(textures[texIdx], p
arams); | 124 return GrSimpleTextureEffect::CreateWithCustomCoords(textures[texIdx], p
arams); |
| 124 } else { | 125 } else { |
| 125 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); | 126 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); |
| 126 return GrSimpleTextureEffect::Create(textures[texIdx], matrix); | 127 return GrSimpleTextureEffect::Create(textures[texIdx], matrix); |
| 127 } | 128 } |
| 128 } | 129 } |
| OLD | NEW |