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 |
| 11 #include "GrBatchAtlas.h" |
11 #include "GrIndexBuffer.h" | 12 #include "GrIndexBuffer.h" |
12 #include "GrTextureProvider.h" | 13 #include "GrTextureProvider.h" |
13 #include "GrPathRange.h" | 14 #include "GrPathRange.h" |
14 | 15 |
| 16 class GrBatchAtlas; |
15 class GrIndexBuffer; | 17 class GrIndexBuffer; |
16 class GrPath; | 18 class GrPath; |
17 class GrStrokeInfo; | 19 class GrStrokeInfo; |
18 class GrVertexBuffer; | 20 class GrVertexBuffer; |
19 class SkDescriptor; | 21 class SkDescriptor; |
20 class SkPath; | 22 class SkPath; |
21 class SkTypeface; | 23 class SkTypeface; |
22 | 24 |
23 /** | 25 /** |
24 * An extension of the texture provider for arbitrary resource types. This class
is intended for | 26 * An extension of the texture provider for arbitrary resource types. This class
is intended for |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 kDynamic_BufferUsage, | 108 kDynamic_BufferUsage, |
107 }; | 109 }; |
108 GrIndexBuffer* createIndexBuffer(size_t size, BufferUsage, uint32_t flags); | 110 GrIndexBuffer* createIndexBuffer(size_t size, BufferUsage, uint32_t flags); |
109 GrVertexBuffer* createVertexBuffer(size_t size, BufferUsage, uint32_t flags)
; | 111 GrVertexBuffer* createVertexBuffer(size_t size, BufferUsage, uint32_t flags)
; |
110 | 112 |
111 GrTexture* createApproxTexture(const GrSurfaceDesc& desc, uint32_t flags) { | 113 GrTexture* createApproxTexture(const GrSurfaceDesc& desc, uint32_t flags) { |
112 SkASSERT(0 == flags || kNoPendingIO_Flag == flags); | 114 SkASSERT(0 == flags || kNoPendingIO_Flag == flags); |
113 return this->internalCreateApproxTexture(desc, flags); | 115 return this->internalCreateApproxTexture(desc, flags); |
114 } | 116 } |
115 | 117 |
| 118 /** Returns a GrBatchAtlas. This function can be called anywhere, but the r
eturned atlas should |
| 119 * only be used inside of GrBatch::generateGeometry |
| 120 * @param GrPixelConfig The pixel config which this atlas will store |
| 121 * @param width width in pixels of the atlas |
| 122 * @param height height in pixels of the atlas |
| 123 * @param numPlotsX The number of plots the atlas should be broken
up into in the X |
| 124 * direction |
| 125 * @param numPlotsY The number of plots the atlas should be broken
up into in the Y |
| 126 * direction |
| 127 * @param func An eviction function which will be called whene
ver the atlas has to |
| 128 * evict data |
| 129 * @param data User supplied data which will be passed into fu
nc whenver an |
| 130 * eviction occurs |
| 131 * |
| 132 * @return An initialized GrBatchAtlas, or NULL if creatio
n fails |
| 133 */ |
| 134 GrBatchAtlas* createAtlas(GrPixelConfig, int width, int height, int numPlots
X, int numPlotsY, |
| 135 GrBatchAtlas::EvictionFunc func, void* data); |
| 136 |
116 private: | 137 private: |
117 const GrIndexBuffer* createInstancedIndexBuffer(const uint16_t* pattern, | 138 const GrIndexBuffer* createInstancedIndexBuffer(const uint16_t* pattern, |
118 int patternSize, | 139 int patternSize, |
119 int reps, | 140 int reps, |
120 int vertCount, | 141 int vertCount, |
121 const GrUniqueKey& key); | 142 const GrUniqueKey& key); |
122 | 143 |
123 const GrIndexBuffer* createQuadIndexBuffer(); | 144 const GrIndexBuffer* createQuadIndexBuffer(); |
124 | 145 |
125 GrUniqueKey fQuadIndexBufferKey; | 146 GrUniqueKey fQuadIndexBufferKey; |
126 | 147 |
127 typedef GrTextureProvider INHERITED; | 148 typedef GrTextureProvider INHERITED; |
128 }; | 149 }; |
129 | 150 |
130 #endif | 151 #endif |
OLD | NEW |