| 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 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 uint32_t shaderFlags = fShaderFlags; | 819 uint32_t shaderFlags = fShaderFlags; |
| 820 // shaders take care of global alpha, so we never set it in SkBlitRow | 820 // shaders take care of global alpha, so we never set it in SkBlitRow |
| 821 if (!(shaderFlags & SkShader::kOpaqueAlpha_Flag)) { | 821 if (!(shaderFlags & SkShader::kOpaqueAlpha_Flag)) { |
| 822 flags |= SkBlitRow::kSrcPixelAlpha_Flag; | 822 flags |= SkBlitRow::kSrcPixelAlpha_Flag; |
| 823 } | 823 } |
| 824 // don't dither if the shader is really 16bit | 824 // don't dither if the shader is really 16bit |
| 825 if (paint.isDither() && !(shaderFlags & SkShader::kIntrinsicly16_Flag)) { | 825 if (paint.isDither() && !(shaderFlags & SkShader::kIntrinsicly16_Flag)) { |
| 826 flags |= SkBlitRow::kDither_Flag; | 826 flags |= SkBlitRow::kDither_Flag; |
| 827 } | 827 } |
| 828 // used when we know our global alpha is 0xFF | 828 // used when we know our global alpha is 0xFF |
| 829 fOpaqueProc = SkBlitRow::Factory(flags, SkBitmap::kRGB_565_Config); | 829 fOpaqueProc = SkBlitRow::Factory(flags, kRGB_565_SkColorType); |
| 830 // used when we know our global alpha is < 0xFF | 830 // used when we know our global alpha is < 0xFF |
| 831 fAlphaProc = SkBlitRow::Factory(flags | SkBlitRow::kGlobalAlpha_Flag, | 831 fAlphaProc = SkBlitRow::Factory(flags | SkBlitRow::kGlobalAlpha_Flag, |
| 832 SkBitmap::kRGB_565_Config); | 832 kRGB_565_SkColorType); |
| 833 } | 833 } |
| 834 | 834 |
| 835 SkRGB16_Shader_Blitter::~SkRGB16_Shader_Blitter() { | 835 SkRGB16_Shader_Blitter::~SkRGB16_Shader_Blitter() { |
| 836 sk_free(fBuffer); | 836 sk_free(fBuffer); |
| 837 } | 837 } |
| 838 | 838 |
| 839 void SkRGB16_Shader_Blitter::blitH(int x, int y, int width) { | 839 void SkRGB16_Shader_Blitter::blitH(int x, int y, int width) { |
| 840 SkASSERT(x + width <= fDevice.width()); | 840 SkASSERT(x + width <= fDevice.width()); |
| 841 | 841 |
| 842 fShaderContext->shadeSpan(x, y, fBuffer, width); | 842 fShaderContext->shadeSpan(x, y, fBuffer, width); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 #endif | 1050 #endif |
| 1051 } else if (0xFF == SkColorGetA(color)) { | 1051 } else if (0xFF == SkColorGetA(color)) { |
| 1052 blitter = allocator->createT<SkRGB16_Opaque_Blitter>(device, paint); | 1052 blitter = allocator->createT<SkRGB16_Opaque_Blitter>(device, paint); |
| 1053 } else { | 1053 } else { |
| 1054 blitter = allocator->createT<SkRGB16_Blitter>(device, paint); | 1054 blitter = allocator->createT<SkRGB16_Blitter>(device, paint); |
| 1055 } | 1055 } |
| 1056 } | 1056 } |
| 1057 | 1057 |
| 1058 return blitter; | 1058 return blitter; |
| 1059 } | 1059 } |
| OLD | NEW |