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

Unified Diff: include/gpu/GrContext.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: include/gpu/GrContext.h
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 4172543b5eca25fccb8d77cab7935706b3d21950..5da8ae26d6eb4e8e2748391bf8530042349ae394 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -32,6 +32,7 @@ class GrInOrderDrawBuffer;
class GrLayerCache;
class GrOvalRenderer;
class GrPath;
+class GrPathRange;
class GrPathRenderer;
class GrResourceEntry;
class GrResourceCache;
@@ -44,7 +45,9 @@ class GrVertexBuffer;
class GrVertexBufferAllocPool;
class GrStrokeInfo;
class GrSoftwarePathRenderer;
+class SkDescriptor;
class SkStrokeRec;
+class SkTypeface;
class SK_API GrContext : public SkRefCnt {
public:
@@ -1064,6 +1067,35 @@ private:
*/
GrPath* createPath(const SkPath& skPath, const SkStrokeRec& stroke);
+ /**
+ * Creates a range of glyph paths, indexed by glyph id. The glyphs will have an
bsalomon 2014/09/15 14:16:21 Does this have to go here or can it go in the text
Chris Dalton 2014/09/15 21:05:25 I put it here because I thought it ought to follow
+ * 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 gpu supports path rendering.
+ */
+ GrPathRange* createGlyphs(const SkTypeface*, const SkDescriptor*, const SkStrokeRec&);
+
typedef SkRefCnt INHERITED;
};
« no previous file with comments | « include/core/SkTypeface.h ('k') | src/gpu/GrContext.cpp » ('j') | src/gpu/GrGpu.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698