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 "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } | 46 } |
47 | 47 |
48 if (this->texturePriv().hasMipMaps()) { | 48 if (this->texturePriv().hasMipMaps()) { |
49 // We don't have to worry about the mipmaps being a different size than | 49 // We don't have to worry about the mipmaps being a different size than |
50 // we'd expect because we never change fDesc.fWidth/fHeight. | 50 // we'd expect because we never change fDesc.fWidth/fHeight. |
51 textureSize *= 2; | 51 textureSize *= 2; |
52 } | 52 } |
53 return textureSize; | 53 return textureSize; |
54 } | 54 } |
55 | 55 |
56 | |
57 void GrTexture::onRelease() { | 56 void GrTexture::onRelease() { |
58 SkASSERT(!this->texturePriv().isSetFlag((GrTextureFlags) kReturnToCache_Flag
Bit)); | 57 SkASSERT(!this->texturePriv().isSetFlag((GrTextureFlags) kReturnToCache_Flag
Bit)); |
59 INHERITED::onRelease(); | 58 INHERITED::onRelease(); |
60 } | 59 } |
61 | 60 |
62 void GrTexture::onAbandon() { | 61 void GrTexture::onAbandon() { |
63 if (fRenderTarget.get()) { | 62 if (fRenderTarget.get()) { |
64 fRenderTarget->abandon(); | 63 fRenderTarget->abandon(); |
65 } | 64 } |
66 INHERITED::onAbandon(); | 65 INHERITED::onAbandon(); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 return GrResourceKey(cacheID, ResourceType(), 0); | 175 return GrResourceKey(cacheID, ResourceType(), 0); |
177 } | 176 } |
178 | 177 |
179 bool GrTexturePriv::NeedsResizing(const GrResourceKey& key) { | 178 bool GrTexturePriv::NeedsResizing(const GrResourceKey& key) { |
180 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); | 179 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); |
181 } | 180 } |
182 | 181 |
183 bool GrTexturePriv::NeedsBilerp(const GrResourceKey& key) { | 182 bool GrTexturePriv::NeedsBilerp(const GrResourceKey& key) { |
184 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); | 183 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); |
185 } | 184 } |
OLD | NEW |