Chromium Code Reviews| Index: src/gpu/GrSWMaskHelper.cpp |
| diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp |
| index c13d2d839d0be95b586f7ef39795f72a3938bc3f..4d438206f39e4eb55bc3dd8a6871e9c61a009c6a 100644 |
| --- a/src/gpu/GrSWMaskHelper.cpp |
| +++ b/src/gpu/GrSWMaskHelper.cpp |
| @@ -202,6 +202,8 @@ bool GrSWMaskHelper::init(const SkIRect& resultBounds, |
| } |
| } |
| + sk_bzero(&fDraw, sizeof(fDraw)); |
| + |
| // If we don't have a custom blitter, then we either need a bitmap to compress |
| // from or a bitmap that we're going to use as a texture. In any case, we should |
| // allocate the pixels for a bitmap |
| @@ -210,20 +212,19 @@ bool GrSWMaskHelper::init(const SkIRect& resultBounds, |
| if (!fBM.tryAllocPixels(bmImageInfo)) { |
| return false; |
| } |
| - |
| sk_bzero(fBM.getPixels(), fBM.getSafeSize()); |
|
jvanverth1
2015/06/08 13:21:10
Add a comment explaining why we're peeking at the
reed1
2015/06/08 17:00:22
removed fBM
|
| + if (!fBM.peekPixels(&fDraw.fDst)) { |
| + return false; |
| + } |
| } else { |
| // Otherwise, we just need to remember how big the buffer is... |
| fBM.setInfo(bmImageInfo); |
| + fDraw.fDst.reset(bmImageInfo); |
| } |
| - |
| - sk_bzero(&fDraw, sizeof(fDraw)); |
| - |
| fRasterClip.setRect(bounds); |
| fDraw.fRC = &fRasterClip; |
| fDraw.fClip = &fRasterClip.bwRgn(); |
| fDraw.fMatrix = &fMatrix; |
| - fDraw.fBitmap = &fBM; |
| return true; |
| } |