| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode); | 144 SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode); |
| 145 void reset(GrTexture*, const char* swizzle, const GrTextureParams&); | 145 void reset(GrTexture*, const char* swizzle, const GrTextureParams&); |
| 146 void reset(GrTexture*, | 146 void reset(GrTexture*, |
| 147 const char* swizzle, | 147 const char* swizzle, |
| 148 GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode, | 148 GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode, |
| 149 SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode); | 149 SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode); |
| 150 | 150 |
| 151 bool operator== (const GrTextureAccess& other) const { | 151 bool operator== (const GrTextureAccess& other) const { |
| 152 #if GR_DEBUG | 152 #if GR_DEBUG |
| 153 // below assumes all chars in fSwizzle are initialized even if string is
< 4 chars long. | 153 // below assumes all chars in fSwizzle are initialized even if string is
< 4 chars long. |
| 154 GrAssert(memcmp(fSwizzle, other.fSwizzle, sizeof(fSwizzle)-1) == | 154 SkASSERT(memcmp(fSwizzle, other.fSwizzle, sizeof(fSwizzle)-1) == |
| 155 strcmp(fSwizzle, other.fSwizzle)); | 155 strcmp(fSwizzle, other.fSwizzle)); |
| 156 #endif | 156 #endif |
| 157 return fParams == other.fParams && | 157 return fParams == other.fParams && |
| 158 (fTexture.get() == other.fTexture.get()) && | 158 (fTexture.get() == other.fTexture.get()) && |
| 159 (0 == memcmp(fSwizzle, other.fSwizzle, sizeof(fSwizzle)-1)); | 159 (0 == memcmp(fSwizzle, other.fSwizzle, sizeof(fSwizzle)-1)); |
| 160 } | 160 } |
| 161 | 161 |
| 162 bool operator!= (const GrTextureAccess& other) const { return !(*this == oth
er); } | 162 bool operator!= (const GrTextureAccess& other) const { return !(*this == oth
er); } |
| 163 | 163 |
| 164 GrTexture* getTexture() const { return fTexture.get(); } | 164 GrTexture* getTexture() const { return fTexture.get(); } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 179 | 179 |
| 180 GrTextureParams fParams; | 180 GrTextureParams fParams; |
| 181 SkAutoTUnref<GrTexture> fTexture; | 181 SkAutoTUnref<GrTexture> fTexture; |
| 182 uint32_t fSwizzleMask; | 182 uint32_t fSwizzleMask; |
| 183 char fSwizzle[5]; | 183 char fSwizzle[5]; |
| 184 | 184 |
| 185 typedef GrNoncopyable INHERITED; | 185 typedef GrNoncopyable INHERITED; |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 #endif | 188 #endif |
| OLD | NEW |