| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 GrBytesPerPixel(fDesc.fConfig); | 64 GrBytesPerPixel(fDesc.fConfig); |
| 65 | 65 |
| 66 if (GrPixelConfigIsCompressed(fDesc.fConfig)) { | 66 if (GrPixelConfigIsCompressed(fDesc.fConfig)) { |
| 67 // Figure out the width and height corresponding to the data... | 67 // Figure out the width and height corresponding to the data... |
| 68 | 68 |
| 69 // Both of the available formats (ETC1 and LATC) have 4x4 | 69 // Both of the available formats (ETC1 and LATC) have 4x4 |
| 70 // blocks that compress down to 8 bytes. | 70 // blocks that compress down to 8 bytes. |
| 71 switch(fDesc.fConfig) { | 71 switch(fDesc.fConfig) { |
| 72 case kETC1_GrPixelConfig: | 72 case kETC1_GrPixelConfig: |
| 73 case kLATC_GrPixelConfig: | 73 case kLATC_GrPixelConfig: |
| 74 case kR11_EAC_GrPixelConfig: |
| 74 SkASSERT((fDesc.fWidth & 3) == 0); | 75 SkASSERT((fDesc.fWidth & 3) == 0); |
| 75 SkASSERT((fDesc.fHeight & 3) == 0); | 76 SkASSERT((fDesc.fHeight & 3) == 0); |
| 76 textureSize = (fDesc.fWidth >> 2) * (fDesc.fHeight >> 2) * 8; | 77 textureSize = (fDesc.fWidth >> 2) * (fDesc.fHeight >> 2) * 8; |
| 77 break; | 78 break; |
| 78 | 79 |
| 79 default: | 80 default: |
| 80 SkFAIL("Unknown compressed config"); | 81 SkFAIL("Unknown compressed config"); |
| 81 } | 82 } |
| 82 } | 83 } |
| 83 | 84 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 return GrResourceKey(cacheID, texture_resource_type(), 0); | 236 return GrResourceKey(cacheID, texture_resource_type(), 0); |
| 236 } | 237 } |
| 237 | 238 |
| 238 bool GrTextureImpl::NeedsResizing(const GrResourceKey& key) { | 239 bool GrTextureImpl::NeedsResizing(const GrResourceKey& key) { |
| 239 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); | 240 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); |
| 240 } | 241 } |
| 241 | 242 |
| 242 bool GrTextureImpl::NeedsBilerp(const GrResourceKey& key) { | 243 bool GrTextureImpl::NeedsBilerp(const GrResourceKey& key) { |
| 243 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); | 244 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); |
| 244 } | 245 } |
| OLD | NEW |