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 24 matching lines...) Expand all Loading... |
35 this->fRefCnt = 1; // restore ref count to initial setting | 35 this->fRefCnt = 1; // restore ref count to initial setting |
36 | 36 |
37 nonConstThis->resetFlag((GrTextureFlags) kReturnToCache_FlagBit); | 37 nonConstThis->resetFlag((GrTextureFlags) kReturnToCache_FlagBit); |
38 nonConstThis->INHERITED::getContext()->addExistingTextureToCache(nonCons
tThis); | 38 nonConstThis->INHERITED::getContext()->addExistingTextureToCache(nonCons
tThis); |
39 | 39 |
40 // Note: "this" texture might be freed inside addExistingTextureToCache | 40 // Note: "this" texture might be freed inside addExistingTextureToCache |
41 // if it is purged. | 41 // if it is purged. |
42 return; | 42 return; |
43 } | 43 } |
44 | 44 |
| 45 SkASSERT(0 == this->getDeferredRefCount()); |
45 this->INHERITED::internal_dispose(); | 46 this->INHERITED::internal_dispose(); |
46 } | 47 } |
47 | 48 |
48 bool GrTexture::readPixels(int left, int top, int width, int height, | 49 bool GrTexture::readPixels(int left, int top, int width, int height, |
49 GrPixelConfig config, void* buffer, | 50 GrPixelConfig config, void* buffer, |
50 size_t rowBytes, uint32_t pixelOpsFlags) { | 51 size_t rowBytes, uint32_t pixelOpsFlags) { |
51 // go through context so that all necessary flushing occurs | 52 // go through context so that all necessary flushing occurs |
52 GrContext* context = this->getContext(); | 53 GrContext* context = this->getContext(); |
53 if (NULL == context) { | 54 if (NULL == context) { |
54 return false; | 55 return false; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 return GrResourceKey(cacheID, texture_resource_type(), 0); | 188 return GrResourceKey(cacheID, texture_resource_type(), 0); |
188 } | 189 } |
189 | 190 |
190 bool GrTexture::NeedsResizing(const GrResourceKey& key) { | 191 bool GrTexture::NeedsResizing(const GrResourceKey& key) { |
191 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); | 192 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); |
192 } | 193 } |
193 | 194 |
194 bool GrTexture::NeedsBilerp(const GrResourceKey& key) { | 195 bool GrTexture::NeedsBilerp(const GrResourceKey& key) { |
195 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); | 196 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); |
196 } | 197 } |
OLD | NEW |