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