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 | 819 |
820 fBuffer = (SkPMColor*)sk_malloc_throw(device.width() * sizeof(SkPMColor)); | 820 fBuffer = (SkPMColor*)sk_malloc_throw(device.width() * sizeof(SkPMColor)); |
821 | 821 |
822 // compute SkBlitRow::Procs | 822 // compute SkBlitRow::Procs |
823 unsigned flags = 0; | 823 unsigned flags = 0; |
824 | 824 |
825 uint32_t shaderFlags = fShaderFlags; | 825 uint32_t shaderFlags = fShaderFlags; |
826 // shaders take care of global alpha, so we never set it in SkBlitRow | 826 // shaders take care of global alpha, so we never set it in SkBlitRow |
827 if (!(shaderFlags & SkShader::kOpaqueAlpha_Flag)) { | 827 if (!(shaderFlags & SkShader::kOpaqueAlpha_Flag)) { |
828 flags |= SkBlitRow::kSrcPixelAlpha_Flag; | 828 flags |= SkBlitRow::kSrcPixelAlpha_Flag; |
829 } | 829 } |
830 // don't dither if the shader is really 16bit | 830 // don't dither if the shader is really 16bit |
831 if (paint.isDither() && !(shaderFlags & SkShader::kIntrinsicly16_Flag)) { | 831 if (paint.isDither() && !(shaderFlags & SkShader::kIntrinsicly16_Flag)) { |
832 flags |= SkBlitRow::kDither_Flag; | 832 flags |= SkBlitRow::kDither_Flag; |
833 } | 833 } |
834 // used when we know our global alpha is 0xFF | 834 // used when we know our global alpha is 0xFF |
835 fOpaqueProc = SkBlitRow::Factory(flags, SkBitmap::kRGB_565_Config); | 835 fOpaqueProc = SkBlitRow::Factory(flags, SkBitmap::kRGB_565_Config); |
836 // used when we know our global alpha is < 0xFF | 836 // used when we know our global alpha is < 0xFF |
837 fAlphaProc = SkBlitRow::Factory(flags | SkBlitRow::kGlobalAlpha_Flag, | 837 fAlphaProc = SkBlitRow::Factory(flags | SkBlitRow::kGlobalAlpha_Flag, |
838 SkBitmap::kRGB_565_Config); | 838 SkBitmap::kRGB_565_Config); |
839 } | 839 } |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 SK_PLACEMENT_NEW_ARGS(blitter, SkRGB16_Opaque_Blitter, storage, | 1056 SK_PLACEMENT_NEW_ARGS(blitter, SkRGB16_Opaque_Blitter, storage, |
1057 storageSize, (device, paint)); | 1057 storageSize, (device, paint)); |
1058 } else { | 1058 } else { |
1059 SK_PLACEMENT_NEW_ARGS(blitter, SkRGB16_Blitter, storage, | 1059 SK_PLACEMENT_NEW_ARGS(blitter, SkRGB16_Blitter, storage, |
1060 storageSize, (device, paint)); | 1060 storageSize, (device, paint)); |
1061 } | 1061 } |
1062 } | 1062 } |
1063 | 1063 |
1064 return blitter; | 1064 return blitter; |
1065 } | 1065 } |
OLD | NEW |