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

Unified Diff: tools/skiaserve/urlhandlers/DownloadHandler.cpp

Issue 1781653002: Fix up picture clip bounds in SkiaServe (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 4 years, 9 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: tools/skiaserve/urlhandlers/DownloadHandler.cpp
diff --git a/tools/skiaserve/urlhandlers/DownloadHandler.cpp b/tools/skiaserve/urlhandlers/DownloadHandler.cpp
index cc55c3b4b9ba92126d3ed20457a137cfb0f5d45a..fd9308d26eb47c99c36996cd6ff13a2296cc11b8 100644
--- a/tools/skiaserve/urlhandlers/DownloadHandler.cpp
+++ b/tools/skiaserve/urlhandlers/DownloadHandler.cpp
@@ -8,8 +8,6 @@
#include "UrlHandler.h"
#include "microhttpd.h"
-#include "SkPictureRecorder.h"
-#include "SkPixelSerializer.h"
#include "../Request.h"
#include "../Response.h"
@@ -27,22 +25,7 @@ int DownloadHandler::handle(Request* request, MHD_Connection* connection,
return MHD_NO;
}
- // TODO move to a function
- // Playback into picture recorder
- SkPictureRecorder recorder;
- SkCanvas* canvas = recorder.beginRecording(Request::kImageWidth,
- Request::kImageHeight);
-
- request->fDebugCanvas->draw(canvas);
-
- SkAutoTUnref<SkPicture> picture(recorder.endRecording());
-
- SkDynamicMemoryWStream outStream;
-
- SkAutoTUnref<SkPixelSerializer> serializer(SkImageEncoder::CreatePixelSerializer());
- picture->serialize(&outStream, serializer);
-
- SkAutoTUnref<SkData> data(outStream.copyToData());
+ SkAutoTUnref<SkData> data(request->writeOutSkp());
// TODO fancier name handling
return SendData(connection, data, "application/octet-stream", true,

Powered by Google App Engine
This is Rietveld 408576698