OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkBlitRow.h" | 10 #include "SkBlitRow.h" |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 SkBlitter* SkBlitter_ChooseD565(const SkBitmap& device, const SkPaint& paint, | 1030 SkBlitter* SkBlitter_ChooseD565(const SkBitmap& device, const SkPaint& paint, |
1031 SkShader::Context* shaderContext, | 1031 SkShader::Context* shaderContext, |
1032 SkTBlitterAllocator* allocator) { | 1032 SkTBlitterAllocator* allocator) { |
1033 SkASSERT(allocator != NULL); | 1033 SkASSERT(allocator != NULL); |
1034 | 1034 |
1035 SkBlitter* blitter; | 1035 SkBlitter* blitter; |
1036 SkShader* shader = paint.getShader(); | 1036 SkShader* shader = paint.getShader(); |
1037 SkXfermode* mode = paint.getXfermode(); | 1037 SkXfermode* mode = paint.getXfermode(); |
1038 | 1038 |
1039 // we require a shader if there is an xfermode, handled by our caller | 1039 // we require a shader if there is an xfermode, handled by our caller |
1040 SkASSERT(NULL == mode || NULL != shader); | 1040 SkASSERT(NULL == mode || shader); |
1041 | 1041 |
1042 if (shader) { | 1042 if (shader) { |
1043 SkASSERT(shaderContext != NULL); | 1043 SkASSERT(shaderContext != NULL); |
1044 if (mode) { | 1044 if (mode) { |
1045 blitter = allocator->createT<SkRGB16_Shader_Xfermode_Blitter>(device
, paint, | 1045 blitter = allocator->createT<SkRGB16_Shader_Xfermode_Blitter>(device
, paint, |
1046 shader
Context); | 1046 shader
Context); |
1047 } else if (shaderContext->canCallShadeSpan16()) { | 1047 } else if (shaderContext->canCallShadeSpan16()) { |
1048 blitter = allocator->createT<SkRGB16_Shader16_Blitter>(device, paint
, shaderContext); | 1048 blitter = allocator->createT<SkRGB16_Shader16_Blitter>(device, paint
, shaderContext); |
1049 } else { | 1049 } else { |
1050 blitter = allocator->createT<SkRGB16_Shader_Blitter>(device, paint,
shaderContext); | 1050 blitter = allocator->createT<SkRGB16_Shader_Blitter>(device, paint,
shaderContext); |
1051 } | 1051 } |
1052 } else { | 1052 } else { |
1053 // no shader, no xfermode, (and we always ignore colorfilter) | 1053 // no shader, no xfermode, (and we always ignore colorfilter) |
1054 SkColor color = paint.getColor(); | 1054 SkColor color = paint.getColor(); |
1055 if (0 == SkColorGetA(color)) { | 1055 if (0 == SkColorGetA(color)) { |
1056 blitter = allocator->createT<SkNullBlitter>(); | 1056 blitter = allocator->createT<SkNullBlitter>(); |
1057 #ifdef USE_BLACK_BLITTER | 1057 #ifdef USE_BLACK_BLITTER |
1058 } else if (SK_ColorBLACK == color) { | 1058 } else if (SK_ColorBLACK == color) { |
1059 blitter = allocator->createT<SkRGB16_Black_Blitter>(device, paint); | 1059 blitter = allocator->createT<SkRGB16_Black_Blitter>(device, paint); |
1060 #endif | 1060 #endif |
1061 } else if (0xFF == SkColorGetA(color)) { | 1061 } else if (0xFF == SkColorGetA(color)) { |
1062 blitter = allocator->createT<SkRGB16_Opaque_Blitter>(device, paint); | 1062 blitter = allocator->createT<SkRGB16_Opaque_Blitter>(device, paint); |
1063 } else { | 1063 } else { |
1064 blitter = allocator->createT<SkRGB16_Blitter>(device, paint); | 1064 blitter = allocator->createT<SkRGB16_Blitter>(device, paint); |
1065 } | 1065 } |
1066 } | 1066 } |
1067 | 1067 |
1068 return blitter; | 1068 return blitter; |
1069 } | 1069 } |
OLD | NEW |