aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-03-05 16:56:52 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-06 15:12:16 +0000
commit28d47731a1488009eed98c3ddfff2df2c95753c8 (patch)
tree8a7ac87f37f5df95ba67bb78c50a00891ae066b1 /src/core
parent0c4b7b1f2f1dd37204d401a6993119e5431942a6 (diff)
make compute helper for blurs private
Precursor for moving blurmaskfilter into core, since it is referenced by core code for drawShadow. Bug: skia: Change-Id: I900c6e10523115c75f45d2c410eb6a5ca56a6e4d Reviewed-on: https://skia-review.googlesource.com/112301 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkBlurPriv.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/core/SkBlurPriv.h b/src/core/SkBlurPriv.h
new file mode 100644
index 0000000000..d7a5c05b96
--- /dev/null
+++ b/src/core/SkBlurPriv.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2018 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkBlurPriv_DEFINED
+#define SkBlurPriv_DEFINED
+
+#include "SkRRect.h"
+#include "SkSize.h"
+
+static const int kSkBlurRRectMaxDivisions = 6;
+
+// This method computes all the parameters for drawing a partially occluded nine-patched
+// blurred rrect mask:
+// rrectToDraw - the integerized rrect to draw in the mask
+// widthHeight - how large to make the mask (rrectToDraw will be centered in this coord sys)
+// rectXs, rectYs - the x & y coordinates of the covering geometry lattice
+// texXs, texYs - the texture coordinate at each point in rectXs & rectYs
+// numXs, numYs - number of coordinates in the x & y directions
+// skipMask - bit mask that contains a 1-bit whenever one of the cells is occluded
+// It returns true if 'devRRect' is nine-patchable
+bool SkComputeBlurredRRectParams(const SkRRect& srcRRect, const SkRRect& devRRect,
+ const SkRect& occluder,
+ SkScalar sigma, SkScalar xformedSigma,
+ SkRRect* rrectToDraw,
+ SkISize* widthHeight,
+ SkScalar rectXs[kSkBlurRRectMaxDivisions],
+ SkScalar rectYs[kSkBlurRRectMaxDivisions],
+ SkScalar texXs[kSkBlurRRectMaxDivisions],
+ SkScalar texYs[kSkBlurRRectMaxDivisions],
+ int* numXs, int* numYs, uint32_t* skipMask);
+
+
+#endif