| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "SkDrawCommand.h" | 10 #include "SkDrawCommand.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 UrlDataManager& urlDataManager)
const { | 229 UrlDataManager& urlDataManager)
const { |
| 230 Json::Value result = this->toJSON(urlDataManager); | 230 Json::Value result = this->toJSON(urlDataManager); |
| 231 | 231 |
| 232 SkASSERT(canvas); | 232 SkASSERT(canvas); |
| 233 | 233 |
| 234 #if SK_SUPPORT_GPU | 234 #if SK_SUPPORT_GPU |
| 235 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget(); | 235 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget(); |
| 236 if (rt) { | 236 if (rt) { |
| 237 GrContext* ctx = rt->getContext(); | 237 GrContext* ctx = rt->getContext(); |
| 238 if(ctx) { | 238 if(ctx) { |
| 239 GrAuditTrail* at = ctx->getAuditTrail(); |
| 240 GrAuditTrail::AutoEnable enable(at); |
| 239 this->execute(canvas); | 241 this->execute(canvas); |
| 240 GrAuditTrail* at = ctx->getAuditTrail(); | |
| 241 | 242 |
| 242 // TODO if this is inefficient we could add a method to GrAuditTrail
which takes | 243 // TODO if this is inefficient we could add a method to GrAuditTrail
which takes |
| 243 // a Json::Value and is only compiled in this file | 244 // a Json::Value and is only compiled in this file |
| 244 Json::Value parsedFromString; | 245 Json::Value parsedFromString; |
| 245 Json::Reader reader; | 246 Json::Reader reader; |
| 246 SkDEBUGCODE(bool parsingSuccessful = )reader.parse(at->toJson().c_st
r(), | 247 SkDEBUGCODE(bool parsingSuccessful = )reader.parse(at->toJson().c_st
r(), |
| 247 parsedFromString)
; | 248 parsedFromString)
; |
| 248 SkASSERT(parsingSuccessful); | 249 SkASSERT(parsingSuccessful); |
| 249 | 250 |
| 250 result[SKDEBUGCANVAS_ATTRIBUTE_AUDITTRAIL] = parsedFromString; | 251 result[SKDEBUGCANVAS_ATTRIBUTE_AUDITTRAIL] = parsedFromString; |
| (...skipping 2854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3105 result[SKDEBUGCANVAS_ATTRIBUTE_MATRIX] = make_json_matrix(fMatrix); | 3106 result[SKDEBUGCANVAS_ATTRIBUTE_MATRIX] = make_json_matrix(fMatrix); |
| 3106 return result; | 3107 return result; |
| 3107 } | 3108 } |
| 3108 | 3109 |
| 3109 SkSetMatrixCommand* SkSetMatrixCommand::fromJSON(Json::Value& command, | 3110 SkSetMatrixCommand* SkSetMatrixCommand::fromJSON(Json::Value& command, |
| 3110 UrlDataManager& urlDataManager)
{ | 3111 UrlDataManager& urlDataManager)
{ |
| 3111 SkMatrix matrix; | 3112 SkMatrix matrix; |
| 3112 extract_json_matrix(command[SKDEBUGCANVAS_ATTRIBUTE_MATRIX], &matrix); | 3113 extract_json_matrix(command[SKDEBUGCANVAS_ATTRIBUTE_MATRIX], &matrix); |
| 3113 return new SkSetMatrixCommand(matrix); | 3114 return new SkSetMatrixCommand(matrix); |
| 3114 } | 3115 } |
| OLD | NEW |