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

Unified Diff: src/gpu/GrGpu.h

Issue 563283004: Use per-typeface sets of glyphs for nvpr text (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_glyphmemorypath
Patch Set: Created 6 years, 3 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
Index: src/gpu/GrGpu.h
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 1ae2f5856bd4cfe8a521f9744991f26170c5793a..06f63872005fb9c0664707ccea4c09b07f36e81a 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -21,6 +21,8 @@ class GrPathRenderer;
class GrPathRendererChain;
class GrStencilBuffer;
class GrVertexBufferAllocPool;
+class SkDescriptor;
+class SkTypeface;
class GrGpu : public GrDrawTarget {
public:
@@ -149,11 +151,33 @@ public:
GrPath* createPath(const SkPath& path, const SkStrokeRec& stroke);
/**
- * Creates a path range object that can be used to draw multiple paths via
- * drawPaths(). It is only legal to call this if the caps report support for
- * path rendering.
+ * Creates a range of glyph paths, indexed by glyph id. The glyphs will have an
bsalomon 2014/09/15 14:16:21 I'm wondering if the PR class should be accessible
Chris Dalton 2014/09/15 21:05:25 That could work, but I think createPath() ought to
+ * inverted y-direction in order to match the raw font path data.
+ *
+ * @param SkTypeface Typeface that defines the glyphs.
+ * If null, the default typeface will be used.
+ *
+ * @param SkDescriptor Additional font configuration that specifies the font's size,
+ * stroke, and other flags. This will generally come from an
+ * SkGlyphCache.
+ *
+ * It is recommended to leave this value null when possible, in
+ * which case the glyphs will be loaded directly from the font's
+ * raw path data and sized at SkPaint::kCanonicalTextSizeForPaths.
+ * This results in less memory usage and more efficient GPU paths.
+ *
+ * If non-null, the glyph paths will match the font descriptor,
+ * including with the stroke information baked directly into
+ * the outlines.
+ *
+ * @param SkStrokeRec Common stroke that the GPU will apply to every path. Note
+ * that if the glyph outlines contain strokes from the font
+ * descriptor, this stroke will be applied on top of those
+ * outlines.
+ *
+ * It is only legal to call this if the caps report support for path rendering.
*/
- GrPathRange* createPathRange(size_t size, const SkStrokeRec&);
+ GrPathRange* createGlyphs(const SkTypeface*, const SkDescriptor*, const SkStrokeRec&);
/**
* Returns an index buffer that can be used to render quads.

Powered by Google App Engine
This is Rietveld 408576698