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

Side by Side Diff: src/core/SkBlitter.cpp

Issue 2075853002: remove colorprofiletype from imageinfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: continue writing an enum, with forward-mode for flattening the actual profile Created 4 years, 6 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/core/SkBitmapScaler.cpp ('k') | src/core/SkImageInfo.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 #include "SkBlitter.h" 8 #include "SkBlitter.h"
9 #include "SkAntiRun.h" 9 #include "SkAntiRun.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 }; 781 };
782 782
783 /////////////////////////////////////////////////////////////////////////////// 783 ///////////////////////////////////////////////////////////////////////////////
784 784
785 #include "SkCoreBlitters.h" 785 #include "SkCoreBlitters.h"
786 786
787 SkShader::ContextRec::DstType SkBlitter::PreferredShaderDest(const SkImageInfo& dstInfo) { 787 SkShader::ContextRec::DstType SkBlitter::PreferredShaderDest(const SkImageInfo& dstInfo) {
788 #ifdef SK_FORCE_PM4f_FOR_L32_BLITS 788 #ifdef SK_FORCE_PM4f_FOR_L32_BLITS
789 return SkShader::ContextRec::kPM4f_DstType; 789 return SkShader::ContextRec::kPM4f_DstType;
790 #else 790 #else
791 return (dstInfo.isSRGB() || dstInfo.colorType() == kRGBA_F16_SkColorType) 791 return (dstInfo.gammaCloseToSRGB() || dstInfo.colorType() == kRGBA_F16_SkCol orType)
792 ? SkShader::ContextRec::kPM4f_DstType 792 ? SkShader::ContextRec::kPM4f_DstType
793 : SkShader::ContextRec::kPMColor_DstType; 793 : SkShader::ContextRec::kPMColor_DstType;
794 #endif 794 #endif
795 } 795 }
796 796
797 SkBlitter* SkBlitter::Choose(const SkPixmap& device, 797 SkBlitter* SkBlitter::Choose(const SkPixmap& device,
798 const SkMatrix& matrix, 798 const SkMatrix& matrix,
799 const SkPaint& origPaint, 799 const SkPaint& origPaint,
800 SkTBlitterAllocator* allocator, 800 SkTBlitterAllocator* allocator,
801 bool drawCoverage) { 801 bool drawCoverage) {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 break; 915 break;
916 916
917 case kRGB_565_SkColorType: 917 case kRGB_565_SkColorType:
918 blitter = SkBlitter_ChooseD565(device, *paint, shaderContext, alloca tor); 918 blitter = SkBlitter_ChooseD565(device, *paint, shaderContext, alloca tor);
919 break; 919 break;
920 920
921 case kN32_SkColorType: 921 case kN32_SkColorType:
922 #ifdef SK_FORCE_PM4f_FOR_L32_BLITS 922 #ifdef SK_FORCE_PM4f_FOR_L32_BLITS
923 if (true) 923 if (true)
924 #else 924 #else
925 if (device.info().isSRGB()) 925 if (device.info().gammaCloseToSRGB())
926 #endif 926 #endif
927 { 927 {
928 blitter = SkBlitter_ARGB32_Create(device, *paint, shaderContext, allocator); 928 blitter = SkBlitter_ARGB32_Create(device, *paint, shaderContext, allocator);
929 } else { 929 } else {
930 if (shader) { 930 if (shader) {
931 blitter = allocator->createT<SkARGB32_Shader_Blitter>( 931 blitter = allocator->createT<SkARGB32_Shader_Blitter>(
932 device, *paint, shaderContext); 932 device, *paint, shaderContext);
933 } else if (paint->getColor() == SK_ColorBLACK) { 933 } else if (paint->getColor() == SK_ColorBLACK) {
934 blitter = allocator->createT<SkARGB32_Black_Blitter>(device, *paint); 934 blitter = allocator->createT<SkARGB32_Black_Blitter>(device, *paint);
935 } else if (paint->getAlpha() == 0xFF) { 935 } else if (paint->getAlpha() == 0xFF) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 fShaderContext->~Context(); 1005 fShaderContext->~Context();
1006 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); 1006 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext);
1007 if (nullptr == ctx) { 1007 if (nullptr == ctx) {
1008 // Need a valid context in fShaderContext's storage, so we can later (or our caller) call 1008 // Need a valid context in fShaderContext's storage, so we can later (or our caller) call
1009 // the in-place destructor. 1009 // the in-place destructor.
1010 new (fShaderContext) SkZeroShaderContext(*fShader, rec); 1010 new (fShaderContext) SkZeroShaderContext(*fShader, rec);
1011 return false; 1011 return false;
1012 } 1012 }
1013 return true; 1013 return true;
1014 } 1014 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapScaler.cpp ('k') | src/core/SkImageInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698