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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 kNoPendingIO_Flag = kNoPendingIO_ScratchTextureFlag, | 103 kNoPendingIO_Flag = kNoPendingIO_ScratchTextureFlag, |
104 }; | 104 }; |
105 | 105 |
106 /** | 106 /** |
107 * Returns a buffer. | 107 * Returns a buffer. |
108 * | 108 * |
109 * @param size minimum size of buffer to return. | 109 * @param size minimum size of buffer to return. |
110 * @param intendedType hint to the graphics subsystem about what the buff
er will be used for. | 110 * @param intendedType hint to the graphics subsystem about what the buff
er will be used for. |
111 * @param GrAccessPattern hint to the graphics subsystem about how the data
will be accessed. | 111 * @param GrAccessPattern hint to the graphics subsystem about how the data
will be accessed. |
112 * @param flags see Flags enum. | 112 * @param flags see Flags enum. |
| 113 * @param data optional data with which to initialize the buffer. |
113 * | 114 * |
114 * @return the buffer if successful, otherwise nullptr. | 115 * @return the buffer if successful, otherwise nullptr. |
115 */ | 116 */ |
116 GrBuffer* createBuffer(size_t size, GrBufferType intendedType, GrAccessPatte
rn, uint32_t flags); | 117 GrBuffer* createBuffer(size_t size, GrBufferType intendedType, GrAccessPatte
rn, uint32_t flags, |
| 118 const void* data = nullptr); |
117 | 119 |
118 GrTexture* createApproxTexture(const GrSurfaceDesc& desc, uint32_t flags) { | 120 GrTexture* createApproxTexture(const GrSurfaceDesc& desc, uint32_t flags) { |
119 SkASSERT(0 == flags || kNoPendingIO_Flag == flags); | 121 SkASSERT(0 == flags || kNoPendingIO_Flag == flags); |
120 return this->internalCreateApproxTexture(desc, flags); | 122 return this->internalCreateApproxTexture(desc, flags); |
121 } | 123 } |
122 | 124 |
123 /** Returns a GrBatchAtlas. This function can be called anywhere, but the r
eturned atlas should | 125 /** Returns a GrBatchAtlas. This function can be called anywhere, but the r
eturned atlas should |
124 * only be used inside of GrBatch::generateGeometry | 126 * only be used inside of GrBatch::generateGeometry |
125 * @param GrPixelConfig The pixel config which this atlas will store | 127 * @param GrPixelConfig The pixel config which this atlas will store |
126 * @param width width in pixels of the atlas | 128 * @param width width in pixels of the atlas |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 const GrUniqueKey& key); | 168 const GrUniqueKey& key); |
167 | 169 |
168 const GrBuffer* createQuadIndexBuffer(); | 170 const GrBuffer* createQuadIndexBuffer(); |
169 | 171 |
170 GrUniqueKey fQuadIndexBufferKey; | 172 GrUniqueKey fQuadIndexBufferKey; |
171 | 173 |
172 typedef GrTextureProvider INHERITED; | 174 typedef GrTextureProvider INHERITED; |
173 }; | 175 }; |
174 | 176 |
175 #endif | 177 #endif |
OLD | NEW |