OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrResourceProvider_DEFINED | 8 #ifndef GrResourceProvider_DEFINED |
9 #define GrResourceProvider_DEFINED | 9 #define GrResourceProvider_DEFINED |
10 | 10 |
11 #include "GrBatchAtlas.h" | 11 #include "GrBatchAtlas.h" |
12 #include "GrBuffer.h" | 12 #include "GrBuffer.h" |
13 #include "GrTextureProvider.h" | 13 #include "GrTextureProvider.h" |
14 #include "GrPathRange.h" | 14 #include "GrPathRange.h" |
15 | 15 |
16 class GrBatchAtlas; | 16 class GrBatchAtlas; |
17 class GrPath; | 17 class GrPath; |
18 class GrRenderTarget; | 18 class GrRenderTarget; |
19 class GrSingleOwner; | 19 class GrSingleOwner; |
20 class GrStencilAttachment; | 20 class GrStencilAttachment; |
21 class GrStrokeInfo; | 21 class GrStyle; |
22 class SkDescriptor; | 22 class SkDescriptor; |
23 class SkPath; | 23 class SkPath; |
24 class SkTypeface; | 24 class SkTypeface; |
25 | 25 |
26 /** | 26 /** |
27 * An extension of the texture provider for arbitrary resource types. This class
is intended for | 27 * An extension of the texture provider for arbitrary resource types. This class
is intended for |
28 * use within the Gr code base, not by clients or extensions (e.g. third party G
rProcessor | 28 * use within the Gr code base, not by clients or extensions (e.g. third party G
rProcessor |
29 * derivatives). | 29 * derivatives). |
30 * | 30 * |
31 * This currently inherits from GrTextureProvider non-publically to force caller
s to provider | 31 * This currently inherits from GrTextureProvider non-publically to force caller
s to provider |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 this->findAndRefTByUniqueKey<GrBuffer>(fQuadIndexBufferKey)) { | 76 this->findAndRefTByUniqueKey<GrBuffer>(fQuadIndexBufferKey)) { |
77 return buffer; | 77 return buffer; |
78 } | 78 } |
79 return this->createQuadIndexBuffer(); | 79 return this->createQuadIndexBuffer(); |
80 } | 80 } |
81 | 81 |
82 /** | 82 /** |
83 * Factories for GrPath and GrPathRange objects. It's an error to call these
if path rendering | 83 * Factories for GrPath and GrPathRange objects. It's an error to call these
if path rendering |
84 * is not supported. | 84 * is not supported. |
85 */ | 85 */ |
86 GrPath* createPath(const SkPath&, const GrStrokeInfo&); | 86 GrPath* createPath(const SkPath&, const GrStyle&); |
87 GrPathRange* createPathRange(GrPathRange::PathGenerator*, const GrStrokeInfo
&); | 87 GrPathRange* createPathRange(GrPathRange::PathGenerator*, const GrStyle&); |
88 GrPathRange* createGlyphs(const SkTypeface*, const SkScalerContextEffects&, | 88 GrPathRange* createGlyphs(const SkTypeface*, const SkScalerContextEffects&, |
89 const SkDescriptor*, const GrStrokeInfo&); | 89 const SkDescriptor*, const GrStyle&); |
90 | 90 |
91 using GrTextureProvider::assignUniqueKeyToResource; | 91 using GrTextureProvider::assignUniqueKeyToResource; |
92 using GrTextureProvider::findAndRefResourceByUniqueKey; | 92 using GrTextureProvider::findAndRefResourceByUniqueKey; |
93 using GrTextureProvider::findAndRefTextureByUniqueKey; | 93 using GrTextureProvider::findAndRefTextureByUniqueKey; |
94 using GrTextureProvider::abandon; | 94 using GrTextureProvider::abandon; |
95 | 95 |
96 enum Flags { | 96 enum Flags { |
97 /** If the caller intends to do direct reads/writes to/from the CPU then
this flag must be | 97 /** If the caller intends to do direct reads/writes to/from the CPU then
this flag must be |
98 * set when accessing resources during a GrDrawTarget flush. This inclu
des the execution of | 98 * set when accessing resources during a GrDrawTarget flush. This inclu
des the execution of |
99 * GrBatch objects. The reason is that these memory operations are done
immediately and | 99 * GrBatch objects. The reason is that these memory operations are done
immediately and |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 const GrUniqueKey& key); | 168 const GrUniqueKey& key); |
169 | 169 |
170 const GrBuffer* createQuadIndexBuffer(); | 170 const GrBuffer* createQuadIndexBuffer(); |
171 | 171 |
172 GrUniqueKey fQuadIndexBufferKey; | 172 GrUniqueKey fQuadIndexBufferKey; |
173 | 173 |
174 typedef GrTextureProvider INHERITED; | 174 typedef GrTextureProvider INHERITED; |
175 }; | 175 }; |
176 | 176 |
177 #endif | 177 #endif |
OLD | NEW |