blob: 0acb13ec5a9d18a90ad49377aae501fa3fc6dfa3 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
2/*
3 * Copyright 2006 The Android Open Source Project
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
reed@android.com8a1c16f2008-12-17 15:59:43 +00009
10#include "SkDrawBlur.h"
11
12#if SK_USE_CONDENSED_INFO == 0
13
14const SkMemberInfo SkDrawBlur::fInfo[] = {
robertphillips@google.comb7061172013-09-06 14:16:12 +000015 SK_MEMBER(fBlurStyle, MaskFilterBlurStyle),
16 SK_MEMBER(fSigma, Float)
reed@android.com8a1c16f2008-12-17 15:59:43 +000017};
18
19#endif
20
21DEFINE_GET_MEMBER(SkDrawBlur);
22
skia.committer@gmail.comb3ec29d2013-09-07 07:01:16 +000023SkDrawBlur::SkDrawBlur()
robertphillips@google.comb7061172013-09-06 14:16:12 +000024 : fSigma(-1)
commit-bot@chromium.orge3964552014-04-28 16:25:35 +000025 , fBlurStyle(kNormal_SkBlurStyle) {
reed@android.com8a1c16f2008-12-17 15:59:43 +000026}
27
28SkMaskFilter* SkDrawBlur::getMaskFilter() {
commit-bot@chromium.orge3964552014-04-28 16:25:35 +000029 if (fSigma <= 0) {
halcanary96fcdcc2015-08-27 07:41:13 -070030 return nullptr;
commit-bot@chromium.orge3964552014-04-28 16:25:35 +000031 }
reedefdfd512016-04-04 10:02:58 -070032 return SkBlurMaskFilter::Make((SkBlurStyle)fBlurStyle, fSigma).release();
reed@android.com8a1c16f2008-12-17 15:59:43 +000033}