Index: src/core/SkAAClip.cpp |
diff --git a/src/core/SkAAClip.cpp b/src/core/SkAAClip.cpp |
index bbd1f555f08d49f1e6d11f346c1dfb93934d771e..0de6d350eb17c390b318b0073177013f026fb1e8 100644 |
--- a/src/core/SkAAClip.cpp |
+++ b/src/core/SkAAClip.cpp |
@@ -2056,9 +2056,10 @@ static inline uint16_t mergeOne(uint16_t value, unsigned alpha) { |
SkMulDiv255Round(b, alpha)); |
} |
-template <typename T> void mergeT(const T* SK_RESTRICT src, int srcN, |
- const uint8_t* SK_RESTRICT row, int rowN, |
- T* SK_RESTRICT dst) { |
+template <typename T> |
+void mergeT(const void* inSrc, int srcN, const uint8_t* SK_RESTRICT row, int rowN, void* inDst) { |
+ const T* SK_RESTRICT src = static_cast<const T*>(inSrc); |
+ T* SK_RESTRICT dst = static_cast<T*>(inDst); |
for (;;) { |
SkASSERT(rowN > 0); |
SkASSERT(srcN > 0); |
@@ -2094,14 +2095,10 @@ static MergeAAProc find_merge_aa_proc(SkMask::Format format) { |
SkDEBUGFAIL("unsupported"); |
return nullptr; |
case SkMask::kA8_Format: |
- case SkMask::k3D_Format: { |
- void (*proc8)(const uint8_t*, int, const uint8_t*, int, uint8_t*) = mergeT; |
- return (MergeAAProc)proc8; |
- } |
- case SkMask::kLCD16_Format: { |
- void (*proc16)(const uint16_t*, int, const uint8_t*, int, uint16_t*) = mergeT; |
- return (MergeAAProc)proc16; |
- } |
+ case SkMask::k3D_Format: |
+ return mergeT<uint8_t> ; |
+ case SkMask::kLCD16_Format: |
+ return mergeT<uint16_t>; |
default: |
SkDEBUGFAIL("unsupported"); |
return nullptr; |