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 SkColorFilterImageFilter_DEFINED 9 #define SkColorFilterImageFilter_DEFINED 10 11 #include "SkImageFilter.h" 12 13 class SkColorFilter; 14 15 class SK_API SkColorFilterImageFilter : public SkImageFilter { 16 public: 17 static SkColorFilterImageFilter* Create(SkColorFilter* cf, 18 SkImageFilter* input = NULL, 19 const CropRect* cropRect = NULL); 20 virtual ~SkColorFilterImageFilter(); 21 22 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorFilterImageFilter) 23 24 protected: 25 SkColorFilterImageFilter(SkReadBuffer& buffer); 26 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; 27 28 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, 29 SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE; 30 31 virtual bool asColorFilter(SkColorFilter**) const SK_OVERRIDE; 32 33 private: 34 SkColorFilterImageFilter(SkColorFilter* cf, 35 SkImageFilter* input, 36 const CropRect* cropRect = NULL); 37 SkColorFilter* fColorFilter; 38 39 typedef SkImageFilter INHERITED; 40 }; 41 42 #endif 43