| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 scratchFlags = GrResourceCache::kPreferNoPendingIO_ScratchFlag; | 139 scratchFlags = GrResourceCache::kPreferNoPendingIO_ScratchFlag; |
| 140 } | 140 } |
| 141 GrGpuResource* resource = this->cache()->findAndRefScratchResource(key,
size, scratchFlags); | 141 GrGpuResource* resource = this->cache()->findAndRefScratchResource(key,
size, scratchFlags); |
| 142 if (resource) { | 142 if (resource) { |
| 143 return static_cast<GrVertexBuffer*>(resource); | 143 return static_cast<GrVertexBuffer*>(resource); |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 return this->gpu()->createVertexBuffer(size, dynamic); | 146 return this->gpu()->createVertexBuffer(size, dynamic); |
| 147 } | 147 } |
| 148 | 148 |
| 149 GrTransferBuffer* GrResourceProvider::createTransferBuffer(size_t size, Transfer
Type type, |
| 150 uint32_t flags) { |
| 151 if (this->isAbandoned()) { |
| 152 return nullptr; |
| 153 } |
| 154 |
| 155 //bool noPendingIO = SkToBool(flags & kNoPendingIO_Flag); |
| 156 return this->gpu()->createTransferBuffer(size, type); |
| 157 } |
| 158 |
| 149 GrBatchAtlas* GrResourceProvider::createAtlas(GrPixelConfig config, | 159 GrBatchAtlas* GrResourceProvider::createAtlas(GrPixelConfig config, |
| 150 int width, int height, | 160 int width, int height, |
| 151 int numPlotsX, int numPlotsY, | 161 int numPlotsX, int numPlotsY, |
| 152 GrBatchAtlas::EvictionFunc func, v
oid* data) { | 162 GrBatchAtlas::EvictionFunc func, v
oid* data) { |
| 153 GrSurfaceDesc desc; | 163 GrSurfaceDesc desc; |
| 154 desc.fFlags = kNone_GrSurfaceFlags; | 164 desc.fFlags = kNone_GrSurfaceFlags; |
| 155 desc.fWidth = width; | 165 desc.fWidth = width; |
| 156 desc.fHeight = height; | 166 desc.fHeight = height; |
| 157 desc.fConfig = config; | 167 desc.fConfig = config; |
| 158 | 168 |
| (...skipping 51 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 | 220 // FBO. But iOS doesn't allow a stencil-only FBO. It reports uns
upported |
| 211 // FBO status. | 221 // FBO status. |
| 212 this->gpu()->clearStencil(rt); | 222 this->gpu()->clearStencil(rt); |
| 213 } | 223 } |
| 214 } | 224 } |
| 215 } | 225 } |
| 216 return rt->renderTargetPriv().getStencilAttachment(); | 226 return rt->renderTargetPriv().getStencilAttachment(); |
| 217 } | 227 } |
| 218 | 228 |
| 219 | 229 |
| OLD | NEW |