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

Side by Side Diff: src/gpu/GrResourceProvider.h

Issue 1534123003: More framework support for TransferBuffers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 enum BufferUsage { 106 enum BufferUsage {
107 /** Caller intends to specify the buffer data rarely with respect to the number of draws 107 /** Caller intends to specify the buffer data rarely with respect to the number of draws
108 that read the data. */ 108 that read the data. */
109 kStatic_BufferUsage, 109 kStatic_BufferUsage,
110 /** Caller intends to respecify the buffer data frequently between draws . */ 110 /** Caller intends to respecify the buffer data frequently between draws . */
111 kDynamic_BufferUsage, 111 kDynamic_BufferUsage,
112 }; 112 };
113 GrIndexBuffer* createIndexBuffer(size_t size, BufferUsage, uint32_t flags); 113 GrIndexBuffer* createIndexBuffer(size_t size, BufferUsage, uint32_t flags);
114 GrVertexBuffer* createVertexBuffer(size_t size, BufferUsage, uint32_t flags) ; 114 GrVertexBuffer* createVertexBuffer(size_t size, BufferUsage, uint32_t flags) ;
115 enum TransferType {
bsalomon 2015/12/18 15:24:38 We could put this in GrTypesPriv.h if you anticipa
jvanverth1 2016/01/04 21:24:09 Done.
116 /** Caller intends to use the buffer to transfer data to the GPU */
117 kCpuToGpu_TransferType,
118 /** Caller intends to use the buffer to transfer data from the GPU */
119 kGpuToCpu_TransferType
120 };
121 GrTransferBuffer* createTransferBuffer(size_t size, TransferType, uint32_t f lags);
115 122
116 GrTexture* createApproxTexture(const GrSurfaceDesc& desc, uint32_t flags) { 123 GrTexture* createApproxTexture(const GrSurfaceDesc& desc, uint32_t flags) {
117 SkASSERT(0 == flags || kNoPendingIO_Flag == flags); 124 SkASSERT(0 == flags || kNoPendingIO_Flag == flags);
118 return this->internalCreateApproxTexture(desc, flags); 125 return this->internalCreateApproxTexture(desc, flags);
119 } 126 }
120 127
121 /** Returns a GrBatchAtlas. This function can be called anywhere, but the r eturned atlas should 128 /** Returns a GrBatchAtlas. This function can be called anywhere, but the r eturned atlas should
122 * only be used inside of GrBatch::generateGeometry 129 * only be used inside of GrBatch::generateGeometry
123 * @param GrPixelConfig The pixel config which this atlas will store 130 * @param GrPixelConfig The pixel config which this atlas will store
124 * @param width width in pixels of the atlas 131 * @param width width in pixels of the atlas
(...skipping 28 matching lines...) Expand all
153 const GrUniqueKey& key); 160 const GrUniqueKey& key);
154 161
155 const GrIndexBuffer* createQuadIndexBuffer(); 162 const GrIndexBuffer* createQuadIndexBuffer();
156 163
157 GrUniqueKey fQuadIndexBufferKey; 164 GrUniqueKey fQuadIndexBufferKey;
158 165
159 typedef GrTextureProvider INHERITED; 166 typedef GrTextureProvider INHERITED;
160 }; 167 };
161 168
162 #endif 169 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698