OLD | NEW |
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 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 } | 931 } |
932 } | 932 } |
933 break; | 933 break; |
934 | 934 |
935 case kRGBA_F16_SkColorType: | 935 case kRGBA_F16_SkColorType: |
936 // kU16_SkColorType: | 936 // kU16_SkColorType: |
937 blitter = SkBlitter_ARGB64_Create(device, *paint, shaderContext, all
ocator); | 937 blitter = SkBlitter_ARGB64_Create(device, *paint, shaderContext, all
ocator); |
938 break; | 938 break; |
939 | 939 |
940 default: | 940 default: |
941 SkDEBUGFAIL("unsupported device config"); | |
942 blitter = allocator->createT<SkNullBlitter>(); | |
943 break; | 941 break; |
944 } | 942 } |
945 | 943 |
| 944 if (!blitter) { |
| 945 blitter = allocator->createT<SkNullBlitter>(); |
| 946 } |
| 947 |
946 if (shader3D) { | 948 if (shader3D) { |
947 SkBlitter* innerBlitter = blitter; | 949 SkBlitter* innerBlitter = blitter; |
948 // innerBlitter was allocated by allocator, which will delete it. | 950 // innerBlitter was allocated by allocator, which will delete it. |
949 // We know shaderContext or its proxies is of type Sk3DShaderContext, so
we need to | 951 // We know shaderContext or its proxies is of type Sk3DShaderContext, so
we need to |
950 // wrapper the blitter to notify it when we see an emboss mask. | 952 // wrapper the blitter to notify it when we see an emboss mask. |
951 blitter = allocator->createT<Sk3DBlitter>(innerBlitter, shaderContext); | 953 blitter = allocator->createT<Sk3DBlitter>(innerBlitter, shaderContext); |
952 } | 954 } |
953 return blitter; | 955 return blitter; |
954 } | 956 } |
955 | 957 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 fShaderContext->~Context(); | 997 fShaderContext->~Context(); |
996 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); | 998 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); |
997 if (nullptr == ctx) { | 999 if (nullptr == ctx) { |
998 // Need a valid context in fShaderContext's storage, so we can later (or
our caller) call | 1000 // Need a valid context in fShaderContext's storage, so we can later (or
our caller) call |
999 // the in-place destructor. | 1001 // the in-place destructor. |
1000 new (fShaderContext) SkZeroShaderContext(*fShader, rec); | 1002 new (fShaderContext) SkZeroShaderContext(*fShader, rec); |
1001 return false; | 1003 return false; |
1002 } | 1004 } |
1003 return true; | 1005 return true; |
1004 } | 1006 } |
OLD | NEW |