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

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

Issue 1518643002: SkBlurImageFilter returns input when sigma = 0 (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: clean up code Created 5 years 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 | « no previous file | no next file » | 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 2011 The Android Open Source Project 2 * Copyright 2011 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 #ifndef SkBlurImageFilter_DEFINED 8 #ifndef SkBlurImageFilter_DEFINED
9 #define SkBlurImageFilter_DEFINED 9 #define SkBlurImageFilter_DEFINED
10 10
11 #include "SkImageFilter.h" 11 #include "SkImageFilter.h"
12 #include "SkSize.h" 12 #include "SkSize.h"
13 13
14 class SK_API SkBlurImageFilter : public SkImageFilter { 14 class SK_API SkBlurImageFilter : public SkImageFilter {
15 public: 15 public:
16 static SkImageFilter* Create(SkScalar sigmaX, SkScalar sigmaY, SkImageFilter * input = NULL, 16 static SkImageFilter* Create(SkScalar sigmaX, SkScalar sigmaY, SkImageFilter * input = NULL,
17 const CropRect* cropRect = NULL) { 17 const CropRect* cropRect = NULL) {
18 if (0.0f == sigmaX && 0.0f == sigmaY && NULL == cropRect)
Stephen White 2015/12/10 16:05:40 Skia coding style requires braces on all statement
xidachen 2015/12/10 16:17:44 Done.
19 return input;
18 return new SkBlurImageFilter(sigmaX, sigmaY, input, cropRect); 20 return new SkBlurImageFilter(sigmaX, sigmaY, input, cropRect);
19 } 21 }
20 22
21 void computeFastBounds(const SkRect&, SkRect*) const override; 23 void computeFastBounds(const SkRect&, SkRect*) const override;
22 24
23 SK_TO_STRING_OVERRIDE() 25 SK_TO_STRING_OVERRIDE()
24 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurImageFilter) 26 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurImageFilter)
25 27
26 protected: 28 protected:
27 void flatten(SkWriteBuffer&) const override; 29 void flatten(SkWriteBuffer&) const override;
28 bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* re sult, 30 bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* re sult,
29 SkIPoint* offset) const override; 31 SkIPoint* offset) const override;
30 void onFilterNodeBounds(const SkIRect& src, const SkMatrix&, 32 void onFilterNodeBounds(const SkIRect& src, const SkMatrix&,
31 SkIRect* dst, MapDirection) const override; 33 SkIRect* dst, MapDirection) const override;
32 bool canFilterImageGPU() const override { return true; } 34 bool canFilterImageGPU() const override { return true; }
33 bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, S kBitmap* result, 35 bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, S kBitmap* result,
34 SkIPoint* offset) const override; 36 SkIPoint* offset) const override;
35 37
36 private: 38 private:
37 SkBlurImageFilter(SkScalar sigmaX, 39 SkBlurImageFilter(SkScalar sigmaX,
38 SkScalar sigmaY, 40 SkScalar sigmaY,
39 SkImageFilter* input, 41 SkImageFilter* input,
40 const CropRect* cropRect); 42 const CropRect* cropRect);
41 43
42 SkSize fSigma; 44 SkSize fSigma;
43 typedef SkImageFilter INHERITED; 45 typedef SkImageFilter INHERITED;
44 }; 46 };
45 47
46 #endif 48 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698