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

Unified Diff: src/gpu/GrAADistanceFieldPathRenderer.cpp

Issue 1164373003: Revert of change SkDraw and all Blitters to use pixmap instead of bitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 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;
« 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