diff options
Diffstat (limited to 'src/effects/SkTransparentShader.cpp')
-rw-r--r-- | src/effects/SkTransparentShader.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/effects/SkTransparentShader.cpp b/src/effects/SkTransparentShader.cpp index 1d7e80877e..9de4a0cc23 100644 --- a/src/effects/SkTransparentShader.cpp +++ b/src/effects/SkTransparentShader.cpp @@ -23,13 +23,13 @@ bool SkTransparentShader::setContext(const SkBitmap& device, uint32_t SkTransparentShader::getFlags() { uint32_t flags = this->INHERITED::getFlags(); - switch (fDevice->config()) { - case SkBitmap::kRGB_565_Config: + switch (fDevice->colorType()) { + case kRGB_565_SkColorType: flags |= kHasSpan16_Flag; if (fAlpha == 255) flags |= kOpaqueAlpha_Flag; break; - case SkBitmap::kARGB_8888_Config: + case kPMColor_SkColorType: if (fAlpha == 255 && fDevice->isOpaque()) flags |= kOpaqueAlpha_Flag; break; @@ -42,8 +42,8 @@ uint32_t SkTransparentShader::getFlags() { void SkTransparentShader::shadeSpan(int x, int y, SkPMColor span[], int count) { unsigned scale = SkAlpha255To256(fAlpha); - switch (fDevice->config()) { - case SkBitmap::kARGB_8888_Config: + switch (fDevice->colorType()) { + case kPMColor_SkColorType: if (scale == 256) { SkPMColor* src = fDevice->getAddr32(x, y); if (src != span) { @@ -56,7 +56,7 @@ void SkTransparentShader::shadeSpan(int x, int y, SkPMColor span[], int count) { } } break; - case SkBitmap::kRGB_565_Config: { + case kRGB_565_SkColorType: { const uint16_t* src = fDevice->getAddr16(x, y); if (scale == 256) { for (int i = count - 1; i >= 0; --i) { @@ -78,10 +78,7 @@ void SkTransparentShader::shadeSpan(int x, int y, SkPMColor span[], int count) { } break; } - case SkBitmap::kIndex8_Config: - SkDEBUGFAIL("index8 not supported as a destination device"); - break; - case SkBitmap::kA8_Config: { + case kAlpha_8_SkColorType: { const uint8_t* src = fDevice->getAddr8(x, y); if (scale == 256) { for (int i = count - 1; i >= 0; --i) { @@ -94,13 +91,14 @@ void SkTransparentShader::shadeSpan(int x, int y, SkPMColor span[], int count) { } break; } - default: // to avoid warnings + default: + SkDEBUGFAIL("colorType not supported as a destination device"); break; } } void SkTransparentShader::shadeSpan16(int x, int y, uint16_t span[], int count) { - SkASSERT(fDevice->config() == SkBitmap::kRGB_565_Config); + SkASSERT(fDevice->colorType() == kRGB_565_SkColorType); uint16_t* src = fDevice->getAddr16(x, y); if (src != span) { |