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

Unified Diff: tools/debugger/SkDrawCommand.cpp

Issue 2281733003: tools: skp_parser (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: skpparser->skp_parser Created 4 years, 2 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.h ('k') | tools/skiaserve/Request.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/debugger/SkDrawCommand.cpp
diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp
index 156ca4f74da4c8d3144f9e2e77222e2723f50519..3c2f051cfee14e1589ae8fee88bb0138ae7a1e63 100644
--- a/tools/debugger/SkDrawCommand.cpp
+++ b/tools/debugger/SkDrawCommand.cpp
@@ -7,6 +7,8 @@
#include "SkDrawCommand.h"
+#include "png.h"
+
#include "SkBlurMaskFilter.h"
#include "SkColorFilter.h"
#include "SkDashPathEffect.h"
@@ -661,7 +663,7 @@ static void write_png_callback(png_structp png_ptr, png_bytep data, png_size_t l
out->write(data, length);
}
-void SkDrawCommand::WritePNG(const png_bytep rgba, png_uint_32 width, png_uint_32 height,
+void SkDrawCommand::WritePNG(const uint8_t* rgba, unsigned width, unsigned height,
SkWStream& out, bool isOpaque) {
png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
SkASSERT(png != nullptr);
@@ -678,7 +680,7 @@ void SkDrawCommand::WritePNG(const png_bytep rgba, png_uint_32 width, png_uint_3
png_bytepp rows = (png_bytepp) sk_malloc_throw(height * sizeof(png_byte*));
png_bytep pixels = (png_bytep) sk_malloc_throw(width * height * 4);
for (png_size_t y = 0; y < height; ++y) {
- const png_bytep src = rgba + y * width * 4;
+ const uint8_t* src = rgba + y * width * 4;
rows[y] = pixels + y * width * 4;
for (png_size_t x = 0; x < width; ++x) {
rows[y][x * 4] = src[x * 4];
@@ -714,7 +716,7 @@ bool SkDrawCommand::flatten(const SkImage& image, Json::Value* target,
sk_sp<SkData> encodedBitmap = sk_tools::encode_bitmap_for_png(bm);
SkDynamicMemoryWStream out;
- SkDrawCommand::WritePNG((const png_bytep) encodedBitmap->bytes(), image.width(), image.height(),
+ SkDrawCommand::WritePNG(encodedBitmap->bytes(), image.width(), image.height(),
out, false);
sk_sp<SkData> encoded = out.detachAsData();
Json::Value jsonData;
« no previous file with comments | « tools/debugger/SkDrawCommand.h ('k') | tools/skiaserve/Request.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698