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

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

Issue 1525193002: Set GL_PACK_ALIGNMENT before calling glReadPixels (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 | « no previous file | src/gpu/gl/GrGLGpu.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 * Copyright 2010 Google Inc. 2 * Copyright 2010 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrTypes_DEFINED 8 #ifndef GrTypes_DEFINED
9 #define GrTypes_DEFINED 9 #define GrTypes_DEFINED
10 10
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 return 4; 356 return 4;
357 case kRGBA_half_GrPixelConfig: 357 case kRGBA_half_GrPixelConfig:
358 return 8; 358 return 8;
359 case kRGBA_float_GrPixelConfig: 359 case kRGBA_float_GrPixelConfig:
360 return 16; 360 return 16;
361 default: 361 default:
362 return 0; 362 return 0;
363 } 363 }
364 } 364 }
365 365
366 static inline size_t GrUnpackAlignment(GrPixelConfig config) {
367 SkASSERT(!GrPixelConfigIsCompressed(config));
368 switch (config) {
369 case kAlpha_8_GrPixelConfig:
370 return 1;
371 case kRGB_565_GrPixelConfig:
372 case kRGBA_4444_GrPixelConfig:
373 case kAlpha_half_GrPixelConfig:
374 case kRGBA_half_GrPixelConfig:
375 return 2;
376 case kRGBA_8888_GrPixelConfig:
377 case kBGRA_8888_GrPixelConfig:
378 case kSRGBA_8888_GrPixelConfig:
379 case kRGBA_float_GrPixelConfig:
380 return 4;
381 default:
382 return 0;
383 }
384 }
385
386 static inline bool GrPixelConfigIsOpaque(GrPixelConfig config) { 366 static inline bool GrPixelConfigIsOpaque(GrPixelConfig config) {
387 switch (config) { 367 switch (config) {
388 case kETC1_GrPixelConfig: 368 case kETC1_GrPixelConfig:
389 case kRGB_565_GrPixelConfig: 369 case kRGB_565_GrPixelConfig:
390 return true; 370 return true;
391 default: 371 default:
392 return false; 372 return false;
393 } 373 }
394 } 374 }
395 375
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 return 4 * width * height; 618 return 4 * width * height;
639 } 619 }
640 } 620 }
641 621
642 /** 622 /**
643 * This value translates to reseting all the context state for any backend. 623 * This value translates to reseting all the context state for any backend.
644 */ 624 */
645 static const uint32_t kAll_GrBackendState = 0xffffffff; 625 static const uint32_t kAll_GrBackendState = 0xffffffff;
646 626
647 #endif 627 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698