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

Side by Side Diff: src/effects/SkBlurMask.h

Issue 21835004: Blur refactoring (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Removed unneeded #includes Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/SkBlurDrawLooper.cpp ('k') | src/effects/SkBlurMask.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkBlurMask_DEFINED 10 #ifndef SkBlurMask_DEFINED
(...skipping 11 matching lines...) Expand all
22 kInner_Style, //!< fuzzy inside, nothing outside 22 kInner_Style, //!< fuzzy inside, nothing outside
23 23
24 kStyleCount 24 kStyleCount
25 }; 25 };
26 26
27 enum Quality { 27 enum Quality {
28 kLow_Quality, //!< box blur 28 kLow_Quality, //!< box blur
29 kHigh_Quality //!< three pass box blur (similar to gaussian) 29 kHigh_Quality //!< three pass box blur (similar to gaussian)
30 }; 30 };
31 31
32 static bool BlurRect(SkScalar sigma, SkMask *dst, const SkRect &src,
33 Style style,
34 SkIPoint *margin = NULL,
35 SkMask::CreateMode createMode =
36 SkMask::kComputeBoundsAndRenderI mage_CreateMode);
37 static bool BoxBlur(SkMask* dst, const SkMask& src,
38 SkScalar sigma, Style style, Quality quality,
39 SkIPoint* margin = NULL);
40
41 // the "ground truth" blur does a gaussian convolution; it's slow
42 // but useful for comparison purposes.
43 static bool BlurGroundTruth(SkScalar sigma, SkMask* dst, const SkMask& src,
44 Style style,
45 SkIPoint* margin = NULL);
46
47 // DEPRECATED - radius-based
32 static bool BlurRect(SkMask *dst, const SkRect &src, 48 static bool BlurRect(SkMask *dst, const SkRect &src,
33 SkScalar radius, Style style, 49 SkScalar radius, Style style,
34 SkIPoint *margin = NULL, 50 SkIPoint *margin = NULL,
35 SkMask::CreateMode createMode=SkMask::kComputeBoundsAnd RenderImage_CreateMode); 51 SkMask::CreateMode createMode =
52 SkMask::kComputeBoundsAndRenderI mage_CreateMode);
53 // DEPRECATED - radius-based
36 static bool Blur(SkMask* dst, const SkMask& src, 54 static bool Blur(SkMask* dst, const SkMask& src,
37 SkScalar radius, Style style, Quality quality, 55 SkScalar radius, Style style, Quality quality,
38 SkIPoint* margin = NULL); 56 SkIPoint* margin = NULL);
57 // DEPRECATED - radius-based
58 static bool BlurGroundTruth(SkMask* dst, const SkMask& src,
59 SkScalar radius, Style style,
60 SkIPoint* margin = NULL);
39 61
40 // the "ground truth" blur does a gaussian convolution; it's slow 62 static SkScalar ConvertRadiusToSigma(SkScalar radius);
41 // but useful for comparison purposes.
42
43 static bool BlurGroundTruth(SkMask* dst, const SkMask& src,
44 SkScalar provided_radius, Style style,
45 SkIPoint* margin = NULL);
46
47 // scale factor for the blur radius to match the behavior of the all existin g blur
48 // code (both on the CPU and the GPU). This magic constant is 1/sqrt(3).
49 // TODO: get rid of this fudge factor and move any required fudging up into
50 // the calling library
51 static const SkScalar kBlurRadiusFudgeFactor;
52
53 }; 63 };
54 64
55 #endif 65 #endif
OLDNEW
« no previous file with comments | « src/effects/SkBlurDrawLooper.cpp ('k') | src/effects/SkBlurMask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698