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

Unified Diff: tools/debugger/SkDrawCommand.cpp

Issue 1852113003: switch maskfilters to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/PaintTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/debugger/SkDrawCommand.cpp
diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp
index d868418d54ba8b4506fbaa05bb38a2f88f6979ec..985f7d5cc3705de219d2b7620e69e1fd0456b941 100644
--- a/tools/debugger/SkDrawCommand.cpp
+++ b/tools/debugger/SkDrawCommand.cpp
@@ -1145,10 +1145,10 @@ static void extract_json_paint_maskfilter(Json::Value& jsonPaint, UrlDataManager
SkPaint* target) {
if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_MASKFILTER)) {
Json::Value jsonMaskFilter = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_MASKFILTER];
- SkMaskFilter* maskFilter = (SkMaskFilter*) load_flattenable(jsonMaskFilter, urlDataManager);
- if (maskFilter != nullptr) {
- target->setMaskFilter(maskFilter);
- maskFilter->unref();
+ sk_sp<SkMaskFilter> maskFilter((SkMaskFilter*)load_flattenable(jsonMaskFilter,
+ urlDataManager));
+ if (maskFilter) {
+ target->setMaskFilter(std::move(maskFilter));
}
}
}
@@ -1339,7 +1339,7 @@ static void extract_json_paint_blur(Json::Value& jsonPaint, SkPaint* target) {
SkASSERT(false);
flags = SkBlurMaskFilter::BlurFlags::kNone_BlurFlag;
}
- target->setMaskFilter(SkBlurMaskFilter::Create(style, sigma, flags));
+ target->setMaskFilter(SkBlurMaskFilter::Make(style, sigma, flags));
}
}
« no previous file with comments | « tests/PaintTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698