| 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" |
| 11 | 11 |
| 12 #include "GrContext.h" | 12 #include "GrContext.h" |
| 13 #include "GrDrawTargetCaps.h" | 13 #include "GrDrawTargetCaps.h" |
| 14 #include "GrGpu.h" | 14 #include "GrGpu.h" |
| 15 #include "GrRenderTarget.h" | 15 #include "GrRenderTarget.h" |
| 16 #include "GrResourceCache.h" | 16 #include "GrResourceCache.h" |
| 17 | 17 |
| 18 SK_DEFINE_INST_COUNT(GrTexture) | |
| 19 | |
| 20 GrTexture::~GrTexture() { | 18 GrTexture::~GrTexture() { |
| 21 if (NULL != fRenderTarget.get()) { | 19 if (NULL != fRenderTarget.get()) { |
| 22 fRenderTarget.get()->owningTextureDestroyed(); | 20 fRenderTarget.get()->owningTextureDestroyed(); |
| 23 } | 21 } |
| 24 } | 22 } |
| 25 | 23 |
| 26 /** | 24 /** |
| 27 * This method allows us to interrupt the normal deletion process and place | 25 * This method allows us to interrupt the normal deletion process and place |
| 28 * textures back in the texture cache when their ref count goes to zero. | 26 * textures back in the texture cache when their ref count goes to zero. |
| 29 */ | 27 */ |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 return GrResourceKey(cacheID, texture_resource_type(), 0); | 186 return GrResourceKey(cacheID, texture_resource_type(), 0); |
| 189 } | 187 } |
| 190 | 188 |
| 191 bool GrTexture::NeedsResizing(const GrResourceKey& key) { | 189 bool GrTexture::NeedsResizing(const GrResourceKey& key) { |
| 192 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); | 190 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); |
| 193 } | 191 } |
| 194 | 192 |
| 195 bool GrTexture::NeedsBilerp(const GrResourceKey& key) { | 193 bool GrTexture::NeedsBilerp(const GrResourceKey& key) { |
| 196 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); | 194 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); |
| 197 } | 195 } |
| OLD | NEW |