Index: src/device/xps/SkXPSDevice.cpp |
diff --git a/src/device/xps/SkXPSDevice.cpp b/src/device/xps/SkXPSDevice.cpp |
index 56800d154018c296e7d417b0692e695965bc5279..2b15cd9f4ac5e0072cdd305df643edae0cf21188 100644 |
--- a/src/device/xps/SkXPSDevice.cpp |
+++ b/src/device/xps/SkXPSDevice.cpp |
@@ -1071,33 +1071,24 @@ HRESULT SkXPSDevice::createXpsBrush(const SkPaint& skPaint, |
SkBitmap outTexture; |
SkMatrix outMatrix; |
SkShader::TileMode xy[2]; |
- SkShader::BitmapType bitmapType = shader->asABitmap(&outTexture, |
- &outMatrix, |
- xy); |
- switch (bitmapType) { |
- case SkShader::kDefault_BitmapType: { |
- //TODO: outMatrix?? |
- SkMatrix localMatrix = shader->getLocalMatrix(); |
- if (parentTransform) { |
- localMatrix.preConcat(*parentTransform); |
- } |
- |
- SkTScopedComPtr<IXpsOMTileBrush> tileBrush; |
- HR(this->createXpsImageBrush(outTexture, |
- localMatrix, |
- xy, |
- skPaint.getAlpha(), |
- &tileBrush)); |
+ if (shader->isABitmap(&outTexture, &outMatrix, xy)) { |
+ //TODO: outMatrix?? |
+ SkMatrix localMatrix = shader->getLocalMatrix(); |
+ if (parentTransform) { |
+ localMatrix.preConcat(*parentTransform); |
+ } |
- HRM(tileBrush->QueryInterface<IXpsOMBrush>(brush), "QI failed."); |
+ SkTScopedComPtr<IXpsOMTileBrush> tileBrush; |
+ HR(this->createXpsImageBrush(outTexture, |
+ localMatrix, |
+ xy, |
+ skPaint.getAlpha(), |
+ &tileBrush)); |
- return S_OK; |
- } |
- default: |
- break; |
+ HRM(tileBrush->QueryInterface<IXpsOMBrush>(brush), "QI failed."); |
+ } else { |
+ HR(this->createXpsSolidColorBrush(skPaint.getColor(), 0xFF, brush)); |
} |
- |
- HR(this->createXpsSolidColorBrush(skPaint.getColor(), 0xFF, brush)); |
return S_OK; |
} |