Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Unified Diff: src/gpu/GrSWMaskHelper.cpp

Issue 1148793007: change SkDraw and all Blitters to use pixmap instead of bitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698