1 /* 2 * Copyright 2011 The Android Open Source Project 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef SkBlurImageFilter_DEFINED 9 #define SkBlurImageFilter_DEFINED 10 11 #include "SkSingleInputImageFilter.h" 12 #include "SkSize.h" 13 14 class SK_API SkBlurImageFilter : public SkSingleInputImageFilter { 15 public: 16 SkBlurImageFilter(SkScalar sigmaX, SkScalar sigmaY, SkImageFilter* input = NULL); 17 18 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurImageFilter) 19 20 protected: 21 explicit SkBlurImageFilter(SkFlattenableReadBuffer& buffer); 22 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 23 24 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, 25 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; 26 27 bool canFilterImageGPU() const SK_OVERRIDE { return true; } 28 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, SkBitmap* result) SK_OVERRIDE; 29 30 private: 31 SkSize fSigma; 32 typedef SkSingleInputImageFilter INHERITED; 33 }; 34 35 #endif 36