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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 } | 220 } |
221 | 221 |
222 Json::Value SkDrawCommand::toJSON(UrlDataManager& urlDataManager) const { | 222 Json::Value SkDrawCommand::toJSON(UrlDataManager& urlDataManager) const { |
223 Json::Value result; | 223 Json::Value result; |
224 result[SKDEBUGCANVAS_ATTRIBUTE_COMMAND] = this->GetCommandString(fOpType); | 224 result[SKDEBUGCANVAS_ATTRIBUTE_COMMAND] = this->GetCommandString(fOpType); |
225 return result; | 225 return result; |
226 } | 226 } |
227 | 227 |
228 Json::Value SkDrawCommand::drawToAndCollectJSON(SkCanvas* canvas, | 228 Json::Value SkDrawCommand::drawToAndCollectJSON(SkCanvas* canvas, |
229 UrlDataManager& urlDataManager)
const { | 229 UrlDataManager& urlDataManager)
const { |
230 Json::Value result; | 230 Json::Value result = this->toJSON(urlDataManager); |
231 result[SKDEBUGCANVAS_ATTRIBUTE_COMMAND] = this->GetCommandString(fOpType); | |
232 | 231 |
233 SkASSERT(canvas); | 232 SkASSERT(canvas); |
234 | 233 |
235 #if SK_SUPPORT_GPU | 234 #if SK_SUPPORT_GPU |
236 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget(); | 235 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget(); |
237 if (rt) { | 236 if (rt) { |
238 GrContext* ctx = rt->getContext(); | 237 GrContext* ctx = rt->getContext(); |
239 if(ctx) { | 238 if(ctx) { |
240 this->execute(canvas); | 239 this->execute(canvas); |
241 GrAuditTrail* at = ctx->getAuditTrail(); | 240 GrAuditTrail* at = ctx->getAuditTrail(); |
(...skipping 2864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3106 result[SKDEBUGCANVAS_ATTRIBUTE_MATRIX] = make_json_matrix(fMatrix); | 3105 result[SKDEBUGCANVAS_ATTRIBUTE_MATRIX] = make_json_matrix(fMatrix); |
3107 return result; | 3106 return result; |
3108 } | 3107 } |
3109 | 3108 |
3110 SkSetMatrixCommand* SkSetMatrixCommand::fromJSON(Json::Value& command, | 3109 SkSetMatrixCommand* SkSetMatrixCommand::fromJSON(Json::Value& command, |
3111 UrlDataManager& urlDataManager)
{ | 3110 UrlDataManager& urlDataManager)
{ |
3112 SkMatrix matrix; | 3111 SkMatrix matrix; |
3113 extract_json_matrix(command[SKDEBUGCANVAS_ATTRIBUTE_MATRIX], &matrix); | 3112 extract_json_matrix(command[SKDEBUGCANVAS_ATTRIBUTE_MATRIX], &matrix); |
3114 return new SkSetMatrixCommand(matrix); | 3113 return new SkSetMatrixCommand(matrix); |
3115 } | 3114 } |
OLD | NEW |