diff options
author | joshualitt <joshualitt@chromium.org> | 2016-02-29 05:35:04 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-29 05:35:04 -0800 |
commit | 6bc967984a59e2f6602b5661caa8353dc985a4cb (patch) | |
tree | 4ab46778f75008e1eb1db4cea430d44984e595cb /tools/skiaserve/Request.cpp | |
parent | 9b48a6e3f862076018cc7d63b180b6340f4873cd (diff) |
A bit more privacy for SkiaServe's Request
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1741043003
Review URL: https://codereview.chromium.org/1741043003
Diffstat (limited to 'tools/skiaserve/Request.cpp')
-rw-r--r-- | tools/skiaserve/Request.cpp | 14 |
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) { |