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

Side by Side Diff: include/gpu/GrTypes.h

Issue 882223003: Move npot resizing out of GrContext and simplify GrContext texture functions. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 10 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 | « include/gpu/GrResourceKey.h ('k') | src/effects/SkBlurMaskFilter.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 2010 Google Inc. 3 * Copyright 2010 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 #ifndef GrTypes_DEFINED 9 #ifndef GrTypes_DEFINED
10 #define GrTypes_DEFINED 10 #define GrTypes_DEFINED
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 case kETC1_GrPixelConfig: 295 case kETC1_GrPixelConfig:
296 case kLATC_GrPixelConfig: 296 case kLATC_GrPixelConfig:
297 case kR11_EAC_GrPixelConfig: 297 case kR11_EAC_GrPixelConfig:
298 case kASTC_12x12_GrPixelConfig: 298 case kASTC_12x12_GrPixelConfig:
299 return true; 299 return true;
300 default: 300 default:
301 return false; 301 return false;
302 } 302 }
303 } 303 }
304 304
305 /** If the pixel config is compressed, return an equivalent uncompressed format. */
306 static inline GrPixelConfig GrMakePixelConfigUncompressed(GrPixelConfig config) {
307 switch (config) {
308 case kIndex_8_GrPixelConfig:
309 case kETC1_GrPixelConfig:
310 case kASTC_12x12_GrPixelConfig:
311 return kRGBA_8888_GrPixelConfig;
312 case kLATC_GrPixelConfig:
313 case kR11_EAC_GrPixelConfig:
314 return kAlpha_8_GrPixelConfig;
315 default:
316 SkASSERT(!GrPixelConfigIsCompressed(config));
317 return config;
318 }
319 }
320
305 // Returns true if the pixel config is 32 bits per pixel 321 // Returns true if the pixel config is 32 bits per pixel
306 static inline bool GrPixelConfigIs8888(GrPixelConfig config) { 322 static inline bool GrPixelConfigIs8888(GrPixelConfig config) {
307 switch (config) { 323 switch (config) {
308 case kRGBA_8888_GrPixelConfig: 324 case kRGBA_8888_GrPixelConfig:
309 case kBGRA_8888_GrPixelConfig: 325 case kBGRA_8888_GrPixelConfig:
310 case kSRGBA_8888_GrPixelConfig: 326 case kSRGBA_8888_GrPixelConfig:
311 return true; 327 return true;
312 default: 328 default:
313 return false; 329 return false;
314 } 330 }
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 public: 655 public:
640 GrAutoMalloc() : INHERITED() {} 656 GrAutoMalloc() : INHERITED() {}
641 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} 657 explicit GrAutoMalloc(size_t size) : INHERITED(size) {}
642 virtual ~GrAutoMalloc() {} 658 virtual ~GrAutoMalloc() {}
643 private: 659 private:
644 typedef GrAutoMallocBaseType INHERITED; 660 typedef GrAutoMallocBaseType INHERITED;
645 }; 661 };
646 662
647 #undef GrAutoMallocBaseType 663 #undef GrAutoMallocBaseType
648 #endif 664 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrResourceKey.h ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698