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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrGpu_DEFINED 8 #ifndef GrGpu_DEFINED
9 #define GrGpu_DEFINED 9 #define GrGpu_DEFINED
10 10
11 #include "GrDrawTarget.h" 11 #include "GrDrawTarget.h"
12 #include "GrClipMaskManager.h" 12 #include "GrClipMaskManager.h"
13 #include "GrPathRendering.h" 13 #include "GrPathRendering.h"
14 #include "SkPath.h" 14 #include "SkPath.h"
15 15
16 class GrContext; 16 class GrContext;
17 class GrIndexBufferAllocPool; 17 class GrIndexBufferAllocPool;
18 class GrPath; 18 class GrPath;
19 class GrPathRange; 19 class GrPathRange;
20 class GrPathRenderer; 20 class GrPathRenderer;
21 class GrPathRendererChain; 21 class GrPathRendererChain;
22 class GrStencilBuffer; 22 class GrStencilBuffer;
23 class GrVertexBufferAllocPool; 23 class GrVertexBufferAllocPool;
24 class SkDescriptor;
25 class SkTypeface;
24 26
25 class GrGpu : public GrDrawTarget { 27 class GrGpu : public GrDrawTarget {
26 public: 28 public:
27 29
28 /** 30 /**
29 * Additional blend coefficients for dual source blending, not exposed 31 * Additional blend coefficients for dual source blending, not exposed
30 * through GrPaint/GrContext. 32 * through GrPaint/GrContext.
31 */ 33 */
32 enum ExtendedBlendCoeffs { 34 enum ExtendedBlendCoeffs {
33 // source 2 refers to second output color when 35 // source 2 refers to second output color when
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 */ 144 */
143 GrIndexBuffer* createIndexBuffer(size_t size, bool dynamic); 145 GrIndexBuffer* createIndexBuffer(size_t size, bool dynamic);
144 146
145 /** 147 /**
146 * Creates a path object that can be stenciled using stencilPath(). It is 148 * Creates a path object that can be stenciled using stencilPath(). It is
147 * only legal to call this if the caps report support for path stenciling. 149 * only legal to call this if the caps report support for path stenciling.
148 */ 150 */
149 GrPath* createPath(const SkPath& path, const SkStrokeRec& stroke); 151 GrPath* createPath(const SkPath& path, const SkStrokeRec& stroke);
150 152
151 /** 153 /**
152 * Creates a path range object that can be used to draw multiple paths via 154 * 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
153 * drawPaths(). It is only legal to call this if the caps report support for 155 * inverted y-direction in order to match the raw font path data.
154 * path rendering. 156 *
157 * @param SkTypeface Typeface that defines the glyphs.
158 * If null, the default typeface will be used.
159 *
160 * @param SkDescriptor Additional font configuration that specifies the font 's size,
161 * stroke, and other flags. This will generally come fro m an
162 * SkGlyphCache.
163 *
164 * It is recommended to leave this value null when possi ble, in
165 * which case the glyphs will be loaded directly from th e font's
166 * raw path data and sized at SkPaint::kCanonicalTextSiz eForPaths.
167 * This results in less memory usage and more efficient GPU paths.
168 *
169 * If non-null, the glyph paths will match the font desc riptor,
170 * including with the stroke information baked directly into
171 * the outlines.
172 *
173 * @param SkStrokeRec Common stroke that the GPU will apply to every path. Note
174 * that if the glyph outlines contain strokes from the f ont
175 * descriptor, this stroke will be applied on top of tho se
176 * outlines.
177 *
178 * It is only legal to call this if the caps report support for path renderi ng.
155 */ 179 */
156 GrPathRange* createPathRange(size_t size, const SkStrokeRec&); 180 GrPathRange* createGlyphs(const SkTypeface*, const SkDescriptor*, const SkSt rokeRec&);
157 181
158 /** 182 /**
159 * Returns an index buffer that can be used to render quads. 183 * Returns an index buffer that can be used to render quads.
160 * Six indices per quad: 0, 1, 2, 0, 2, 3, etc. 184 * Six indices per quad: 0, 1, 2, 0, 2, 3, etc.
161 * The max number of quads can be queried using GrIndexBuffer::maxQuads(). 185 * The max number of quads can be queried using GrIndexBuffer::maxQuads().
162 * Draw with kTriangles_GrPrimitiveType 186 * Draw with kTriangles_GrPrimitiveType
163 * @ return the quad index buffer 187 * @ return the quad index buffer
164 */ 188 */
165 const GrIndexBuffer* getQuadIndexBuffer() const; 189 const GrIndexBuffer* getQuadIndexBuffer() const;
166 190
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 // counts number of uses of vertex/index pool in the geometry stack 542 // counts number of uses of vertex/index pool in the geometry stack
519 int fVertexP oolUseCnt; 543 int fVertexP oolUseCnt;
520 int fIndexPo olUseCnt; 544 int fIndexPo olUseCnt;
521 // these are mutable so they can be created on-demand 545 // these are mutable so they can be created on-demand
522 mutable GrIndexBuffer* fQuadInd exBuffer; 546 mutable GrIndexBuffer* fQuadInd exBuffer;
523 547
524 typedef GrDrawTarget INHERITED; 548 typedef GrDrawTarget INHERITED;
525 }; 549 };
526 550
527 #endif 551 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698