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

Unified Diff: tools/skiaserve/Request.cpp

Issue 2119513002: Fix png encoding in skia debugger (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Working Created 4 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 | « tools/debugger/SkDrawCommand.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skiaserve/Request.cpp
diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp
index f2f10acad1cf0442d41164efb5bdbf56dd3229a5..6ae6b51b8d95e6054476b2d2f6788ff2c8944d9d 100644
--- a/tools/skiaserve/Request.cpp
+++ b/tools/skiaserve/Request.cpp
@@ -59,11 +59,10 @@ SkData* Request::writeCanvasToPng(SkCanvas* canvas) {
sk_sp<SkData> encodedBitmap = sk_tools::encode_bitmap_for_png(*bmp);
SkASSERT(encodedBitmap.get());
- // write to png
+ // write to an opaque png (black background)
SkDynamicMemoryWStream buffer;
- SkDrawCommand::WritePNG((const png_bytep) encodedBitmap->writable_data(),
- bmp->width(), bmp->height(),
- buffer);
+ SkDrawCommand::WritePNG((const png_bytep) encodedBitmap->bytes(), bmp->width(), bmp->height(),
+ buffer, true);
return buffer.copyToData();
}
« no previous file with comments | « tools/debugger/SkDrawCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698