Chromium Code Reviews| Index: src/gpu/GrAADistanceFieldPathRenderer.cpp |
| diff --git a/src/gpu/GrAADistanceFieldPathRenderer.cpp b/src/gpu/GrAADistanceFieldPathRenderer.cpp |
| index 21fbcb37fbc4cc0fb240f4e85d2c203763ec8072..191caa759020898192b0db042501afc5d77bb78f 100755 |
| --- a/src/gpu/GrAADistanceFieldPathRenderer.cpp |
| +++ b/src/gpu/GrAADistanceFieldPathRenderer.cpp |
| @@ -354,14 +354,13 @@ private: |
| SkIRect pathBounds = SkIRect::MakeWH(devPathBounds.width(), |
| devPathBounds.height()); |
| - SkBitmap bmp; |
| - const SkImageInfo bmImageInfo = SkImageInfo::MakeA8(pathBounds.fRight, |
| - pathBounds.fBottom); |
| - if (!bmp.tryAllocPixels(bmImageInfo)) { |
| + SkAutoPixmapStorage dst; |
|
jvanverth1
2015/06/08 13:21:10
It's unclear to me why this should be a SkAutoPixm
reed1
2015/06/08 17:00:22
Just me being lazy. Now helper also uses pixmaps
|
| + // reed: should these be width/height instead of right/bottom? |
|
jvanverth1
2015/06/08 13:21:10
I think it's safe the way it is, though admittedly
reed1
2015/06/08 17:00:22
Hmmm, I could add asserts, but its starting to fee
|
| + const SkImageInfo bmImageInfo = SkImageInfo::MakeA8(pathBounds.fRight, pathBounds.fBottom); |
| + if (!dst.tryAlloc(bmImageInfo)) { |
|
jvanverth1
2015/06/08 13:21:10
Change variable name to pmImageInfo?
reed1
2015/06/08 17:00:22
removed local var
|
| return false; |
| } |
| - |
| - sk_bzero(bmp.getPixels(), bmp.getSafeSize()); |
| + sk_bzero(dst.writable_addr(), dst.getSafeSize()); |
| // rasterize path |
| SkPaint paint; |
| @@ -388,7 +387,7 @@ private: |
| draw.fRC = &rasterClip; |
| draw.fClip = &rasterClip.bwRgn(); |
| draw.fMatrix = &drawMatrix; |
| - draw.fBitmap = &bmp; |
| + draw.fDst = dst; |
| draw.drawPathCoverage(path, paint); |
| @@ -400,13 +399,9 @@ private: |
| SkAutoSMalloc<1024> dfStorage(width * height * sizeof(unsigned char)); |
| // Generate signed distance field |
| - { |
| - SkAutoLockPixels alp(bmp); |
| - |
| - SkGenerateDistanceFieldFromA8Image((unsigned char*)dfStorage.get(), |
| - (const unsigned char*)bmp.getPixels(), |
| - bmp.width(), bmp.height(), bmp.rowBytes()); |
| - } |
| + SkGenerateDistanceFieldFromA8Image((unsigned char*)dfStorage.get(), |
| + (const unsigned char*)dst.addr(), |
| + dst.width(), dst.height(), dst.rowBytes()); |
| // add to atlas |
| SkIPoint16 atlasLocation; |