| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef GrTexture_DEFINED | 9 #ifndef GrTexture_DEFINED |
| 10 #define GrTexture_DEFINED | 10 #define GrTexture_DEFINED |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 * altered directly, without being tracked by skia. | 119 * altered directly, without being tracked by skia. |
| 120 */ | 120 */ |
| 121 virtual void invalidateCachedState() = 0; | 121 virtual void invalidateCachedState() = 0; |
| 122 | 122 |
| 123 #ifdef SK_DEBUG | 123 #ifdef SK_DEBUG |
| 124 void validate() const { | 124 void validate() const { |
| 125 this->INHERITED::validate(); | 125 this->INHERITED::validate(); |
| 126 | 126 |
| 127 this->validateDesc(); | 127 this->validateDesc(); |
| 128 } | 128 } |
| 129 #else | |
| 130 void validate() const {} | |
| 131 #endif | 129 #endif |
| 130 |
| 132 static GrResourceKey ComputeKey(const GrGpu* gpu, | 131 static GrResourceKey ComputeKey(const GrGpu* gpu, |
| 133 const GrTextureParams* params, | 132 const GrTextureParams* params, |
| 134 const GrTextureDesc& desc, | 133 const GrTextureDesc& desc, |
| 135 const GrCacheID& cacheID); | 134 const GrCacheID& cacheID); |
| 136 static GrResourceKey ComputeScratchKey(const GrTextureDesc& desc); | 135 static GrResourceKey ComputeScratchKey(const GrTextureDesc& desc); |
| 137 static bool NeedsResizing(const GrResourceKey& key); | 136 static bool NeedsResizing(const GrResourceKey& key); |
| 138 static bool NeedsBilerp(const GrResourceKey& key); | 137 static bool NeedsBilerp(const GrResourceKey& key); |
| 139 | 138 |
| 140 protected: | 139 protected: |
| 141 // A texture refs its rt representation but not vice-versa. It is up to | 140 // A texture refs its rt representation but not vice-versa. It is up to |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 GrTexture* setTexture(GrTexture* texture) { | 203 GrTexture* setTexture(GrTexture* texture) { |
| 205 fTexture.reset(SkSafeRef(texture)); | 204 fTexture.reset(SkSafeRef(texture)); |
| 206 return texture; | 205 return texture; |
| 207 } | 206 } |
| 208 private: | 207 private: |
| 209 SkAutoTUnref<GrTexture> fTexture; | 208 SkAutoTUnref<GrTexture> fTexture; |
| 210 SkIPoint fOffset; | 209 SkIPoint fOffset; |
| 211 }; | 210 }; |
| 212 | 211 |
| 213 #endif | 212 #endif |
| OLD | NEW |