OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |