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

Unified Diff: include/core/SkPaint.h

Issue 1654883003: add helper to create fancy underlines (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix uninitialized var Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/texteffects.cpp ('k') | src/core/SkGlyph.h » ('j') | src/core/SkGlyph.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPaint.h
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index 51e8848a00b6f3ad07d6ed72a513941377cb5247..5c827e8c1543b5c91e4356907b910de35e578915 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -883,15 +883,59 @@ public:
SkRect bounds[] = NULL) const;
/** Return the path (outline) for the specified text.
- Note: just like SkCanvas::drawText, this will respect the Align setting
- in the paint.
- */
+ * Note: just like SkCanvas::drawText, this will respect the Align setting
+ * in the paint.
+ *
+ * @param text the text
+ * @param length number of bytes of text
+ * @param x The x-coordinate of the origin of the text.
+ * @param y The y-coordinate of the origin of the text.
+ * @param path The outline of the text.
+ */
void getTextPath(const void* text, size_t length, SkScalar x, SkScalar y,
SkPath* path) const;
+ /** Return the path (outline) for the specified text.
+ * Note: just like SkCanvas::drawText, this will respect the Align setting
+ * in the paint.
+ *
+ * @param text the text
+ * @param length number of bytes of text
+ * @param pos array of positions, used to position each character
+ * @param path The outline of the text.
+ */
void getPosTextPath(const void* text, size_t length,
const SkPoint pos[], SkPath* path) const;
+ /** Return the number of intervals that intersect the intercept along the axis of the advance.
+ * This permits constructing an underline that skips the descenders.
+ *
+ * @param text the text
+ * @param length number of bytes of text
+ * @param x The x-coordinate of the origin of the text.
+ * @param y The y-coordinate of the origin of the text.
+ * @param bounds The lower and upper line parallel to the advance.
+ * @param array If not null, the found intersections.
+ *
+ * @return The number of intersections.
+ */
+ int getTextIntercepts(const void* text, size_t length, SkScalar x, SkScalar y,
reed1 2016/02/05 18:56:59 If there is any extra burden, we can decide to not
caryclark 2016/02/05 19:43:36 The burden is very slight; nearly all of the code
+ SkScalar bounds[2], SkScalar* array) const;
+
+ /** Return the number of intervals that intersect the intercept along the axis of the advance.
+ * This permits constructing an underline that skips the descenders.
+ *
+ * @param text the text
+ * @param length number of bytes of text
+ * @param pos array of positions, used to position each character
+ * @param bounds The lower and upper line parallel to the advance.
+ * @param array If not null, the glyph bounds contained by the advance parallel lines.
+ *
+ * @return The number of glyph bounds.
+ */
+ int getPosTextIntercepts(const void* text, size_t length, const SkPoint pos[],
+ SkScalar bounds[2], SkScalar* array) const;
reed1 2016/02/05 18:56:59 SkScalar intervals[] ? Is an upper-bound on the s
reed1 2016/02/05 18:56:59 const SkScalar bounds[2] ?
caryclark 2016/02/05 19:43:36 If the string has no descenders at all, the size r
+
/**
* Return a rectangle that represents the union of the bounds of all
* of the glyphs, but each one positioned at (0,0). This may be conservatively large, and
@@ -1089,7 +1133,7 @@ private:
friend class GrTextUtils;
friend class GrGLPathRendering;
friend class SkScalerContext;
- friend class SkTextToPathIter;
+ friend class SkTextBaseIter;
friend class SkCanonicalizePaint;
};
« no previous file with comments | « gm/texteffects.cpp ('k') | src/core/SkGlyph.h » ('j') | src/core/SkGlyph.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698