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

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

Issue 1634273002: float components in xfermodes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: disable blitter for official checkin Created 4 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
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"
11 #include "SkColorFilter.h" 11 #include "SkColorFilter.h"
12 #include "SkReadBuffer.h" 12 #include "SkReadBuffer.h"
13 #include "SkWriteBuffer.h" 13 #include "SkWriteBuffer.h"
14 #include "SkMask.h" 14 #include "SkMask.h"
15 #include "SkMaskFilter.h" 15 #include "SkMaskFilter.h"
16 #include "SkString.h" 16 #include "SkString.h"
17 #include "SkTLazy.h" 17 #include "SkTLazy.h"
18 #include "SkUtils.h" 18 #include "SkUtils.h"
19 #include "SkXfermode.h" 19 #include "SkXfermode.h"
20 #include "SkXfermodeInterpretation.h" 20 #include "SkXfermodeInterpretation.h"
21 21
22 // define this for testing srgb blits
23 //#define SK_SUPPORT_SRGB_RASTER
24
25 #ifdef SK_SUPPORT_SRGB_RASTER
26 #define ALLOW_SRGB true
27 #else
28 #define ALLOW_SRGB false
29 #endif
30
22 SkBlitter::~SkBlitter() {} 31 SkBlitter::~SkBlitter() {}
23 32
24 bool SkBlitter::isNullBlitter() const { return false; } 33 bool SkBlitter::isNullBlitter() const { return false; }
25 34
26 bool SkBlitter::resetShaderContext(const SkShader::ContextRec&) { 35 bool SkBlitter::resetShaderContext(const SkShader::ContextRec&) {
27 return true; 36 return true;
28 } 37 }
29 38
30 SkShader::Context* SkBlitter::getShaderContext() const { 39 SkShader::Context* SkBlitter::getShaderContext() const {
31 return nullptr; 40 return nullptr;
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 blitter = allocator->createT<SkA8_Blitter>(device, *paint); 907 blitter = allocator->createT<SkA8_Blitter>(device, *paint);
899 } 908 }
900 break; 909 break;
901 910
902 case kRGB_565_SkColorType: 911 case kRGB_565_SkColorType:
903 blitter = SkBlitter_ChooseD565(device, *paint, shaderContext, alloca tor); 912 blitter = SkBlitter_ChooseD565(device, *paint, shaderContext, alloca tor);
904 break; 913 break;
905 914
906 case kN32_SkColorType: 915 case kN32_SkColorType:
907 if (shader) { 916 if (shader) {
908 blitter = allocator->createT<SkARGB32_Shader_Blitter>( 917 if (shaderContext->supports4f() && ALLOW_SRGB) {
909 device, *paint, shaderContext); 918 blitter = allocator->createT<SkARGB32_Shader4f_Blitter>(
919 device, *paint , shaderContext);
920 } else {
921 blitter = allocator->createT<SkARGB32_Shader_Blitter>(
922 device, *paint, shaderContext);
923 }
910 } else if (paint->getColor() == SK_ColorBLACK) { 924 } else if (paint->getColor() == SK_ColorBLACK) {
911 blitter = allocator->createT<SkARGB32_Black_Blitter>(device, *pa int); 925 blitter = allocator->createT<SkARGB32_Black_Blitter>(device, *pa int);
912 } else if (paint->getAlpha() == 0xFF) { 926 } else if (paint->getAlpha() == 0xFF) {
913 blitter = allocator->createT<SkARGB32_Opaque_Blitter>(device, *p aint); 927 blitter = allocator->createT<SkARGB32_Opaque_Blitter>(device, *p aint);
914 } else { 928 } else {
915 blitter = allocator->createT<SkARGB32_Blitter>(device, *paint); 929 blitter = allocator->createT<SkARGB32_Blitter>(device, *paint);
916 } 930 }
917 break; 931 break;
918 932
919 default: 933 default:
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 fShaderContext->~Context(); 987 fShaderContext->~Context();
974 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); 988 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext);
975 if (nullptr == ctx) { 989 if (nullptr == ctx) {
976 // Need a valid context in fShaderContext's storage, so we can later (or our caller) call 990 // Need a valid context in fShaderContext's storage, so we can later (or our caller) call
977 // the in-place destructor. 991 // the in-place destructor.
978 new (fShaderContext) SkZeroShaderContext(*fShader, rec); 992 new (fShaderContext) SkZeroShaderContext(*fShader, rec);
979 return false; 993 return false;
980 } 994 }
981 return true; 995 return true;
982 } 996 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698