blob: 314ab070b65e827870b33d3c118c62e1a9383db6 [file] [log] [blame]
senorblanco@chromium.org44888c62012-08-20 19:23:24 +00001/*
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
senorblanco@chromium.org377c14a2013-02-04 22:57:21 +000011#include "SkImageFilter.h"
senorblanco@chromium.org44888c62012-08-20 19:23:24 +000012
13class SkColorFilter;
14
senorblanco@chromium.org377c14a2013-02-04 22:57:21 +000015class SK_API SkColorFilterImageFilter : public SkImageFilter {
senorblanco@chromium.org44888c62012-08-20 19:23:24 +000016public:
senorblanco@chromium.orgccf225c2013-07-22 20:03:22 +000017 static SkColorFilterImageFilter* Create(SkColorFilter* cf,
18 SkImageFilter* input = NULL,
19 const SkIRect* cropRect = NULL);
senorblanco@chromium.org44888c62012-08-20 19:23:24 +000020 virtual ~SkColorFilterImageFilter();
21
22 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorFilterImageFilter)
rmistry@google.comfbfcd562012-08-23 18:09:54 +000023
senorblanco@chromium.org44888c62012-08-20 19:23:24 +000024protected:
25 SkColorFilterImageFilter(SkFlattenableReadBuffer& buffer);
26 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
rmistry@google.comfbfcd562012-08-23 18:09:54 +000027
senorblanco@chromium.org44888c62012-08-20 19:23:24 +000028 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
29 SkBitmap* result, SkIPoint* loc) SK_OVERRIDE;
rmistry@google.comfbfcd562012-08-23 18:09:54 +000030
sugoi@google.coma1c511b2013-02-21 15:02:28 +000031 virtual bool asColorFilter(SkColorFilter**) const SK_OVERRIDE;
senorblanco@chromium.org8d21f6c2012-10-12 19:14:06 +000032
senorblanco@chromium.org44888c62012-08-20 19:23:24 +000033private:
senorblanco@chromium.orgccf225c2013-07-22 20:03:22 +000034 SkColorFilterImageFilter(SkColorFilter* cf,
35 SkImageFilter* input,
36 const SkIRect* cropRect = NULL);
senorblanco@chromium.org44888c62012-08-20 19:23:24 +000037 SkColorFilter* fColorFilter;
rmistry@google.comfbfcd562012-08-23 18:09:54 +000038
senorblanco@chromium.org377c14a2013-02-04 22:57:21 +000039 typedef SkImageFilter INHERITED;
senorblanco@chromium.org44888c62012-08-20 19:23:24 +000040};
41
42#endif