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

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

Issue 1854283004: Track GL buffer state based on unique resource ID (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix for GR_GL_USE_BUFFER_DATA_NULL_HINT=0 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 GrBuffer* createBuffer(GrBufferType, size_t size, GrAccessPattern, uint32_t flags); 105 /**
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);
106 116
107 GrTexture* createApproxTexture(const GrSurfaceDesc& desc, uint32_t flags) { 117 GrTexture* createApproxTexture(const GrSurfaceDesc& desc, uint32_t flags) {
108 SkASSERT(0 == flags || kNoPendingIO_Flag == flags); 118 SkASSERT(0 == flags || kNoPendingIO_Flag == flags);
109 return this->internalCreateApproxTexture(desc, flags); 119 return this->internalCreateApproxTexture(desc, flags);
110 } 120 }
111 121
112 /** Returns a GrBatchAtlas. This function can be called anywhere, but the r eturned atlas should 122 /** Returns a GrBatchAtlas. This function can be called anywhere, but the r eturned atlas should
113 * only be used inside of GrBatch::generateGeometry 123 * only be used inside of GrBatch::generateGeometry
114 * @param GrPixelConfig The pixel config which this atlas will store 124 * @param GrPixelConfig The pixel config which this atlas will store
115 * @param width width in pixels of the atlas 125 * @param width width in pixels of the atlas
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 const GrUniqueKey& key); 165 const GrUniqueKey& key);
156 166
157 const GrBuffer* createQuadIndexBuffer(); 167 const GrBuffer* createQuadIndexBuffer();
158 168
159 GrUniqueKey fQuadIndexBufferKey; 169 GrUniqueKey fQuadIndexBufferKey;
160 170
161 typedef GrTextureProvider INHERITED; 171 typedef GrTextureProvider INHERITED;
162 }; 172 };
163 173
164 #endif 174 #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