Index: src/core/SkBlitter.cpp |
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp |
index f4e1a37c80b5177cda0acc7975efbc7ec23ebd4e..f46db357d47d87505fafe279e4b1dfcd798725f0 100644 |
--- a/src/core/SkBlitter.cpp |
+++ b/src/core/SkBlitter.cpp |
@@ -850,14 +850,16 @@ static XferInterp interpret_xfermode(const SkPaint& paint, SkXfermode* xfer, |
SkBlitter* SkBlitter::Choose(const SkBitmap& device, |
const SkMatrix& matrix, |
const SkPaint& origPaint, |
- void* storage, size_t storageSize) { |
+ void* storage, size_t storageSize, |
+ bool drawCoverage) { |
SkASSERT(storageSize == 0 || storage != NULL); |
SkBlitter* blitter = NULL; |
// which check, in case we're being called by a client with a dummy device |
// (e.g. they have a bounder that always aborts the draw) |
- if (SkBitmap::kNo_Config == device.config()) { |
+ if (SkBitmap::kNo_Config == device.config() || |
+ (drawCoverage && (SkBitmap::kA8_Config != device.config()))) { |
SK_PLACEMENT_NEW(blitter, SkNullBlitter, storage, storageSize); |
return blitter; |
} |
@@ -940,6 +942,7 @@ SkBlitter* SkBlitter::Choose(const SkBitmap& device, |
return blitter; |
} |
+ |
switch (device.config()) { |
case SkBitmap::kA1_Config: |
SK_PLACEMENT_NEW_ARGS(blitter, SkA1_Blitter, |
@@ -947,7 +950,12 @@ SkBlitter* SkBlitter::Choose(const SkBitmap& device, |
break; |
case SkBitmap::kA8_Config: |
- if (shader) { |
+ if (drawCoverage) { |
+ SkASSERT(NULL == shader); |
+ SkASSERT(NULL == paint->getXfermode()); |
+ SK_PLACEMENT_NEW_ARGS(blitter, SkA8_Coverage_Blitter, |
+ storage, storageSize, (device, *paint)); |
+ } else if (shader) { |
SK_PLACEMENT_NEW_ARGS(blitter, SkA8_Shader_Blitter, |
storage, storageSize, (device, *paint)); |
} else { |