OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 GrContext_DEFINED | 8 #ifndef GrContext_DEFINED |
9 #define GrContext_DEFINED | 9 #define GrContext_DEFINED |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... | |
25 class GrEffect; | 25 class GrEffect; |
26 class GrFontCache; | 26 class GrFontCache; |
27 class GrGpu; | 27 class GrGpu; |
28 class GrGpuTraceMarker; | 28 class GrGpuTraceMarker; |
29 class GrIndexBuffer; | 29 class GrIndexBuffer; |
30 class GrIndexBufferAllocPool; | 30 class GrIndexBufferAllocPool; |
31 class GrInOrderDrawBuffer; | 31 class GrInOrderDrawBuffer; |
32 class GrLayerCache; | 32 class GrLayerCache; |
33 class GrOvalRenderer; | 33 class GrOvalRenderer; |
34 class GrPath; | 34 class GrPath; |
35 class GrPathRange; | |
35 class GrPathRenderer; | 36 class GrPathRenderer; |
36 class GrResourceEntry; | 37 class GrResourceEntry; |
37 class GrResourceCache; | 38 class GrResourceCache; |
38 class GrResourceCache2; | 39 class GrResourceCache2; |
39 class GrStencilBuffer; | 40 class GrStencilBuffer; |
40 class GrTestTarget; | 41 class GrTestTarget; |
41 class GrTextContext; | 42 class GrTextContext; |
42 class GrTextureParams; | 43 class GrTextureParams; |
43 class GrVertexBuffer; | 44 class GrVertexBuffer; |
44 class GrVertexBufferAllocPool; | 45 class GrVertexBufferAllocPool; |
45 class GrStrokeInfo; | 46 class GrStrokeInfo; |
46 class GrSoftwarePathRenderer; | 47 class GrSoftwarePathRenderer; |
48 class SkDescriptor; | |
47 class SkStrokeRec; | 49 class SkStrokeRec; |
50 class SkTypeface; | |
48 | 51 |
49 class SK_API GrContext : public SkRefCnt { | 52 class SK_API GrContext : public SkRefCnt { |
50 public: | 53 public: |
51 SK_DECLARE_INST_COUNT(GrContext) | 54 SK_DECLARE_INST_COUNT(GrContext) |
52 | 55 |
53 struct Options { | 56 struct Options { |
54 Options() : fDrawPathToCompressedTexture(false) { } | 57 Options() : fDrawPathToCompressedTexture(false) { } |
55 | 58 |
56 // EXPERIMENTAL | 59 // EXPERIMENTAL |
57 // May be removed in the future, or may become standard depending | 60 // May be removed in the future, or may become standard depending |
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1057 | 1060 |
1058 /** Creates a new gpu path, based on the specified path and stroke and retur ns it. | 1061 /** Creates a new gpu path, based on the specified path and stroke and retur ns it. |
1059 * The caller owns a ref on the returned path which must be balanced by a ca ll to unref. | 1062 * The caller owns a ref on the returned path which must be balanced by a ca ll to unref. |
1060 * | 1063 * |
1061 * @param skPath the path geometry. | 1064 * @param skPath the path geometry. |
1062 * @param stroke the path stroke. | 1065 * @param stroke the path stroke. |
1063 * @return a new path or NULL if the operation is not supported by the backe nd. | 1066 * @return a new path or NULL if the operation is not supported by the backe nd. |
1064 */ | 1067 */ |
1065 GrPath* createPath(const SkPath& skPath, const SkStrokeRec& stroke); | 1068 GrPath* createPath(const SkPath& skPath, const SkStrokeRec& stroke); |
1066 | 1069 |
1070 /** | |
1071 * 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
| |
1072 * inverted y-direction in order to match the raw font path data. | |
1073 * | |
1074 * @param SkTypeface Typeface that defines the glyphs. | |
1075 * If null, the default typeface will be used. | |
1076 * | |
1077 * @param SkDescriptor Additional font configuration that specifies the font 's size, | |
1078 * stroke, and other flags. This will generally come fro m an | |
1079 * SkGlyphCache. | |
1080 * | |
1081 * It is recommended to leave this value null when possi ble, in | |
1082 * which case the glyphs will be loaded directly from th e font's | |
1083 * raw path data and sized at SkPaint::kCanonicalTextSiz eForPaths. | |
1084 * This results in less memory usage and more efficient GPU paths. | |
1085 * | |
1086 * If non-null, the glyph paths will match the font desc riptor, | |
1087 * including with the stroke information baked directly into | |
1088 * the outlines. | |
1089 * | |
1090 * @param SkStrokeRec Common stroke that the GPU will apply to every path. Note | |
1091 * that if the glyph outlines contain strokes from the f ont | |
1092 * descriptor, this stroke will be applied on top of tho se | |
1093 * outlines. | |
1094 * | |
1095 * It is only legal to call this if the gpu supports path rendering. | |
1096 */ | |
1097 GrPathRange* createGlyphs(const SkTypeface*, const SkDescriptor*, const SkSt rokeRec&); | |
1098 | |
1067 typedef SkRefCnt INHERITED; | 1099 typedef SkRefCnt INHERITED; |
1068 }; | 1100 }; |
1069 | 1101 |
1070 /** | 1102 /** |
1071 * Gets and locks a scratch texture from a descriptor using either exact or appr oximate criteria. | 1103 * Gets and locks a scratch texture from a descriptor using either exact or appr oximate criteria. |
1072 * Unlocks texture in the destructor. | 1104 * Unlocks texture in the destructor. |
1073 */ | 1105 */ |
1074 class GrAutoScratchTexture : public ::SkNoncopyable { | 1106 class GrAutoScratchTexture : public ::SkNoncopyable { |
1075 public: | 1107 public: |
1076 GrAutoScratchTexture() | 1108 GrAutoScratchTexture() |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1147 } | 1179 } |
1148 | 1180 |
1149 GrTexture* texture() { return fTexture; } | 1181 GrTexture* texture() { return fTexture; } |
1150 | 1182 |
1151 private: | 1183 private: |
1152 GrContext* fContext; | 1184 GrContext* fContext; |
1153 GrTexture* fTexture; | 1185 GrTexture* fTexture; |
1154 }; | 1186 }; |
1155 | 1187 |
1156 #endif | 1188 #endif |
OLD | NEW |