OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2016 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #include "GrAuditTrail.h" |
| 9 |
| 10 SkString GrAuditTrail::toJson() const { |
| 11 SkString json; |
| 12 json.append("{\n"); |
| 13 json.append("Ops: [\n"); |
| 14 for (int i = 0; i < fOps.count(); i++) { |
| 15 json.append(fOps[i].toJson()); |
| 16 if (i < fOps.count() - 1) { |
| 17 json.append(",\n"); |
| 18 } |
| 19 } |
| 20 json.append("]\n"); |
| 21 json.append("}\n"); |
| 22 return json; |
| 23 } |
| 24 |
| 25 SkString GrAuditTrail::Op::toJson() const { |
| 26 SkString json; |
| 27 json.append("{\n"); |
| 28 json.appendf("%s\n", fName.c_str()); |
| 29 json.append("}\n"); |
| 30 return json; |
| 31 } |
| 32 |
OLD | NEW |