Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: include/effects/SkMagnifierImageFilter.h

Issue 1882943002: Switch SkMagnifierImageFilter over to new onFilterImage interface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/imagemagnifier.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #ifndef SkMagnifierImageFilter_DEFINED 9 #ifndef SkMagnifierImageFilter_DEFINED
10 #define SkMagnifierImageFilter_DEFINED 10 #define SkMagnifierImageFilter_DEFINED
11 11
12 #include "SkRect.h" 12 #include "SkRect.h"
13 #include "SkImageFilter.h" 13 #include "SkImageFilter.h"
14 14
15 class SK_API SkMagnifierImageFilter : public SkImageFilter { 15 class SK_API SkMagnifierImageFilter : public SkImageFilter {
16 public: 16 public:
17 static sk_sp<SkImageFilter> Make(const SkRect& src, SkScalar inset, sk_sp<Sk ImageFilter> input); 17 static sk_sp<SkImageFilter> Make(const SkRect& src, SkScalar inset,
18 sk_sp<SkImageFilter> input,
19 const CropRect* cropRect = nullptr);
18 20
19 SK_TO_STRING_OVERRIDE() 21 SK_TO_STRING_OVERRIDE()
20 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter) 22 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter)
21 23
22 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR 24 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR
23 static SkImageFilter* Create(const SkRect& src, SkScalar inset, 25 static SkImageFilter* Create(const SkRect& src, SkScalar inset,
24 SkImageFilter* input = nullptr) { 26 SkImageFilter* input = nullptr) {
25 return Make(src, inset, sk_ref_sp<SkImageFilter>(input)).release(); 27 return Make(src, inset, sk_ref_sp<SkImageFilter>(input)).release();
26 } 28 }
27 #endif 29 #endif
28 30
29 protected: 31 protected:
30 SkMagnifierImageFilter(const SkRect& srcRect, SkScalar inset, sk_sp<SkImageF ilter> input); 32 SkMagnifierImageFilter(const SkRect& srcRect,
33 SkScalar inset,
34 sk_sp<SkImageFilter> input,
35 const CropRect* cropRect);
31 void flatten(SkWriteBuffer&) const override; 36 void flatten(SkWriteBuffer&) const override;
32 37
33 bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, 38 sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
34 SkBitmap* result, SkIPoint* offset) const overr ide; 39 SkIPoint* offset) const override;
35 #if SK_SUPPORT_GPU
36 bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&,
37 const SkIRect& bounds) const override;
38 #endif
39 40
40 private: 41 private:
41 SkRect fSrcRect; 42 SkRect fSrcRect;
42 SkScalar fInset; 43 SkScalar fInset;
43 typedef SkImageFilter INHERITED; 44 typedef SkImageFilter INHERITED;
44 }; 45 };
45 46
46 #endif 47 #endif
OLDNEW
« no previous file with comments | « gm/imagemagnifier.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698