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 GrVertexBuffer* vb = this->onCreateVertexBuffer(size, dynamic); | 202 return this->onCreateVertexBuffer(size, dynamic); |
203 if (!this->caps()->reuseScratchBuffers()) { | |
204 vb->resourcePriv().removeScratchKey(); | |
205 } | |
206 return vb; | |
207 } | 203 } |
208 | 204 |
209 GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) { | 205 GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) { |
210 this->handleDirtyContext(); | 206 this->handleDirtyContext(); |
211 GrIndexBuffer* ib = this->onCreateIndexBuffer(size, dynamic); | 207 return this->onCreateIndexBuffer(size, dynamic); |
212 if (!this->caps()->reuseScratchBuffers()) { | |
213 ib->resourcePriv().removeScratchKey(); | |
214 } | |
215 return ib; | |
216 } | 208 } |
217 | 209 |
218 void GrGpu::clear(const SkIRect* rect, | 210 void GrGpu::clear(const SkIRect* rect, |
219 GrColor color, | 211 GrColor color, |
220 bool canIgnoreRect, | 212 bool canIgnoreRect, |
221 GrRenderTarget* renderTarget) { | 213 GrRenderTarget* renderTarget) { |
222 SkASSERT(renderTarget); | 214 SkASSERT(renderTarget); |
223 this->handleDirtyContext(); | 215 this->handleDirtyContext(); |
224 this->onClear(renderTarget, rect, color, canIgnoreRect); | 216 this->onClear(renderTarget, rect, color, canIgnoreRect); |
225 } | 217 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 //////////////////////////////////////////////////////////////////////////////// | 296 //////////////////////////////////////////////////////////////////////////////// |
305 | 297 |
306 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { | 298 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { |
307 this->handleDirtyContext(); | 299 this->handleDirtyContext(); |
308 GrVertices::Iterator iter; | 300 GrVertices::Iterator iter; |
309 const GrNonInstancedVertices* verts = iter.init(vertices); | 301 const GrNonInstancedVertices* verts = iter.init(vertices); |
310 do { | 302 do { |
311 this->onDraw(args, *verts); | 303 this->onDraw(args, *verts); |
312 } while ((verts = iter.next())); | 304 } while ((verts = iter.next())); |
313 } | 305 } |
OLD | NEW |