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 #ifndef GrTextureAccess_DEFINED | 8 #ifndef GrTextureAccess_DEFINED |
9 #define GrTextureAccess_DEFINED | 9 #define GrTextureAccess_DEFINED |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 /** | 23 /** |
24 * Must be initialized before adding to a GrProcessor's texture access list. | 24 * Must be initialized before adding to a GrProcessor's texture access list. |
25 */ | 25 */ |
26 GrTextureAccess(); | 26 GrTextureAccess(); |
27 | 27 |
28 GrTextureAccess(GrTexture*, const GrTextureParams&); | 28 GrTextureAccess(GrTexture*, const GrTextureParams&); |
29 | 29 |
30 explicit GrTextureAccess(GrTexture*, | 30 explicit GrTextureAccess(GrTexture*, |
31 GrTextureParams::FilterMode = GrTextureParams::kNon
e_FilterMode, | 31 GrTextureParams::FilterMode = GrTextureParams::kNon
e_FilterMode, |
32 SkShader::TileMode tileXAndY = SkShader::kClamp_Til
eMode, | 32 SkShader::TileMode tileXAndY = SkShader::kClamp_Til
eMode, |
33 GrShaderFlags visibility = kFragment_GrShaderFlag, | 33 GrShaderFlags visibility = kFragment_GrShaderFlag); |
34 GrSLPrecision = kDefault_GrSLPrecision); | |
35 | 34 |
36 void reset(GrTexture*, const GrTextureParams&, | 35 void reset(GrTexture*, const GrTextureParams&, |
37 GrShaderFlags visibility = kFragment_GrShaderFlag, | 36 GrShaderFlags visibility = kFragment_GrShaderFlag); |
38 GrSLPrecision = kDefault_GrSLPrecision); | |
39 void reset(GrTexture*, | 37 void reset(GrTexture*, |
40 GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode, | 38 GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode, |
41 SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode, | 39 SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode, |
42 GrShaderFlags visibility = kFragment_GrShaderFlag, | 40 GrShaderFlags visibility = kFragment_GrShaderFlag); |
43 GrSLPrecision = kDefault_GrSLPrecision); | |
44 | 41 |
45 bool operator==(const GrTextureAccess& that) const { | 42 bool operator==(const GrTextureAccess& that) const { |
46 return this->getTexture() == that.getTexture() && | 43 return this->getTexture() == that.getTexture() && |
47 fParams == that.fParams && | 44 fParams == that.fParams && |
48 fVisibility == that.fVisibility && | 45 fVisibility == that.fVisibility; |
49 fPrecision == that.fPrecision; | |
50 } | 46 } |
51 | 47 |
52 bool operator!=(const GrTextureAccess& other) const { return !(*this == othe
r); } | 48 bool operator!=(const GrTextureAccess& other) const { return !(*this == othe
r); } |
53 | 49 |
54 GrTexture* getTexture() const { return fTexture.get(); } | 50 GrTexture* getTexture() const { return fTexture.get(); } |
55 GrShaderFlags getVisibility() const { return fVisibility; } | 51 GrShaderFlags getVisibility() const { return fVisibility; } |
56 GrSLPrecision getPrecision() const { return fPrecision; } | |
57 | 52 |
58 /** | 53 /** |
59 * For internal use by GrProcessor. | 54 * For internal use by GrProcessor. |
60 */ | 55 */ |
61 const GrGpuResourceRef* getProgramTexture() const { return &fTexture; } | 56 const GrGpuResourceRef* getProgramTexture() const { return &fTexture; } |
62 | 57 |
63 const GrTextureParams& getParams() const { return fParams; } | 58 const GrTextureParams& getParams() const { return fParams; } |
64 | 59 |
65 private: | 60 private: |
66 | 61 |
67 typedef GrTGpuResourceRef<GrTexture> ProgramTexture; | 62 typedef GrTGpuResourceRef<GrTexture> ProgramTexture; |
68 | 63 |
69 ProgramTexture fTexture; | 64 ProgramTexture fTexture; |
70 GrTextureParams fParams; | 65 GrTextureParams fParams; |
71 GrShaderFlags fVisibility; | 66 GrShaderFlags fVisibility; |
72 GrSLPrecision fPrecision; | |
73 | 67 |
74 typedef SkNoncopyable INHERITED; | 68 typedef SkNoncopyable INHERITED; |
75 }; | 69 }; |
76 | 70 |
77 #endif | 71 #endif |
OLD | NEW |