Chromium Code Reviews| 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 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1148 target->setXfermode(xfermode); | 1148 target->setXfermode(xfermode); |
| 1149 xfermode->unref(); | 1149 xfermode->unref(); |
| 1150 } | 1150 } |
| 1151 } | 1151 } |
| 1152 } | 1152 } |
| 1153 | 1153 |
| 1154 static void extract_json_paint_looper(Json::Value& jsonPaint, UrlDataManager& ur lDataManager, | 1154 static void extract_json_paint_looper(Json::Value& jsonPaint, UrlDataManager& ur lDataManager, |
| 1155 SkPaint* target) { | 1155 SkPaint* target) { |
| 1156 if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_LOOPER)) { | 1156 if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_LOOPER)) { |
| 1157 Json::Value jsonLooper = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_LOOPER]; | 1157 Json::Value jsonLooper = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_LOOPER]; |
| 1158 SkDrawLooper* looper = (SkDrawLooper*) load_flattenable(jsonLooper, urlD ataManager); | 1158 sk_sp<SkDrawLooper> looper((SkDrawLooper*) load_flattenable(jsonLooper, urlDataManager)); |
| 1159 if (looper != nullptr) { | 1159 if (looper != nullptr) { |
| 1160 target->setLooper(looper); | 1160 target->setLooper(looper); |
|
f(malita)
2016/03/21 13:53:44
nit: ditto
reed1
2016/03/21 17:15:23
Done.
| |
| 1161 looper->unref(); | |
| 1162 } | 1161 } |
| 1163 } | 1162 } |
| 1164 } | 1163 } |
| 1165 | 1164 |
| 1166 static void extract_json_paint_imagefilter(Json::Value& jsonPaint, UrlDataManage r& urlDataManager, | 1165 static void extract_json_paint_imagefilter(Json::Value& jsonPaint, UrlDataManage r& urlDataManager, |
| 1167 SkPaint* target) { | 1166 SkPaint* target) { |
| 1168 if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_IMAGEFILTER)) { | 1167 if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_IMAGEFILTER)) { |
| 1169 Json::Value jsonImageFilter = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_IMAGEFIL TER]; | 1168 Json::Value jsonImageFilter = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_IMAGEFIL TER]; |
| 1170 SkImageFilter* imageFilter = (SkImageFilter*) load_flattenable(jsonImage Filter, | 1169 SkImageFilter* imageFilter = (SkImageFilter*) load_flattenable(jsonImage Filter, |
| 1171 urlDataMa nager); | 1170 urlDataMa nager); |
| (...skipping 1931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3103 result[SKDEBUGCANVAS_ATTRIBUTE_MATRIX] = MakeJsonMatrix(fMatrix); | 3102 result[SKDEBUGCANVAS_ATTRIBUTE_MATRIX] = MakeJsonMatrix(fMatrix); |
| 3104 return result; | 3103 return result; |
| 3105 } | 3104 } |
| 3106 | 3105 |
| 3107 SkSetMatrixCommand* SkSetMatrixCommand::fromJSON(Json::Value& command, | 3106 SkSetMatrixCommand* SkSetMatrixCommand::fromJSON(Json::Value& command, |
| 3108 UrlDataManager& urlDataManager) { | 3107 UrlDataManager& urlDataManager) { |
| 3109 SkMatrix matrix; | 3108 SkMatrix matrix; |
| 3110 extract_json_matrix(command[SKDEBUGCANVAS_ATTRIBUTE_MATRIX], &matrix); | 3109 extract_json_matrix(command[SKDEBUGCANVAS_ATTRIBUTE_MATRIX], &matrix); |
| 3111 return new SkSetMatrixCommand(matrix); | 3110 return new SkSetMatrixCommand(matrix); |
| 3112 } | 3111 } |
| OLD | NEW |