OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "GrGpu.h" | 10 #include "GrGpu.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } | 192 } |
193 | 193 |
194 GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc&
desc, | 194 GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc&
desc, |
195 GrWrapOwnership ownership) { | 195 GrWrapOwnership ownership) { |
196 this->handleDirtyContext(); | 196 this->handleDirtyContext(); |
197 return this->onWrapBackendRenderTarget(desc, ownership); | 197 return this->onWrapBackendRenderTarget(desc, ownership); |
198 } | 198 } |
199 | 199 |
200 GrVertexBuffer* GrGpu::createVertexBuffer(size_t size, bool dynamic) { | 200 GrVertexBuffer* GrGpu::createVertexBuffer(size_t size, bool dynamic) { |
201 this->handleDirtyContext(); | 201 this->handleDirtyContext(); |
202 return this->onCreateVertexBuffer(size, dynamic); | 202 GrVertexBuffer* vb = this->onCreateVertexBuffer(size, dynamic); |
| 203 if (!this->caps()->reuseScratchBuffers()) { |
| 204 vb->resourcePriv().removeScratchKey(); |
| 205 } |
| 206 return vb; |
203 } | 207 } |
204 | 208 |
205 GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) { | 209 GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) { |
206 this->handleDirtyContext(); | 210 this->handleDirtyContext(); |
207 return this->onCreateIndexBuffer(size, dynamic); | 211 GrIndexBuffer* ib = this->onCreateIndexBuffer(size, dynamic); |
| 212 if (!this->caps()->reuseScratchBuffers()) { |
| 213 ib->resourcePriv().removeScratchKey(); |
| 214 } |
| 215 return ib; |
208 } | 216 } |
209 | 217 |
210 void GrGpu::clear(const SkIRect* rect, | 218 void GrGpu::clear(const SkIRect* rect, |
211 GrColor color, | 219 GrColor color, |
212 bool canIgnoreRect, | 220 bool canIgnoreRect, |
213 GrRenderTarget* renderTarget) { | 221 GrRenderTarget* renderTarget) { |
214 SkASSERT(renderTarget); | 222 SkASSERT(renderTarget); |
215 this->handleDirtyContext(); | 223 this->handleDirtyContext(); |
216 this->onClear(renderTarget, rect, color, canIgnoreRect); | 224 this->onClear(renderTarget, rect, color, canIgnoreRect); |
217 } | 225 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 //////////////////////////////////////////////////////////////////////////////// | 304 //////////////////////////////////////////////////////////////////////////////// |
297 | 305 |
298 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { | 306 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { |
299 this->handleDirtyContext(); | 307 this->handleDirtyContext(); |
300 GrVertices::Iterator iter; | 308 GrVertices::Iterator iter; |
301 const GrNonInstancedVertices* verts = iter.init(vertices); | 309 const GrNonInstancedVertices* verts = iter.init(vertices); |
302 do { | 310 do { |
303 this->onDraw(args, *verts); | 311 this->onDraw(args, *verts); |
304 } while ((verts = iter.next())); | 312 } while ((verts = iter.next())); |
305 } | 313 } |
OLD | NEW |