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

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

Issue 1877073002: Add optional data parameter to createBuffer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 8 months 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
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrResourceProvider.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrResourceProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698