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

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

Issue 1746253002: Progress on gamma-correctness in the GPU backend. Fixed conversion of color and profile type to pix… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase and switch back to kN32 color type. Fixes DM crash on some configs. 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
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | tests/TestConfigParsing.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 8
9 #include "SkGr.h" 9 #include "SkGr.h"
10 10
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 switch (ct) { 363 switch (ct) {
364 case kUnknown_SkColorType: 364 case kUnknown_SkColorType:
365 return kUnknown_GrPixelConfig; 365 return kUnknown_GrPixelConfig;
366 case kAlpha_8_SkColorType: 366 case kAlpha_8_SkColorType:
367 return kAlpha_8_GrPixelConfig; 367 return kAlpha_8_GrPixelConfig;
368 case kRGB_565_SkColorType: 368 case kRGB_565_SkColorType:
369 return kRGB_565_GrPixelConfig; 369 return kRGB_565_GrPixelConfig;
370 case kARGB_4444_SkColorType: 370 case kARGB_4444_SkColorType:
371 return kRGBA_4444_GrPixelConfig; 371 return kRGBA_4444_GrPixelConfig;
372 case kRGBA_8888_SkColorType: 372 case kRGBA_8888_SkColorType:
373 //if (kSRGB_SkColorProfileType == pt) { 373 return (kSRGB_SkColorProfileType == pt)
374 // return kSRGBA_8888_GrPixelConfig; 374 ? kSRGBA_8888_GrPixelConfig
375 //} 375 : kRGBA_8888_GrPixelConfig;
376 return kRGBA_8888_GrPixelConfig;
377 case kBGRA_8888_SkColorType: 376 case kBGRA_8888_SkColorType:
378 return kBGRA_8888_GrPixelConfig; 377 return (kSRGB_SkColorProfileType == pt)
378 ? kSRGBA_8888_GrPixelConfig // Does not preserve byte order!
379 : kBGRA_8888_GrPixelConfig;
379 case kIndex_8_SkColorType: 380 case kIndex_8_SkColorType:
380 return kIndex_8_GrPixelConfig; 381 return kIndex_8_GrPixelConfig;
381 case kGray_8_SkColorType: 382 case kGray_8_SkColorType:
382 return kAlpha_8_GrPixelConfig; // TODO: gray8 support on gpu 383 return kAlpha_8_GrPixelConfig; // TODO: gray8 support on gpu
383 case kRGBA_F16_SkColorType: 384 case kRGBA_F16_SkColorType:
384 return kRGBA_half_GrPixelConfig; 385 return kRGBA_half_GrPixelConfig;
385 } 386 }
386 SkASSERT(0); // shouldn't get here 387 SkASSERT(0); // shouldn't get here
387 return kUnknown_GrPixelConfig; 388 return kUnknown_GrPixelConfig;
388 } 389 }
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 SkErrorInternals::SetError( kInvalidPaint_SkError, 697 SkErrorInternals::SetError( kInvalidPaint_SkError,
697 "Sorry, I don't understand the filtering " 698 "Sorry, I don't understand the filtering "
698 "mode you asked for. Falling back to " 699 "mode you asked for. Falling back to "
699 "MIPMaps."); 700 "MIPMaps.");
700 textureFilterMode = GrTextureParams::kMipMap_FilterMode; 701 textureFilterMode = GrTextureParams::kMipMap_FilterMode;
701 break; 702 break;
702 703
703 } 704 }
704 return textureFilterMode; 705 return textureFilterMode;
705 } 706 }
OLDNEW
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | tests/TestConfigParsing.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698