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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 */ | 129 */ |
130 kFilter_TextureFlag = 0x2, | 130 kFilter_TextureFlag = 0x2, |
131 }; | 131 }; |
132 | 132 |
133 namespace { | 133 namespace { |
134 GrResourceKey::ResourceFlags get_texture_flags(const GrGpu* gpu, | 134 GrResourceKey::ResourceFlags get_texture_flags(const GrGpu* gpu, |
135 const GrTextureParams* params, | 135 const GrTextureParams* params, |
136 const GrTextureDesc& desc) { | 136 const GrTextureDesc& desc) { |
137 GrResourceKey::ResourceFlags flags = 0; | 137 GrResourceKey::ResourceFlags flags = 0; |
138 bool tiled = NULL != params && params->isTiled(); | 138 bool tiled = NULL != params && params->isTiled(); |
139 if (tiled && !gpu->getCaps().npotTextureTileSupport()) { | 139 if (tiled && !gpu->caps()->npotTextureTileSupport()) { |
140 if (!GrIsPow2(desc.fWidth) || !GrIsPow2(desc.fHeight)) { | 140 if (!GrIsPow2(desc.fWidth) || !GrIsPow2(desc.fHeight)) { |
141 flags |= kStretchToPOT_TextureFlag; | 141 flags |= kStretchToPOT_TextureFlag; |
142 if (params->isBilerp()) { | 142 if (params->isBilerp()) { |
143 flags |= kFilter_TextureFlag; | 143 flags |= kFilter_TextureFlag; |
144 } | 144 } |
145 } | 145 } |
146 } | 146 } |
147 return flags; | 147 return flags; |
148 } | 148 } |
149 | 149 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 return GrResourceKey(cacheID, texture_resource_type(), 0); | 193 return GrResourceKey(cacheID, texture_resource_type(), 0); |
194 } | 194 } |
195 | 195 |
196 bool GrTexture::NeedsResizing(const GrResourceKey& key) { | 196 bool GrTexture::NeedsResizing(const GrResourceKey& key) { |
197 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); | 197 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); |
198 } | 198 } |
199 | 199 |
200 bool GrTexture::NeedsFiltering(const GrResourceKey& key) { | 200 bool GrTexture::NeedsFiltering(const GrResourceKey& key) { |
201 return SkToBool(key.getResourceFlags() & kFilter_TextureFlag); | 201 return SkToBool(key.getResourceFlags() & kFilter_TextureFlag); |
202 } | 202 } |
OLD | NEW |