aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skiaserve/Request.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2016-02-29 05:35:04 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-29 05:35:04 -0800
commit6bc967984a59e2f6602b5661caa8353dc985a4cb (patch)
tree4ab46778f75008e1eb1db4cea430d44984e595cb /tools/skiaserve/Request.cpp
parent9b48a6e3f862076018cc7d63b180b6340f4873cd (diff)
A bit more privacy for SkiaServe's Request
Diffstat (limited to 'tools/skiaserve/Request.cpp')
-rw-r--r--tools/skiaserve/Request.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp
index bcaebde01f..98b3b030c6 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;
}
GrAuditTrail* Request::getAuditTrail(SkCanvas* canvas) {