Index: src/gpu/GrAADistanceFieldPathRenderer.cpp |
diff --git a/src/gpu/GrAADistanceFieldPathRenderer.cpp b/src/gpu/GrAADistanceFieldPathRenderer.cpp |
index 3c7648aae342ed24368c4665eb6dc470433ae03a..21fbcb37fbc4cc0fb240f4e85d2c203763ec8072 100755 |
--- a/src/gpu/GrAADistanceFieldPathRenderer.cpp |
+++ b/src/gpu/GrAADistanceFieldPathRenderer.cpp |
@@ -354,12 +354,14 @@ |
SkIRect pathBounds = SkIRect::MakeWH(devPathBounds.width(), |
devPathBounds.height()); |
- SkAutoPixmapStorage dst; |
- if (!dst.tryAlloc(SkImageInfo::MakeA8(pathBounds.width(), |
- pathBounds.height()))) { |
+ SkBitmap bmp; |
+ const SkImageInfo bmImageInfo = SkImageInfo::MakeA8(pathBounds.fRight, |
+ pathBounds.fBottom); |
+ if (!bmp.tryAllocPixels(bmImageInfo)) { |
return false; |
} |
- sk_bzero(dst.writable_addr(), dst.getSafeSize()); |
+ |
+ sk_bzero(bmp.getPixels(), bmp.getSafeSize()); |
// rasterize path |
SkPaint paint; |
@@ -386,7 +388,7 @@ |
draw.fRC = &rasterClip; |
draw.fClip = &rasterClip.bwRgn(); |
draw.fMatrix = &drawMatrix; |
- draw.fDst = dst; |
+ draw.fBitmap = &bmp; |
draw.drawPathCoverage(path, paint); |
@@ -398,9 +400,13 @@ |
SkAutoSMalloc<1024> dfStorage(width * height * sizeof(unsigned char)); |
// Generate signed distance field |
- SkGenerateDistanceFieldFromA8Image((unsigned char*)dfStorage.get(), |
- (const unsigned char*)dst.addr(), |
- dst.width(), dst.height(), dst.rowBytes()); |
+ { |
+ SkAutoLockPixels alp(bmp); |
+ |
+ SkGenerateDistanceFieldFromA8Image((unsigned char*)dfStorage.get(), |
+ (const unsigned char*)bmp.getPixels(), |
+ bmp.width(), bmp.height(), bmp.rowBytes()); |
+ } |
// add to atlas |
SkIPoint16 atlasLocation; |