182aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com/*
282aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com * Copyright 2012 The Android Open Source Project
382aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com *
482aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com * Use of this source code is governed by a BSD-style license that can be
582aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com * found in the LICENSE file.
682aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com */
782aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com
882aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com
982aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com#ifndef SkMagnifierImageFilter_DEFINED
1082aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com#define SkMagnifierImageFilter_DEFINED
1182aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com
1282aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com#include "SkRect.h"
1382aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com#include "SkImageFilter.h"
1482aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com
1582aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.comclass SK_API SkMagnifierImageFilter : public SkImageFilter {
1682aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.compublic:
179fa60daad4d5f54c0dbe3dbcc7608a8f6d721187reed    static SkImageFilter* Create(const SkRect& src, SkScalar inset, SkImageFilter* input = NULL);
1882aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com
1982aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com    SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter)
2082aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com
2182aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.comprotected:
229ea3d57fde28a5fe4487a111dc3dd49418235e5esenorblanco    SkMagnifierImageFilter(const SkRect& srcRect, SkScalar inset, SkImageFilter* input);
239fa60daad4d5f54c0dbe3dbcc7608a8f6d721187reed#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
248b0e8ac5f582de80356019406e2975079bf0829dcommit-bot@chromium.org    explicit SkMagnifierImageFilter(SkReadBuffer& buffer);
259fa60daad4d5f54c0dbe3dbcc7608a8f6d721187reed#endif
268b0e8ac5f582de80356019406e2975079bf0829dcommit-bot@chromium.org    virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
2782aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com
284cb543d6057b692e1099e9f115155f0bf323a0c8senorblanco@chromium.org    virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
29ae761f7545d8ebf181d220169afac2056b057b8ccommit-bot@chromium.org                               SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
301aa68723b8ef4ce0b6db9fe51e7d8051cdd543ffsenorblanco@chromium.org#if SK_SUPPORT_GPU
31b0a8a377f832c59cee939ad721e1f87d378b7142joshualitt    virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&,
32b0a8a377f832c59cee939ad721e1f87d378b7142joshualitt                                     const SkIRect& bounds) const SK_OVERRIDE;
331aa68723b8ef4ce0b6db9fe51e7d8051cdd543ffsenorblanco@chromium.org#endif
3482aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com
3582aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.comprivate:
3682aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com    SkRect fSrcRect;
3782aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com    SkScalar fInset;
3882aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com    typedef SkImageFilter INHERITED;
3982aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com};
4082aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com
4182aa7482cbf55ce6d42c692550cadee5e23146e4bsalomon@google.com#endif
42