aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkPaint.h3
-rw-r--r--include/core/SkScalar.h13
-rw-r--r--include/core/SkTypes.h11
3 files changed, 26 insertions, 1 deletions
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index 722bc5d851..16411d5886 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -863,9 +863,10 @@ private:
enum {
kCanonicalTextSizeForPaths = 64
};
+ friend class SkAutoGlyphCache;
friend class SkCanvas;
friend class SkDraw;
- friend class SkAutoGlyphCache;
+ friend class SkPDFDevice;
friend class SkTextToPathIter;
};
diff --git a/include/core/SkScalar.h b/include/core/SkScalar.h
index 9130a7cf12..e1a8a33b27 100644
--- a/include/core/SkScalar.h
+++ b/include/core/SkScalar.h
@@ -253,5 +253,18 @@ static inline SkScalar SkScalarInterp(SkScalar A, SkScalar B, SkScalar t) {
return A + SkScalarMul(B - A, t);
}
+/** Interpolate along the function described by (keys[length], values[length])
+ for the passed searchKey. SearchKeys outside the range keys[0]-keys[Length]
+ clamp to the min or max value. This function was inspired by a desire
+ to change the multiplier for thickness in fakeBold; therefore it assumes
+ the number of pairs (length) will be small, and a linear search is used.
+ Repeated keys are allowed for discontinuous functions (so long as keys is
+ monotonically increasing), and if key is the value of a repeated scalar in
+ keys, the first one will be used. However, that may change if a binary
+ search is used.
+*/
+SkScalar SkScalarInterpFunc(SkScalar searchKey, const SkScalar keys[],
+ const SkScalar values[], int length);
+
#endif
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 1f8ecaaf63..85f542136e 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -103,6 +103,17 @@ static inline void sk_bzero(void* buffer, size_t size) {
#define SkAssertResult(cond) cond
#endif
+namespace {
+
+template <bool>
+struct SkCompileAssert {
+};
+
+} // namespace
+
+#define SK_COMPILE_ASSERT(expr, msg) \
+ typedef SkCompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
+
///////////////////////////////////////////////////////////////////////
/** Fast type for signed 8 bits. Use for parameter passing and local variables, not for storage