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

Unified Diff: src/views/SkWidgets.cpp

Issue 173633003: Factory methods for heap-allocated SkMaskFilter objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add SkTableMaskFilter::Create(table) and remove deprecated SkEmbossMaskFilter constructor. Created 6 years, 10 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/SkEmbossMaskFilter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/views/SkWidgets.cpp
diff --git a/src/views/SkWidgets.cpp b/src/views/SkWidgets.cpp
index fb16f1ec0d82b8c992ffea5b9d360107e61d721a..cde2b427389fad6c738289c1716ca2a471804764 100644
--- a/src/views/SkWidgets.cpp
+++ b/src/views/SkWidgets.cpp
@@ -234,6 +234,7 @@ static const char* computeAnimatorState(int enabled, int focused, SkButtonWidget
return "enabled";
}
+#include "SkBlurMask.h"
#include "SkBlurMaskFilter.h"
#include "SkEmbossMaskFilter.h"
@@ -255,7 +256,8 @@ static void create_emboss(SkPaint* paint, SkScalar radius, bool focus, bool pres
if (focus)
light.fDirection[2] += SK_Scalar1/4;
- paint->setMaskFilter(new SkEmbossMaskFilter(light, radius))->unref();
+ SkScalar sigma = SkBlurMask::ConvertRadiusToSigma(radius);
+ paint->setMaskFilter(new SkEmbossMaskFilter(sigma, light))->unref();
}
void SkPushButtonWidget::onDraw(SkCanvas* canvas)
« no previous file with comments | « src/effects/SkEmbossMaskFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698