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

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

Issue 1746953002: fix minor bug drawing batch bounds by default (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 if (at) { 174 if (at) {
175 GrAuditTrail::AutoEnable ae(at); 175 GrAuditTrail::AutoEnable ae(at);
176 at->fullReset(); 176 at->fullReset();
177 } 177 }
178 } 178 }
179 179
180 SkData* Request::getJsonOps(int n) { 180 SkData* Request::getJsonOps(int n) {
181 SkCanvas* canvas = this->getCanvas(); 181 SkCanvas* canvas = this->getCanvas();
182 Json::Value root = fDebugCanvas->toJSON(fUrlDataManager, n, canvas); 182 Json::Value root = fDebugCanvas->toJSON(fUrlDataManager, n, canvas);
183 root["mode"] = Json::Value(fGPUEnabled ? "gpu" : "cpu"); 183 root["mode"] = Json::Value(fGPUEnabled ? "gpu" : "cpu");
184 root["drawGpuBatchBounds"] = Json::Value(fDebugCanvas->getDrawGpuBatchBounds ());
184 SkDynamicMemoryWStream stream; 185 SkDynamicMemoryWStream stream;
185 stream.writeText(Json::FastWriter().write(root).c_str()); 186 stream.writeText(Json::FastWriter().write(root).c_str());
186 187
187 this->cleanupAuditTrail(canvas); 188 this->cleanupAuditTrail(canvas);
188 189
189 return stream.copyToData(); 190 return stream.copyToData();
190 } 191 }
191 192
192 SkData* Request::getJsonBatchList(int n) { 193 SkData* Request::getJsonBatchList(int n) {
193 SkCanvas* canvas = this->getCanvas(); 194 SkCanvas* canvas = this->getCanvas();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 SkIRect clip = fDebugCanvas->getCurrentClip(); 229 SkIRect clip = fDebugCanvas->getCurrentClip();
229 Json::Value info(Json::objectValue); 230 Json::Value info(Json::objectValue);
230 info["ViewMatrix"] = SkJSONCanvas::MakeMatrix(vm); 231 info["ViewMatrix"] = SkJSONCanvas::MakeMatrix(vm);
231 info["ClipRect"] = SkJSONCanvas::MakeIRect(clip); 232 info["ClipRect"] = SkJSONCanvas::MakeIRect(clip);
232 233
233 std::string json = Json::FastWriter().write(info); 234 std::string json = Json::FastWriter().write(info);
234 235
235 // We don't want the null terminator so strlen is correct 236 // We don't want the null terminator so strlen is correct
236 return SkData::NewWithCopy(json.c_str(), strlen(json.c_str())); 237 return SkData::NewWithCopy(json.c_str(), strlen(json.c_str()));
237 } 238 }
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