1 /* 2 * Copyright 2012 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 SkOffsetImageFilter_DEFINED 9 #define SkOffsetImageFilter_DEFINED 10 11 #include "SkImageFilter.h" 12 #include "SkPoint.h" 13 14 class SK_API SkOffsetImageFilter : public SkImageFilter { 15 typedef SkImageFilter INHERITED; 16 17 public: 18 SkOffsetImageFilter(SkScalar dx, SkScalar dy, SkImageFilter* input = NULL, 19 const CropRect* cropRect = NULL); 20 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkOffsetImageFilter) 21 22 protected: 23 SkOffsetImageFilter(SkFlattenableReadBuffer& buffer); 24 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 25 26 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, 27 SkBitmap* result, SkIPoint* loc) SK_OVERRIDE; 28 virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) SK_OVERRIDE; 29 30 private: 31 SkVector fOffset; 32 }; 33 34 #endif 35