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 this->reset(texture, filterMode, tileXAndY, visibility); | 22 GrSLPrecision precision) { |
| 23 this->reset(texture, filterMode, tileXAndY, visibility, precision); |
23 } | 24 } |
24 | 25 |
25 void GrTextureAccess::reset(GrTexture* texture, | 26 void GrTextureAccess::reset(GrTexture* texture, |
26 const GrTextureParams& params, | 27 const GrTextureParams& params, |
27 GrShaderFlags visibility) { | 28 GrShaderFlags visibility, |
| 29 GrSLPrecision precision) { |
28 SkASSERT(texture); | 30 SkASSERT(texture); |
29 fTexture.set(SkRef(texture), kRead_GrIOType); | 31 fTexture.set(SkRef(texture), kRead_GrIOType); |
30 fParams = params; | 32 fParams = params; |
31 fVisibility = visibility; | 33 fVisibility = visibility; |
| 34 fPrecision = precision; |
32 } | 35 } |
33 | 36 |
34 void GrTextureAccess::reset(GrTexture* texture, | 37 void GrTextureAccess::reset(GrTexture* texture, |
35 GrTextureParams::FilterMode filterMode, | 38 GrTextureParams::FilterMode filterMode, |
36 SkShader::TileMode tileXAndY, | 39 SkShader::TileMode tileXAndY, |
37 GrShaderFlags visibility) { | 40 GrShaderFlags visibility, |
| 41 GrSLPrecision precision) { |
38 SkASSERT(texture); | 42 SkASSERT(texture); |
39 fTexture.set(SkRef(texture), kRead_GrIOType); | 43 fTexture.set(SkRef(texture), kRead_GrIOType); |
40 fParams.reset(tileXAndY, filterMode); | 44 fParams.reset(tileXAndY, filterMode); |
41 fVisibility = visibility; | 45 fVisibility = visibility; |
| 46 fPrecision = precision; |
42 } | 47 } |
OLD | NEW |