| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 kBilerp_TextureFlag = 0x2, | 165 kBilerp_TextureFlag = 0x2, |
| 166 }; | 166 }; |
| 167 | 167 |
| 168 namespace { | 168 namespace { |
| 169 GrResourceKey::ResourceFlags get_texture_flags(const GrGpu* gpu, | 169 GrResourceKey::ResourceFlags get_texture_flags(const GrGpu* gpu, |
| 170 const GrTextureParams* params, | 170 const GrTextureParams* params, |
| 171 const GrTextureDesc& desc) { | 171 const GrTextureDesc& desc) { |
| 172 GrResourceKey::ResourceFlags flags = 0; | 172 GrResourceKey::ResourceFlags flags = 0; |
| 173 bool tiled = NULL != params && params->isTiled(); | 173 bool tiled = NULL != params && params->isTiled(); |
| 174 if (tiled && !gpu->caps()->npotTextureTileSupport()) { | 174 if (tiled && !gpu->caps()->npotTextureTileSupport()) { |
| 175 if (!GrIsPow2(desc.fWidth) || !GrIsPow2(desc.fHeight)) { | 175 if (!SkIsPow2(desc.fWidth) || !SkIsPow2(desc.fHeight)) { |
| 176 flags |= kStretchToPOT_TextureFlag; | 176 flags |= kStretchToPOT_TextureFlag; |
| 177 switch(params->filterMode()) { | 177 switch(params->filterMode()) { |
| 178 case GrTextureParams::kNone_FilterMode: | 178 case GrTextureParams::kNone_FilterMode: |
| 179 break; | 179 break; |
| 180 case GrTextureParams::kBilerp_FilterMode: | 180 case GrTextureParams::kBilerp_FilterMode: |
| 181 case GrTextureParams::kMipMap_FilterMode: | 181 case GrTextureParams::kMipMap_FilterMode: |
| 182 flags |= kBilerp_TextureFlag; | 182 flags |= kBilerp_TextureFlag; |
| 183 break; | 183 break; |
| 184 } | 184 } |
| 185 } | 185 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 return GrResourceKey(cacheID, texture_resource_type(), 0); | 235 return GrResourceKey(cacheID, texture_resource_type(), 0); |
| 236 } | 236 } |
| 237 | 237 |
| 238 bool GrTextureImpl::NeedsResizing(const GrResourceKey& key) { | 238 bool GrTextureImpl::NeedsResizing(const GrResourceKey& key) { |
| 239 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); | 239 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); |
| 240 } | 240 } |
| 241 | 241 |
| 242 bool GrTextureImpl::NeedsBilerp(const GrResourceKey& key) { | 242 bool GrTextureImpl::NeedsBilerp(const GrResourceKey& key) { |
| 243 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); | 243 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); |
| 244 } | 244 } |
| OLD | NEW |