Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: tools/debugger/SkDrawCommand.cpp

Issue 1821103004: Revert of Revert[2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/android/SkAndroidSDKCanvas.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 target->setMaskFilter(maskFilter); 1152 target->setMaskFilter(maskFilter);
1153 maskFilter->unref(); 1153 maskFilter->unref();
1154 } 1154 }
1155 } 1155 }
1156 } 1156 }
1157 1157
1158 static void extract_json_paint_colorfilter(Json::Value& jsonPaint, UrlDataManage r& urlDataManager, 1158 static void extract_json_paint_colorfilter(Json::Value& jsonPaint, UrlDataManage r& urlDataManager,
1159 SkPaint* target) { 1159 SkPaint* target) {
1160 if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_COLORFILTER)) { 1160 if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_COLORFILTER)) {
1161 Json::Value jsonColorFilter = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_COLORFIL TER]; 1161 Json::Value jsonColorFilter = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_COLORFIL TER];
1162 sk_sp<SkColorFilter> colorFilter((SkColorFilter*)load_flattenable(jsonCo lorFilter, 1162 SkColorFilter* colorFilter = (SkColorFilter*) load_flattenable(jsonColor Filter,
1163 urlDat aManager)); 1163 urlDataMa nager);
1164 if (colorFilter != nullptr) { 1164 if (colorFilter != nullptr) {
1165 target->setColorFilter(colorFilter); 1165 target->setColorFilter(colorFilter);
1166 colorFilter->unref();
1166 } 1167 }
1167 } 1168 }
1168 } 1169 }
1169 1170
1170 static void extract_json_paint_xfermode(Json::Value& jsonPaint, UrlDataManager& urlDataManager, 1171 static void extract_json_paint_xfermode(Json::Value& jsonPaint, UrlDataManager& urlDataManager,
1171 SkPaint* target) { 1172 SkPaint* target) {
1172 if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_XFERMODE)) { 1173 if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_XFERMODE)) {
1173 Json::Value jsonXfermode = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_XFERMODE]; 1174 Json::Value jsonXfermode = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_XFERMODE];
1174 SkXfermode* xfermode = (SkXfermode*) load_flattenable(jsonXfermode, urlD ataManager); 1175 SkXfermode* xfermode = (SkXfermode*) load_flattenable(jsonXfermode, urlD ataManager);
1175 if (xfermode != nullptr) { 1176 if (xfermode != nullptr) {
(...skipping 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after
3130 result[SKDEBUGCANVAS_ATTRIBUTE_MATRIX] = MakeJsonMatrix(fMatrix); 3131 result[SKDEBUGCANVAS_ATTRIBUTE_MATRIX] = MakeJsonMatrix(fMatrix);
3131 return result; 3132 return result;
3132 } 3133 }
3133 3134
3134 SkSetMatrixCommand* SkSetMatrixCommand::fromJSON(Json::Value& command, 3135 SkSetMatrixCommand* SkSetMatrixCommand::fromJSON(Json::Value& command,
3135 UrlDataManager& urlDataManager) { 3136 UrlDataManager& urlDataManager) {
3136 SkMatrix matrix; 3137 SkMatrix matrix;
3137 extract_json_matrix(command[SKDEBUGCANVAS_ATTRIBUTE_MATRIX], &matrix); 3138 extract_json_matrix(command[SKDEBUGCANVAS_ATTRIBUTE_MATRIX], &matrix);
3138 return new SkSetMatrixCommand(matrix); 3139 return new SkSetMatrixCommand(matrix);
3139 } 3140 }
OLDNEW
« no previous file with comments | « tools/android/SkAndroidSDKCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698