| 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 "GrTextureAccess.h" | 8 #include "GrTextureAccess.h" |
| 9 #include "GrColor.h" | 9 #include "GrColor.h" |
| 10 #include "GrTexture.h" | 10 #include "GrTexture.h" |
| 11 | 11 |
| 12 GrTextureAccess::GrTextureAccess() {} | 12 GrTextureAccess::GrTextureAccess() {} |
| 13 | 13 |
| 14 GrTextureAccess::GrTextureAccess(GrTexture* texture, const GrTextureParams& para
ms) { | 14 GrTextureAccess::GrTextureAccess(GrTexture* texture, const GrTextureParams& para
ms) { |
| 15 this->reset(texture, params); | 15 this->reset(texture, params); |
| 16 } | 16 } |
| 17 | 17 |
| 18 GrTextureAccess::GrTextureAccess(GrTexture* texture, | 18 GrTextureAccess::GrTextureAccess(GrTexture* texture, |
| 19 GrTextureParams::FilterMode filterMode, | 19 GrTextureParams::FilterMode filterMode, |
| 20 SkShader::TileMode tileXAndY, | 20 SkShader::TileMode tileXAndY, |
| 21 GrShaderFlags visibility, | 21 GrShaderFlags visibility) { |
| 22 GrSLPrecision precision) { | 22 this->reset(texture, filterMode, tileXAndY, visibility); |
| 23 this->reset(texture, filterMode, tileXAndY, visibility, precision); | |
| 24 } | 23 } |
| 25 | 24 |
| 26 void GrTextureAccess::reset(GrTexture* texture, | 25 void GrTextureAccess::reset(GrTexture* texture, |
| 27 const GrTextureParams& params, | 26 const GrTextureParams& params, |
| 28 GrShaderFlags visibility, | 27 GrShaderFlags visibility) { |
| 29 GrSLPrecision precision) { | |
| 30 SkASSERT(texture); | 28 SkASSERT(texture); |
| 31 fTexture.set(SkRef(texture), kRead_GrIOType); | 29 fTexture.set(SkRef(texture), kRead_GrIOType); |
| 32 fParams = params; | 30 fParams = params; |
| 33 fVisibility = visibility; | 31 fVisibility = visibility; |
| 34 fPrecision = precision; | |
| 35 } | 32 } |
| 36 | 33 |
| 37 void GrTextureAccess::reset(GrTexture* texture, | 34 void GrTextureAccess::reset(GrTexture* texture, |
| 38 GrTextureParams::FilterMode filterMode, | 35 GrTextureParams::FilterMode filterMode, |
| 39 SkShader::TileMode tileXAndY, | 36 SkShader::TileMode tileXAndY, |
| 40 GrShaderFlags visibility, | 37 GrShaderFlags visibility) { |
| 41 GrSLPrecision precision) { | |
| 42 SkASSERT(texture); | 38 SkASSERT(texture); |
| 43 fTexture.set(SkRef(texture), kRead_GrIOType); | 39 fTexture.set(SkRef(texture), kRead_GrIOType); |
| 44 fParams.reset(tileXAndY, filterMode); | 40 fParams.reset(tileXAndY, filterMode); |
| 45 fVisibility = visibility; | 41 fVisibility = visibility; |
| 46 fPrecision = precision; | |
| 47 } | 42 } |
| OLD | NEW |