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 #include "GrResourceProvider.h" | 8 #include "GrResourceProvider.h" |
9 | 9 |
10 #include "GrGpu.h" | 10 #include "GrGpu.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 int numPlotsX, int numPlotsY, | 151 int numPlotsX, int numPlotsY, |
152 GrBatchAtlas::EvictionFunc func, v
oid* data) { | 152 GrBatchAtlas::EvictionFunc func, v
oid* data) { |
153 GrSurfaceDesc desc; | 153 GrSurfaceDesc desc; |
154 desc.fFlags = kNone_GrSurfaceFlags; | 154 desc.fFlags = kNone_GrSurfaceFlags; |
155 desc.fWidth = width; | 155 desc.fWidth = width; |
156 desc.fHeight = height; | 156 desc.fHeight = height; |
157 desc.fConfig = config; | 157 desc.fConfig = config; |
158 | 158 |
159 // We don't want to flush the context so we claim we're in the middle of flu
shing so as to | 159 // We don't want to flush the context so we claim we're in the middle of flu
shing so as to |
160 // guarantee we do not recieve a texture with pending IO | 160 // guarantee we do not recieve a texture with pending IO |
161 // TODO: Determine how to avoid having to do this. (http://skbug.com/4156) | 161 // TODO: Determine how to avoid having to do this. (https://bug.skia.org/415
6) |
162 static const uint32_t kFlags = GrResourceProvider::kNoPendingIO_Flag; | 162 static const uint32_t kFlags = GrResourceProvider::kNoPendingIO_Flag; |
163 GrTexture* texture = this->createApproxTexture(desc, kFlags); | 163 GrTexture* texture = this->createApproxTexture(desc, kFlags); |
164 if (!texture) { | 164 if (!texture) { |
165 return nullptr; | 165 return nullptr; |
166 } | 166 } |
167 GrBatchAtlas* atlas = new GrBatchAtlas(texture, numPlotsX, numPlotsY); | 167 GrBatchAtlas* atlas = new GrBatchAtlas(texture, numPlotsX, numPlotsY); |
168 atlas->registerEvictionCallback(func, data); | 168 atlas->registerEvictionCallback(func, data); |
169 return atlas; | 169 return atlas; |
170 } | 170 } |
171 | 171 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // FBO. But iOS doesn't allow a stencil-only FBO. It reports uns
upported | 210 // FBO. But iOS doesn't allow a stencil-only FBO. It reports uns
upported |
211 // FBO status. | 211 // FBO status. |
212 this->gpu()->clearStencil(rt); | 212 this->gpu()->clearStencil(rt); |
213 } | 213 } |
214 } | 214 } |
215 } | 215 } |
216 return rt->renderTargetPriv().getStencilAttachment(); | 216 return rt->renderTargetPriv().getStencilAttachment(); |
217 } | 217 } |
218 | 218 |
219 | 219 |
OLD | NEW |