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 11 matching lines...) Expand all Loading... |
22 public: | 22 public: |
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 | 34 |
34 void reset(GrTexture*, const GrTextureParams&); | 35 void reset(GrTexture*, const GrTextureParams&, |
| 36 GrShaderFlags visibility = kFragment_GrShaderFlag); |
35 void reset(GrTexture*, | 37 void reset(GrTexture*, |
36 GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode, | 38 GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode, |
37 SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode); | 39 SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode, |
| 40 GrShaderFlags visibility = kFragment_GrShaderFlag); |
38 | 41 |
39 bool operator==(const GrTextureAccess& that) const { | 42 bool operator==(const GrTextureAccess& that) const { |
40 return this->getTexture() == that.getTexture() && fParams == that.fParam
s; | 43 return this->getTexture() == that.getTexture() && |
| 44 fParams == that.fParams && |
| 45 fVisibility == that.fVisibility; |
41 } | 46 } |
42 | 47 |
43 bool operator!=(const GrTextureAccess& other) const { return !(*this == othe
r); } | 48 bool operator!=(const GrTextureAccess& other) const { return !(*this == othe
r); } |
44 | 49 |
45 GrTexture* getTexture() const { return fTexture.get(); } | 50 GrTexture* getTexture() const { return fTexture.get(); } |
| 51 GrShaderFlags getVisibility() const { return fVisibility; } |
46 | 52 |
47 /** | 53 /** |
48 * For internal use by GrProcessor. | 54 * For internal use by GrProcessor. |
49 */ | 55 */ |
50 const GrGpuResourceRef* getProgramTexture() const { return &fTexture; } | 56 const GrGpuResourceRef* getProgramTexture() const { return &fTexture; } |
51 | 57 |
52 const GrTextureParams& getParams() const { return fParams; } | 58 const GrTextureParams& getParams() const { return fParams; } |
53 | 59 |
54 private: | 60 private: |
55 | 61 |
56 typedef GrTGpuResourceRef<GrTexture> ProgramTexture; | 62 typedef GrTGpuResourceRef<GrTexture> ProgramTexture; |
57 | 63 |
58 ProgramTexture fTexture; | 64 ProgramTexture fTexture; |
59 GrTextureParams fParams; | 65 GrTextureParams fParams; |
| 66 GrShaderFlags fVisibility; |
60 | 67 |
61 typedef SkNoncopyable INHERITED; | 68 typedef SkNoncopyable INHERITED; |
62 }; | 69 }; |
63 | 70 |
64 #endif | 71 #endif |
OLD | NEW |