| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 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 "SkSpriteBlitter.h" | 8 #include "SkSpriteBlitter.h" |
| 9 #include "SkSpanProcs.h" | 9 #include "SkSpanProcs.h" |
| 10 #include "SkTemplates.h" | 10 #include "SkTemplates.h" |
| 11 #include "SkXfermode.h" | 11 #include "SkXfermode.h" |
| 12 | 12 |
| 13 class Sprite_4f : public SkSpriteBlitter { | 13 class Sprite_4f : public SkSpriteBlitter { |
| 14 public: | 14 public: |
| 15 Sprite_4f(const SkPixmap& src, const SkPaint& paint) : INHERITED(src) { | 15 Sprite_4f(const SkPixmap& src, const SkPaint& paint) : INHERITED(src) { |
| 16 fXfer = paint.getXfermode(); | 16 fXfer = SkXfermode::Peek(paint.getBlendMode()); |
| 17 fLoader = SkLoadSpanProc_Choose(src.info()); | 17 fLoader = SkLoadSpanProc_Choose(src.info()); |
| 18 fFilter = SkFilterSpanProc_Choose(paint); | 18 fFilter = SkFilterSpanProc_Choose(paint); |
| 19 fBuffer.reset(src.width()); | 19 fBuffer.reset(src.width()); |
| 20 } | 20 } |
| 21 | 21 |
| 22 protected: | 22 protected: |
| 23 SkXfermode* fXfer; | 23 SkXfermode* fXfer; |
| 24 SkLoadSpanProc fLoader; | 24 SkLoadSpanProc fLoader; |
| 25 SkFilterSpanProc fFilter; | 25 SkFilterSpanProc fFilter; |
| 26 SkAutoTMalloc<SkPM4f> fBuffer; | 26 SkAutoTMalloc<SkPM4f> fBuffer; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 } | 120 } |
| 121 | 121 |
| 122 switch (source.colorType()) { | 122 switch (source.colorType()) { |
| 123 case kN32_SkColorType: | 123 case kN32_SkColorType: |
| 124 case kRGBA_F16_SkColorType: | 124 case kRGBA_F16_SkColorType: |
| 125 return allocator->createT<Sprite_sRGB>(source, paint); | 125 return allocator->createT<Sprite_sRGB>(source, paint); |
| 126 default: | 126 default: |
| 127 return nullptr; | 127 return nullptr; |
| 128 } | 128 } |
| 129 } | 129 } |
| OLD | NEW |