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

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

Issue 1893973002: Outline SkImageFilter Make methods (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT 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 | « include/effects/SkOffsetImageFilter.h ('k') | include/effects/SkPictureImageFilter.h » ('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 2016 Google Inc. 2 * Copyright 2016 Google Inc.
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 #ifndef SkPaintImageFilter_DEFINED 8 #ifndef SkPaintImageFilter_DEFINED
9 #define SkPaintImageFilter_DEFINED 9 #define SkPaintImageFilter_DEFINED
10 10
11 #include "SkImageFilter.h" 11 #include "SkImageFilter.h"
12 #include "SkPaint.h" 12 #include "SkPaint.h"
13 13
14 class SK_API SkPaintImageFilter : public SkImageFilter { 14 class SK_API SkPaintImageFilter : public SkImageFilter {
15 public: 15 public:
16 /** Create a new image filter which fills the given rectangle using the 16 /** Create a new image filter which fills the given rectangle using the
17 * given paint. If no rectangle is specified, an output is produced with 17 * given paint. If no rectangle is specified, an output is produced with
18 * the same bounds as the input primitive (even though the input 18 * the same bounds as the input primitive (even though the input
19 * primitive's pixels are not used for processing). 19 * primitive's pixels are not used for processing).
20 * @param paint Paint to use when filling the rect. 20 * @param paint Paint to use when filling the rect.
21 * @param rect Rectangle of output pixels. If NULL or a given crop edge i s 21 * @param rect Rectangle of output pixels. If NULL or a given crop edge i s
22 * not specified, the source primitive's bounds are used 22 * not specified, the source primitive's bounds are used
23 * instead. 23 * instead.
24 */ 24 */
25 static sk_sp<SkImageFilter> Make(const SkPaint& paint, const CropRect* cropR ect = nullptr) { 25 static sk_sp<SkImageFilter> Make(const SkPaint& paint, const CropRect* cropR ect = nullptr);
26 return sk_sp<SkImageFilter>(new SkPaintImageFilter(paint, cropRect));
27 }
28 26
29 bool affectsTransparentBlack() const override; 27 bool affectsTransparentBlack() const override;
30 28
31 SK_TO_STRING_OVERRIDE() 29 SK_TO_STRING_OVERRIDE()
32 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPaintImageFilter) 30 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPaintImageFilter)
33 31
34 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR 32 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR
35 static SkImageFilter* Create(const SkPaint& paint, const CropRect* rect = nu llptr) { 33 static SkImageFilter* Create(const SkPaint& paint, const CropRect* rect = nu llptr) {
36 return Make(paint, rect).release(); 34 return Make(paint, rect).release();
37 } 35 }
38 #endif 36 #endif
39 37
40 protected: 38 protected:
41 void flatten(SkWriteBuffer&) const override; 39 void flatten(SkWriteBuffer&) const override;
42 sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, 40 sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
43 SkIPoint* offset) const override; 41 SkIPoint* offset) const override;
44 42
45 private: 43 private:
46 SkPaintImageFilter(const SkPaint& paint, const CropRect* rect); 44 SkPaintImageFilter(const SkPaint& paint, const CropRect* rect);
47 45
48 SkPaint fPaint; 46 SkPaint fPaint;
49 47
50 typedef SkImageFilter INHERITED; 48 typedef SkImageFilter INHERITED;
51 }; 49 };
52 50
53 #endif 51 #endif
OLDNEW
« no previous file with comments | « include/effects/SkOffsetImageFilter.h ('k') | include/effects/SkPictureImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698