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

Unified Diff: src/gpu/GrAADistanceFieldPathRenderer.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
« no previous file with comments | « src/effects/SkLayerRasterizer.cpp ('k') | src/gpu/GrSWMaskHelper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAADistanceFieldPathRenderer.cpp
diff --git a/src/gpu/GrAADistanceFieldPathRenderer.cpp b/src/gpu/GrAADistanceFieldPathRenderer.cpp
index 21fbcb37fbc4cc0fb240f4e85d2c203763ec8072..3c7648aae342ed24368c4665eb6dc470433ae03a 100755
--- a/src/gpu/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/GrAADistanceFieldPathRenderer.cpp
@@ -354,14 +354,12 @@ 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;
+ if (!dst.tryAlloc(SkImageInfo::MakeA8(pathBounds.width(),
+ pathBounds.height()))) {
return false;
}
-
- sk_bzero(bmp.getPixels(), bmp.getSafeSize());
+ sk_bzero(dst.writable_addr(), dst.getSafeSize());
// rasterize path
SkPaint paint;
@@ -388,7 +386,7 @@ private:
draw.fRC = &rasterClip;
draw.fClip = &rasterClip.bwRgn();
draw.fMatrix = &drawMatrix;
- draw.fBitmap = &bmp;
+ draw.fDst = dst;
draw.drawPathCoverage(path, paint);
@@ -400,13 +398,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;
« no previous file with comments | « src/effects/SkLayerRasterizer.cpp ('k') | src/gpu/GrSWMaskHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698