Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: src/gpu/GrTexture.cpp

Issue 330763008: Add R11 EAC pixel config (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Finding the size should be easy to do Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698