Index: src/effects/SkLayerRasterizer.cpp |
diff --git a/src/effects/SkLayerRasterizer.cpp b/src/effects/SkLayerRasterizer.cpp |
index d3e112c3a4b836118be46258c5f3d1b9fb181ab3..8403d06147a602969aeb8c5f5d1af00a3fe062f5 100644 |
--- a/src/effects/SkLayerRasterizer.cpp |
+++ b/src/effects/SkLayerRasterizer.cpp |
@@ -116,9 +116,12 @@ bool SkLayerRasterizer::onRasterize(const SkPath& path, const SkMatrix& matrix, |
} |
if (SkMask::kJustComputeBounds_CreateMode != mode) { |
- SkBitmap device; |
- SkRasterClip rectClip; |
SkDraw draw; |
+ if (!draw.fDst.reset(*mask)) { |
+ return false; |
+ } |
+ |
+ SkRasterClip rectClip; |
SkMatrix translatedMatrix; // this translates us to our local pixels |
SkMatrix drawMatrix; // this translates the path by each layer's offset |
@@ -128,9 +131,6 @@ bool SkLayerRasterizer::onRasterize(const SkPath& path, const SkMatrix& matrix, |
translatedMatrix.postTranslate(-SkIntToScalar(mask->fBounds.fLeft), |
-SkIntToScalar(mask->fBounds.fTop)); |
- device.installMaskPixels(*mask); |
- |
- draw.fBitmap = &device; |
draw.fMatrix = &drawMatrix; |
draw.fRC = &rectClip; |
draw.fClip = &rectClip.bwRgn(); |