| 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 | 9 |
| 10 #include "GrTexture.h" | 10 #include "GrTexture.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 bool renderTarget = 0 != (desc.fFlags & kRenderTarget_GrTextureFlagBit); | 200 bool renderTarget = 0 != (desc.fFlags & kRenderTarget_GrTextureFlagBit); |
| 201 if (kDefault_GrSurfaceOrigin == desc.fOrigin) { | 201 if (kDefault_GrSurfaceOrigin == desc.fOrigin) { |
| 202 return renderTarget ? kBottomLeft_GrSurfaceOrigin : kTopLeft_GrSurfaceOr
igin; | 202 return renderTarget ? kBottomLeft_GrSurfaceOrigin : kTopLeft_GrSurfaceOr
igin; |
| 203 } else { | 203 } else { |
| 204 return desc.fOrigin; | 204 return desc.fOrigin; |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 } | 207 } |
| 208 | 208 |
| 209 ////////////////////////////////////////////////////////////////////////////// | 209 ////////////////////////////////////////////////////////////////////////////// |
| 210 GrTextureImpl::GrTextureImpl(GrGpu* gpu, bool isWrapped, const GrTextureDesc& de
sc) |
| 211 : INHERITED(gpu, isWrapped, desc) |
| 212 , fMipMapsStatus(kNotAllocated_MipMapsStatus) { |
| 213 this->setScratchKey(ComputeScratchKey(desc)); |
| 214 } |
| 210 | 215 |
| 211 GrResourceKey GrTextureImpl::ComputeKey(const GrGpu* gpu, | 216 GrResourceKey GrTextureImpl::ComputeKey(const GrGpu* gpu, |
| 212 const GrTextureParams* params, | 217 const GrTextureParams* params, |
| 213 const GrTextureDesc& desc, | 218 const GrTextureDesc& desc, |
| 214 const GrCacheID& cacheID) { | 219 const GrCacheID& cacheID) { |
| 215 GrResourceKey::ResourceFlags flags = get_texture_flags(gpu, params, desc); | 220 GrResourceKey::ResourceFlags flags = get_texture_flags(gpu, params, desc); |
| 216 return GrResourceKey(cacheID, texture_resource_type(), flags); | 221 return GrResourceKey(cacheID, texture_resource_type(), flags); |
| 217 } | 222 } |
| 218 | 223 |
| 219 GrResourceKey GrTextureImpl::ComputeScratchKey(const GrTextureDesc& desc) { | 224 GrResourceKey GrTextureImpl::ComputeScratchKey(const GrTextureDesc& desc) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 235 return GrResourceKey(cacheID, texture_resource_type(), 0); | 240 return GrResourceKey(cacheID, texture_resource_type(), 0); |
| 236 } | 241 } |
| 237 | 242 |
| 238 bool GrTextureImpl::NeedsResizing(const GrResourceKey& key) { | 243 bool GrTextureImpl::NeedsResizing(const GrResourceKey& key) { |
| 239 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); | 244 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); |
| 240 } | 245 } |
| 241 | 246 |
| 242 bool GrTextureImpl::NeedsBilerp(const GrResourceKey& key) { | 247 bool GrTextureImpl::NeedsBilerp(const GrResourceKey& key) { |
| 243 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); | 248 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); |
| 244 } | 249 } |
| OLD | NEW |