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 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 enum Flags { | 95 enum Flags { |
96 /** If the caller intends to do direct reads/writes to/from the CPU then
this flag must be | 96 /** If the caller intends to do direct reads/writes to/from the CPU then
this flag must be |
97 * set when accessing resources during a GrDrawTarget flush. This inclu
des the execution of | 97 * set when accessing resources during a GrDrawTarget flush. This inclu
des the execution of |
98 * GrBatch objects. The reason is that these memory operations are done
immediately and | 98 * GrBatch objects. The reason is that these memory operations are done
immediately and |
99 * will occur out of order WRT the operations being flushed. | 99 * will occur out of order WRT the operations being flushed. |
100 * Make this automatic: https://bug.skia.org/4156 | 100 * Make this automatic: https://bug.skia.org/4156 |
101 */ | 101 */ |
102 kNoPendingIO_Flag = kNoPendingIO_ScratchTextureFlag, | 102 kNoPendingIO_Flag = kNoPendingIO_ScratchTextureFlag, |
103 }; | 103 }; |
104 | 104 |
105 /** | 105 GrBuffer* createBuffer(GrBufferType, size_t size, GrAccessPattern, uint32_t
flags); |
106 * Returns a buffer. | |
107 * | |
108 * @param size minimum size of buffer to return. | |
109 * @param intendedType hint to the graphics subsystem about what the buff
er will be used for. | |
110 * @param GrAccessPattern hint to the graphics subsystem about how the data
will be accessed. | |
111 * @param flags see Flags enum. | |
112 * | |
113 * @return the buffer if successful, otherwise nullptr. | |
114 */ | |
115 GrBuffer* createBuffer(size_t size, GrBufferType intendedType, GrAccessPatte
rn, uint32_t flags); | |
116 | 106 |
117 GrTexture* createApproxTexture(const GrSurfaceDesc& desc, uint32_t flags) { | 107 GrTexture* createApproxTexture(const GrSurfaceDesc& desc, uint32_t flags) { |
118 SkASSERT(0 == flags || kNoPendingIO_Flag == flags); | 108 SkASSERT(0 == flags || kNoPendingIO_Flag == flags); |
119 return this->internalCreateApproxTexture(desc, flags); | 109 return this->internalCreateApproxTexture(desc, flags); |
120 } | 110 } |
121 | 111 |
122 /** Returns a GrBatchAtlas. This function can be called anywhere, but the r
eturned atlas should | 112 /** Returns a GrBatchAtlas. This function can be called anywhere, but the r
eturned atlas should |
123 * only be used inside of GrBatch::generateGeometry | 113 * only be used inside of GrBatch::generateGeometry |
124 * @param GrPixelConfig The pixel config which this atlas will store | 114 * @param GrPixelConfig The pixel config which this atlas will store |
125 * @param width width in pixels of the atlas | 115 * @param width width in pixels of the atlas |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 const GrUniqueKey& key); | 155 const GrUniqueKey& key); |
166 | 156 |
167 const GrBuffer* createQuadIndexBuffer(); | 157 const GrBuffer* createQuadIndexBuffer(); |
168 | 158 |
169 GrUniqueKey fQuadIndexBufferKey; | 159 GrUniqueKey fQuadIndexBufferKey; |
170 | 160 |
171 typedef GrTextureProvider INHERITED; | 161 typedef GrTextureProvider INHERITED; |
172 }; | 162 }; |
173 | 163 |
174 #endif | 164 #endif |
OLD | NEW |