Index: src/core/SkSpriteBlitter_RGB16.cpp |
diff --git a/src/core/SkSpriteBlitter_RGB16.cpp b/src/core/SkSpriteBlitter_RGB16.cpp |
index 7428c8a74a38b8cf525efbf7c73151eb4cb8a9f6..74c1961dbdf8516d28ac707c47c91664213360b7 100644 |
--- a/src/core/SkSpriteBlitter_RGB16.cpp |
+++ b/src/core/SkSpriteBlitter_RGB16.cpp |
@@ -306,11 +306,11 @@ private: |
/////////////////////////////////////////////////////////////////////////////// |
-#include "SkTemplatesPriv.h" |
+SkSpriteBlitter* SkSpriteBlitter::ChooseD16(const SkBitmap& source, const SkPaint& paint, |
+ SkTBlitterAllocator* allocator) { |
+ |
+ SkASSERT(allocator != NULL); |
-SkSpriteBlitter* SkSpriteBlitter::ChooseD16(const SkBitmap& source, |
- const SkPaint& paint, |
- void* storage, size_t storageSize) { |
if (paint.getMaskFilter() != NULL) { // may add cases for this |
return NULL; |
} |
@@ -325,26 +325,22 @@ SkSpriteBlitter* SkSpriteBlitter::ChooseD16(const SkBitmap& source, |
unsigned alpha = paint.getAlpha(); |
switch (source.colorType()) { |
- case kPMColor_SkColorType: |
- SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S32_BlitRowProc, |
- storage, storageSize, (source)); |
+ case kPMColor_SkColorType: { |
+ blitter = allocator->createT<Sprite_D16_S32_BlitRowProc>(source); |
break; |
+ } |
case kARGB_4444_SkColorType: |
if (255 == alpha) { |
- SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S4444_Opaque, |
- storage, storageSize, (source)); |
+ blitter = allocator->createT<Sprite_D16_S4444_Opaque>(source); |
} else { |
- SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S4444_Blend, |
- storage, storageSize, (source, alpha >> 4)); |
+ blitter = allocator->createT<Sprite_D16_S4444_Blend>(source, alpha >> 4); |
} |
break; |
case kRGB_565_SkColorType: |
if (255 == alpha) { |
- SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S16_Opaque, |
- storage, storageSize, (source)); |
+ blitter = allocator->createT<Sprite_D16_S16_Opaque>(source); |
} else { |
- SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S16_Blend, |
- storage, storageSize, (source, alpha)); |
+ blitter = allocator->createT<Sprite_D16_S16_Blend>(source, alpha); |
} |
break; |
case kIndex_8_SkColorType: |
@@ -354,19 +350,15 @@ SkSpriteBlitter* SkSpriteBlitter::ChooseD16(const SkBitmap& source, |
} |
if (source.isOpaque()) { |
if (255 == alpha) { |
- SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_SIndex8_Opaque, |
- storage, storageSize, (source)); |
+ blitter = allocator->createT<Sprite_D16_SIndex8_Opaque>(source); |
} else { |
- SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_SIndex8_Blend, |
- storage, storageSize, (source, alpha)); |
+ blitter = allocator->createT<Sprite_D16_SIndex8_Blend>(source, alpha); |
} |
} else { |
if (255 == alpha) { |
- SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_SIndex8A_Opaque, |
- storage, storageSize, (source)); |
+ blitter = allocator->createT<Sprite_D16_SIndex8A_Opaque>(source); |
} else { |
- SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_SIndex8A_Blend, |
- storage, storageSize, (source, alpha)); |
+ blitter = allocator->createT<Sprite_D16_SIndex8A_Blend>(source, alpha); |
} |
} |
break; |