Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / include / effects / SkMagnifierImageFilter.h
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
9 #ifndef SkMagnifierImageFilter_DEFINED
10 #define SkMagnifierImageFilter_DEFINED
11
12 #include "SkRect.h"
13 #include "SkImageFilter.h"
14
15 class SK_API SkMagnifierImageFilter : public SkImageFilter {
16 public:
17     SkMagnifierImageFilter(SkRect srcRect, SkScalar inset);
18
19     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter)
20
21 protected:
22     explicit SkMagnifierImageFilter(SkReadBuffer& buffer);
23     virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
24
25     virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
26                                SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
27 #if SK_SUPPORT_GPU
28     virtual bool asNewEffect(GrEffectRef** effect, GrTexture* texture, const SkMatrix& matrix, const SkIRect& bounds) const SK_OVERRIDE;
29 #endif
30
31 private:
32     SkRect fSrcRect;
33     SkScalar fInset;
34     typedef SkImageFilter INHERITED;
35 };
36
37 #endif