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

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

Issue 17035007: Fix quickReject computation for blurs (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: updated Created 7 years, 4 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/SkBlurMask.h ('k') | src/effects/SkBlurMaskFilter.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 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
11 #include "SkMath.h" 11 #include "SkMath.h"
12 #include "SkTemplates.h" 12 #include "SkTemplates.h"
13 #include "SkEndian.h" 13 #include "SkEndian.h"
14 14
15 // scale factor for the blur radius to match the behavior of the all existing bl ur 15 const SkScalar SkBlurMask::kBlurRadiusFudgeFactor = SkFloatToScalar(.57735f);
16 // code (both on the CPU and the GPU). This magic constant is 1/sqrt(3).
17
18 // TODO: get rid of this fudge factor and move any required fudging up into
19 // the calling library
20
21 #define kBlurRadiusFudgeFactor SkFloatToScalar( .57735f )
22 16
23 #define UNROLL_SEPARABLE_LOOPS 17 #define UNROLL_SEPARABLE_LOOPS
24 18
25 /** 19 /**
26 * This function performs a box blur in X, of the given radius. If the 20 * This function performs a box blur in X, of the given radius. If the
27 * "transpose" parameter is true, it will transpose the pixels on write, 21 * "transpose" parameter is true, it will transpose the pixels on write,
28 * such that X and Y are swapped. Reads are always performed from contiguous 22 * such that X and Y are swapped. Reads are always performed from contiguous
29 * memory in X, for speed. The destination buffer (dst) must be at least 23 * memory in X, for speed. The destination buffer (dst) must be at least
30 * (width + leftRadius + rightRadius) * height bytes in size. 24 * (width + leftRadius + rightRadius) * height bytes in size.
31 * 25 *
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 (void)autoCall.detach(); 976 (void)autoCall.detach();
983 } 977 }
984 978
985 if (style == kInner_Style) { 979 if (style == kInner_Style) {
986 dst->fBounds = src.fBounds; // restore trimmed bounds 980 dst->fBounds = src.fBounds; // restore trimmed bounds
987 dst->fRowBytes = src.fRowBytes; 981 dst->fRowBytes = src.fRowBytes;
988 } 982 }
989 983
990 return true; 984 return true;
991 } 985 }
OLDNEW
« no previous file with comments | « src/effects/SkBlurMask.h ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698