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

Unified Diff: tools/skiaserve/Request.cpp

Issue 1741043003: A bit more privacy for SkiaServe's Request (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 10 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/skiaserve/Request.h ('k') | tools/skiaserve/urlhandlers/BreakHandler.cpp » ('j') | 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 4d256d56d87260af82172ad0cdeb87a408f9f278..c5a36cbae025d34a9aa5910a3a682d709799130b 100644
--- a/tools/skiaserve/Request.cpp
+++ b/tools/skiaserve/Request.cpp
@@ -136,6 +136,20 @@ bool Request::enableGPU(bool enable) {
fSurface.reset(this->createCPUSurface());
fGPUEnabled = false;
return true;
+}
+
+bool Request::initPictureFromStream(SkStream* stream) {
+ // parse picture from stream
+ fPicture.reset(SkPicture::CreateFromStream(stream));
+ if (!fPicture.get()) {
+ fprintf(stderr, "Could not create picture from stream.\n");
+ return false;
+ }
+
+ // pour picture into debug canvas
+ fDebugCanvas.reset(new SkDebugCanvas(kImageWidth, Request::kImageHeight));
+ fDebugCanvas->drawPicture(fPicture);
+ return true;
}
SkData* Request::getJsonOps(int n) {
« no previous file with comments | « tools/skiaserve/Request.h ('k') | tools/skiaserve/urlhandlers/BreakHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698