blob: 5f388c9310f68becdd9f5d99593d27be8f17aa71 [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)
25 , fBlurStyle(SkBlurMaskFilter::kNormal_BlurStyle) {
reed@android.com8a1c16f2008-12-17 15:59:43 +000026}
27
28SkMaskFilter* SkDrawBlur::getMaskFilter() {
robertphillips@google.comb7061172013-09-06 14:16:12 +000029 if (fSigma < 0)
reed@android.com8a1c16f2008-12-17 15:59:43 +000030 return NULL;
robertphillips@google.comb7061172013-09-06 14:16:12 +000031 return SkBlurMaskFilter::Create((SkBlurMaskFilter::BlurStyle) fBlurStyle, fSigma);
reed@android.com8a1c16f2008-12-17 15:59:43 +000032}