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

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

Issue 1789663002: sRGB support in Ganesh. Several pieces: (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Ensure sBGRA is unsupported on ES 2.0. Fix CreateRenderTarget. Created 4 years, 9 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
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 8
9 #include "SkGr.h" 9 #include "SkGr.h"
10 #include "SkGrPriv.h" 10 #include "SkGrPriv.h"
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 switch (ct) { 362 switch (ct) {
363 case kUnknown_SkColorType: 363 case kUnknown_SkColorType:
364 return kUnknown_GrPixelConfig; 364 return kUnknown_GrPixelConfig;
365 case kAlpha_8_SkColorType: 365 case kAlpha_8_SkColorType:
366 return kAlpha_8_GrPixelConfig; 366 return kAlpha_8_GrPixelConfig;
367 case kRGB_565_SkColorType: 367 case kRGB_565_SkColorType:
368 return kRGB_565_GrPixelConfig; 368 return kRGB_565_GrPixelConfig;
369 case kARGB_4444_SkColorType: 369 case kARGB_4444_SkColorType:
370 return kRGBA_4444_GrPixelConfig; 370 return kRGBA_4444_GrPixelConfig;
371 case kRGBA_8888_SkColorType: 371 case kRGBA_8888_SkColorType:
372 //if (kSRGB_SkColorProfileType == pt) { 372 return (kSRGB_SkColorProfileType == pt)
373 // return kSRGBA_8888_GrPixelConfig; 373 ? kSRGBA_8888_GrPixelConfig
bsalomon 2016/03/11 23:16:19 Should we fail if pt is srgb but ct is not rgba_88
Brian Osman 2016/03/17 14:32:04 Done.
374 //} 374 : kRGBA_8888_GrPixelConfig;
375 return kRGBA_8888_GrPixelConfig;
376 case kBGRA_8888_SkColorType: 375 case kBGRA_8888_SkColorType:
377 return kBGRA_8888_GrPixelConfig; 376 return (kSRGB_SkColorProfileType == pt)
377 ? kSBGRA_8888_GrPixelConfig
378 : kBGRA_8888_GrPixelConfig;
378 case kIndex_8_SkColorType: 379 case kIndex_8_SkColorType:
379 return kIndex_8_GrPixelConfig; 380 return kIndex_8_GrPixelConfig;
380 case kGray_8_SkColorType: 381 case kGray_8_SkColorType:
381 return kAlpha_8_GrPixelConfig; // TODO: gray8 support on gpu 382 return kAlpha_8_GrPixelConfig; // TODO: gray8 support on gpu
382 case kRGBA_F16_SkColorType: 383 case kRGBA_F16_SkColorType:
383 return kRGBA_half_GrPixelConfig; 384 return kRGBA_half_GrPixelConfig;
384 } 385 }
385 SkASSERT(0); // shouldn't get here 386 SkASSERT(0); // shouldn't get here
386 return kUnknown_GrPixelConfig; 387 return kUnknown_GrPixelConfig;
387 } 388 }
(...skipping 18 matching lines...) Expand all
406 case kRGBA_8888_GrPixelConfig: 407 case kRGBA_8888_GrPixelConfig:
407 ct = kRGBA_8888_SkColorType; 408 ct = kRGBA_8888_SkColorType;
408 break; 409 break;
409 case kBGRA_8888_GrPixelConfig: 410 case kBGRA_8888_GrPixelConfig:
410 ct = kBGRA_8888_SkColorType; 411 ct = kBGRA_8888_SkColorType;
411 break; 412 break;
412 case kSRGBA_8888_GrPixelConfig: 413 case kSRGBA_8888_GrPixelConfig:
413 ct = kRGBA_8888_SkColorType; 414 ct = kRGBA_8888_SkColorType;
414 pt = kSRGB_SkColorProfileType; 415 pt = kSRGB_SkColorProfileType;
415 break; 416 break;
417 case kSBGRA_8888_GrPixelConfig:
418 ct = kBGRA_8888_SkColorType;
419 pt = kSRGB_SkColorProfileType;
420 break;
416 default: 421 default:
417 return false; 422 return false;
418 } 423 }
419 if (ctOut) { 424 if (ctOut) {
420 *ctOut = ct; 425 *ctOut = ct;
421 } 426 }
422 if (ptOut) { 427 if (ptOut) {
423 *ptOut = pt; 428 *ptOut = pt;
424 } 429 }
425 return true; 430 return true;
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 SkErrorInternals::SetError( kInvalidPaint_SkError, 700 SkErrorInternals::SetError( kInvalidPaint_SkError,
696 "Sorry, I don't understand the filtering " 701 "Sorry, I don't understand the filtering "
697 "mode you asked for. Falling back to " 702 "mode you asked for. Falling back to "
698 "MIPMaps."); 703 "MIPMaps.");
699 textureFilterMode = GrTextureParams::kMipMap_FilterMode; 704 textureFilterMode = GrTextureParams::kMipMap_FilterMode;
700 break; 705 break;
701 706
702 } 707 }
703 return textureFilterMode; 708 return textureFilterMode;
704 } 709 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698