| 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" |
| 11 | 11 |
| 12 #include "GrCaps.h" | 12 #include "GrCaps.h" |
| 13 #include "GrContext.h" | 13 #include "GrContext.h" |
| 14 #include "GrGpuResourcePriv.h" | 14 #include "GrGpuResourcePriv.h" |
| 15 #include "GrIndexBuffer.h" | 15 #include "GrIndexBuffer.h" |
| 16 #include "GrPathRendering.h" | 16 #include "GrPathRendering.h" |
| 17 #include "GrPipeline.h" | 17 #include "GrPipeline.h" |
| 18 #include "GrResourceCache.h" | 18 #include "GrResourceCache.h" |
| 19 #include "GrResourceProvider.h" | 19 #include "GrResourceProvider.h" |
| 20 #include "GrRenderTargetPriv.h" | 20 #include "GrRenderTargetPriv.h" |
| 21 #include "GrStencilAttachment.h" | 21 #include "GrStencilAttachment.h" |
| 22 #include "GrSurfacePriv.h" | 22 #include "GrSurfacePriv.h" |
| 23 #include "GrTransferBuffer.h" |
| 23 #include "GrVertexBuffer.h" | 24 #include "GrVertexBuffer.h" |
| 24 #include "GrVertices.h" | 25 #include "GrVertices.h" |
| 25 | 26 |
| 26 GrVertices& GrVertices::operator =(const GrVertices& di) { | 27 GrVertices& GrVertices::operator =(const GrVertices& di) { |
| 27 fPrimitiveType = di.fPrimitiveType; | 28 fPrimitiveType = di.fPrimitiveType; |
| 28 fStartVertex = di.fStartVertex; | 29 fStartVertex = di.fStartVertex; |
| 29 fStartIndex = di.fStartIndex; | 30 fStartIndex = di.fStartIndex; |
| 30 fVertexCount = di.fVertexCount; | 31 fVertexCount = di.fVertexCount; |
| 31 fIndexCount = di.fIndexCount; | 32 fIndexCount = di.fIndexCount; |
| 32 | 33 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 191 |
| 191 GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) { | 192 GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) { |
| 192 this->handleDirtyContext(); | 193 this->handleDirtyContext(); |
| 193 GrIndexBuffer* ib = this->onCreateIndexBuffer(size, dynamic); | 194 GrIndexBuffer* ib = this->onCreateIndexBuffer(size, dynamic); |
| 194 if (!this->caps()->reuseScratchBuffers()) { | 195 if (!this->caps()->reuseScratchBuffers()) { |
| 195 ib->resourcePriv().removeScratchKey(); | 196 ib->resourcePriv().removeScratchKey(); |
| 196 } | 197 } |
| 197 return ib; | 198 return ib; |
| 198 } | 199 } |
| 199 | 200 |
| 201 GrTransferBuffer* GrGpu::createTransferBuffer(size_t size, TransferType type) { |
| 202 this->handleDirtyContext(); |
| 203 GrTransferBuffer* tb = this->onCreateTransferBuffer(size, type); |
| 204 return tb; |
| 205 } |
| 206 |
| 200 void GrGpu::clear(const SkIRect& rect, | 207 void GrGpu::clear(const SkIRect& rect, |
| 201 GrColor color, | 208 GrColor color, |
| 202 GrRenderTarget* renderTarget) { | 209 GrRenderTarget* renderTarget) { |
| 203 SkASSERT(renderTarget); | 210 SkASSERT(renderTarget); |
| 204 SkASSERT(SkIRect::MakeWH(renderTarget->width(), renderTarget->height()).cont
ains(rect)); | 211 SkASSERT(SkIRect::MakeWH(renderTarget->width(), renderTarget->height()).cont
ains(rect)); |
| 205 this->handleDirtyContext(); | 212 this->handleDirtyContext(); |
| 206 this->onClear(renderTarget, rect, color); | 213 this->onClear(renderTarget, rect, color); |
| 207 } | 214 } |
| 208 | 215 |
| 209 void GrGpu::clearStencilClip(const SkIRect& rect, | 216 void GrGpu::clearStencilClip(const SkIRect& rect, |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 this->xferBarrier(args.fPipeline->getRenderTarget(), barrierType); | 350 this->xferBarrier(args.fPipeline->getRenderTarget(), barrierType); |
| 344 } | 351 } |
| 345 | 352 |
| 346 GrVertices::Iterator iter; | 353 GrVertices::Iterator iter; |
| 347 const GrNonInstancedVertices* verts = iter.init(vertices); | 354 const GrNonInstancedVertices* verts = iter.init(vertices); |
| 348 do { | 355 do { |
| 349 this->onDraw(args, *verts); | 356 this->onDraw(args, *verts); |
| 350 fStats.incNumDraws(); | 357 fStats.incNumDraws(); |
| 351 } while ((verts = iter.next())); | 358 } while ((verts = iter.next())); |
| 352 } | 359 } |
| OLD | NEW |