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

Unified Diff: src/effects/SkEmbossMaskFilter.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 | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkLayerDrawLooper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkEmbossMaskFilter.cpp
diff --git a/src/effects/SkEmbossMaskFilter.cpp b/src/effects/SkEmbossMaskFilter.cpp
index aa93e5a5942b9b6f77d27d9a7589c6661d582f17..5f3952d1ad841fa78c133abbfcb8c7675a2d105a 100644
--- a/src/effects/SkEmbossMaskFilter.cpp
+++ b/src/effects/SkEmbossMaskFilter.cpp
@@ -13,19 +13,21 @@
#include "SkWriteBuffer.h"
#include "SkString.h"
-SkMaskFilter* SkEmbossMaskFilter::Create(SkScalar blurSigma, const Light& light) {
- return new SkEmbossMaskFilter(blurSigma, light);
+sk_sp<SkMaskFilter> SkEmbossMaskFilter::Make(SkScalar blurSigma, const Light& light) {
+ return sk_sp<SkMaskFilter>(new SkEmbossMaskFilter(blurSigma, light));
}
+#ifdef SK_SUPPORT_LEGACY_MASKFILTER_PTR
SkMaskFilter* SkBlurMaskFilter::CreateEmboss(const SkScalar direction[3],
SkScalar ambient, SkScalar specular,
SkScalar blurRadius) {
return SkBlurMaskFilter::CreateEmboss(SkBlurMask::ConvertRadiusToSigma(blurRadius),
direction, ambient, specular);
}
+#endif
-SkMaskFilter* SkBlurMaskFilter::CreateEmboss(SkScalar blurSigma, const SkScalar direction[3],
- SkScalar ambient, SkScalar specular) {
+sk_sp<SkMaskFilter> SkBlurMaskFilter::MakeEmboss(SkScalar blurSigma, const SkScalar direction[3],
+ SkScalar ambient, SkScalar specular) {
if (direction == nullptr) {
return nullptr;
}
@@ -39,7 +41,7 @@ SkMaskFilter* SkBlurMaskFilter::CreateEmboss(SkScalar blurSigma, const SkScalar
static const SkScalar kSpecularMultiplier = SkIntToScalar(255) / 16;
light.fSpecular = static_cast<U8CPU>(SkScalarPin(specular, 0, 16) * kSpecularMultiplier + 0.5);
- return SkEmbossMaskFilter::Create(blurSigma, light);
+ return SkEmbossMaskFilter::Make(blurSigma, light);
}
///////////////////////////////////////////////////////////////////////////////
@@ -117,7 +119,7 @@ sk_sp<SkFlattenable> SkEmbossMaskFilter::CreateProc(SkReadBuffer& buffer) {
if (buffer.readByteArray(&light, sizeof(Light))) {
light.fPad = 0; // for the font-cache lookup to be clean
const SkScalar sigma = buffer.readScalar();
- return sk_sp<SkFlattenable>(Create(sigma, light));
+ return Make(sigma, light);
}
return nullptr;
}
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkLayerDrawLooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698