Chromium Code Reviews

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

Issue 248613004: Fast path for blurred round rects -- blur a small 9patch rect on the CPU (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address windows build warnings Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « gm/blurroundrect.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 22 matching lines...)
33 static bool BlurRect(SkScalar sigma, SkMask *dst, const SkRect &src, 33 static bool BlurRect(SkScalar sigma, SkMask *dst, const SkRect &src,
34 Style style, 34 Style style,
35 SkIPoint *margin = NULL, 35 SkIPoint *margin = NULL,
36 SkMask::CreateMode createMode = 36 SkMask::CreateMode createMode =
37 SkMask::kComputeBoundsAndRenderI mage_CreateMode); 37 SkMask::kComputeBoundsAndRenderI mage_CreateMode);
38 static bool BlurRRect(SkScalar sigma, SkMask *dst, const SkRRect &src, 38 static bool BlurRRect(SkScalar sigma, SkMask *dst, const SkRRect &src,
39 Style style, 39 Style style,
40 SkIPoint *margin = NULL, 40 SkIPoint *margin = NULL,
41 SkMask::CreateMode createMode = 41 SkMask::CreateMode createMode =
42 SkMask::kComputeBoundsAndRenderI mage_CreateMode); 42 SkMask::kComputeBoundsAndRenderI mage_CreateMode);
43
44 // forceQuality will prevent BoxBlur from falling back to the low quality ap proach when sigma
45 // is very small -- this can be used predict the margin bump ahead of time w ithout completely
46 // replicating the internal logic. This permits not only simpler caching of blurred results,
47 // but also being able to predict precisely at what pixels the blurred profi le of e.g. a
48 // rectangle will lie.
49
43 static bool BoxBlur(SkMask* dst, const SkMask& src, 50 static bool BoxBlur(SkMask* dst, const SkMask& src,
44 SkScalar sigma, Style style, Quality quality, 51 SkScalar sigma, Style style, Quality quality,
45 SkIPoint* margin = NULL); 52 SkIPoint* margin = NULL, bool forceQuality = false);
reed1 2014/04/23 21:48:00 What is the impact on the raster side if we just a
46 53
47 // the "ground truth" blur does a gaussian convolution; it's slow 54 // the "ground truth" blur does a gaussian convolution; it's slow
48 // but useful for comparison purposes. 55 // but useful for comparison purposes.
49 static bool BlurGroundTruth(SkScalar sigma, SkMask* dst, const SkMask& src, 56 static bool BlurGroundTruth(SkScalar sigma, SkMask* dst, const SkMask& src,
50 Style style, 57 Style style,
51 SkIPoint* margin = NULL); 58 SkIPoint* margin = NULL);
52 59
53 static SkScalar ConvertRadiusToSigma(SkScalar radius); 60 static SkScalar ConvertRadiusToSigma(SkScalar radius);
54 61
55 /* Helper functions for analytic rectangle blurs */ 62 /* Helper functions for analytic rectangle blurs */
(...skipping 26 matching lines...)
82 */ 89 */
83 90
84 static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile, 91 static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile,
85 unsigned int width, SkScalar sigma); 92 unsigned int width, SkScalar sigma);
86 93
87 94
88 95
89 }; 96 };
90 97
91 #endif 98 #endif
OLDNEW
« no previous file with comments | « gm/blurroundrect.cpp ('k') | src/effects/SkBlurMask.cpp » ('j') | no next file with comments »

Powered by Google App Engine