| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 using GrTextureProvider::findAndRefTextureByUniqueKey; | 93 using GrTextureProvider::findAndRefTextureByUniqueKey; |
| 94 using GrTextureProvider::abandon; | 94 using GrTextureProvider::abandon; |
| 95 | 95 |
| 96 enum Flags { | 96 enum Flags { |
| 97 /** If the caller intends to do direct reads/writes to/from the CPU then
this flag must be | 97 /** If the caller intends to do direct reads/writes to/from the CPU then
this flag must be |
| 98 * set when accessing resources during a GrDrawTarget flush. This inclu
des the execution of | 98 * set when accessing resources during a GrDrawTarget flush. This inclu
des the execution of |
| 99 * GrBatch objects. The reason is that these memory operations are done
immediately and | 99 * GrBatch objects. The reason is that these memory operations are done
immediately and |
| 100 * will occur out of order WRT the operations being flushed. | 100 * will occur out of order WRT the operations being flushed. |
| 101 * Make this automatic: https://bug.skia.org/4156 | 101 * Make this automatic: https://bug.skia.org/4156 |
| 102 */ | 102 */ |
| 103 kNoPendingIO_Flag = kNoPendingIO_ScratchTextureFlag, | 103 kNoPendingIO_Flag = 0x1, |
| 104 |
| 105 /** Normally the caps may indicate a preference for client-side buffers.
Set this flag when |
| 106 * creating a buffer to guarantee it resides in GPU memory. |
| 107 */ |
| 108 kRequireGpuMemory_Flag = 0x2, |
| 104 }; | 109 }; |
| 105 | 110 |
| 106 /** | 111 /** |
| 107 * Returns a buffer. | 112 * Returns a buffer. |
| 108 * | 113 * |
| 109 * @param size minimum size of buffer to return. | 114 * @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. | 115 * @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. | 116 * @param GrAccessPattern hint to the graphics subsystem about how the data
will be accessed. |
| 112 * @param flags see Flags enum. | 117 * @param flags see Flags enum. |
| 113 * @param data optional data with which to initialize the buffer. | 118 * @param data optional data with which to initialize the buffer. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 const GrUniqueKey& key); | 173 const GrUniqueKey& key); |
| 169 | 174 |
| 170 const GrBuffer* createQuadIndexBuffer(); | 175 const GrBuffer* createQuadIndexBuffer(); |
| 171 | 176 |
| 172 GrUniqueKey fQuadIndexBufferKey; | 177 GrUniqueKey fQuadIndexBufferKey; |
| 173 | 178 |
| 174 typedef GrTextureProvider INHERITED; | 179 typedef GrTextureProvider INHERITED; |
| 175 }; | 180 }; |
| 176 | 181 |
| 177 #endif | 182 #endif |
| OLD | NEW |