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

Side by Side Diff: tools/skiaserve/Request.cpp

Issue 1765123002: Fix up GrAuditTrail to allow arbitrary reordering (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: fix up audit trail 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 unified diff | Download patch
« no previous file with comments | « tools/debugger/SkDebugCanvas.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Request.h" 8 #include "Request.h"
9 9
10 #include "png.h" 10 #include "png.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 fprintf(stderr, "Could not create picture from stream.\n"); 143 fprintf(stderr, "Could not create picture from stream.\n");
144 return false; 144 return false;
145 } 145 }
146 146
147 // pour picture into debug canvas 147 // pour picture into debug canvas
148 fDebugCanvas.reset(new SkDebugCanvas(kImageWidth, Request::kImageHeight)); 148 fDebugCanvas.reset(new SkDebugCanvas(kImageWidth, Request::kImageHeight));
149 fDebugCanvas->drawPicture(fPicture); 149 fDebugCanvas->drawPicture(fPicture);
150 150
151 // for some reason we need to 'flush' the debug canvas by drawing all of the ops 151 // for some reason we need to 'flush' the debug canvas by drawing all of the ops
152 fDebugCanvas->drawTo(this->getCanvas(), this->getLastOp()); 152 fDebugCanvas->drawTo(this->getCanvas(), this->getLastOp());
153 this->getCanvas()->flush();
153 return true; 154 return true;
154 } 155 }
155 156
156 GrAuditTrail* Request::getAuditTrail(SkCanvas* canvas) { 157 GrAuditTrail* Request::getAuditTrail(SkCanvas* canvas) {
157 GrAuditTrail* at = nullptr; 158 GrAuditTrail* at = nullptr;
158 #if SK_SUPPORT_GPU 159 #if SK_SUPPORT_GPU
159 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget(); 160 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget();
160 if (rt) { 161 if (rt) {
161 GrContext* ctx = rt->getContext(); 162 GrContext* ctx = rt->getContext();
162 if (ctx) { 163 if (ctx) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 SkIRect clip = fDebugCanvas->getCurrentClip(); 228 SkIRect clip = fDebugCanvas->getCurrentClip();
228 Json::Value info(Json::objectValue); 229 Json::Value info(Json::objectValue);
229 info["ViewMatrix"] = SkDrawCommand::MakeJsonMatrix(vm); 230 info["ViewMatrix"] = SkDrawCommand::MakeJsonMatrix(vm);
230 info["ClipRect"] = SkDrawCommand::MakeJsonIRect(clip); 231 info["ClipRect"] = SkDrawCommand::MakeJsonIRect(clip);
231 232
232 std::string json = Json::FastWriter().write(info); 233 std::string json = Json::FastWriter().write(info);
233 234
234 // We don't want the null terminator so strlen is correct 235 // We don't want the null terminator so strlen is correct
235 return SkData::NewWithCopy(json.c_str(), strlen(json.c_str())); 236 return SkData::NewWithCopy(json.c_str(), strlen(json.c_str()));
236 } 237 }
OLDNEW
« no previous file with comments | « tools/debugger/SkDebugCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698