| 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 11 matching lines...) Expand all Loading... |
| 22 GrVertices& GrVertices::operator =(const GrVertices& di) { | 22 GrVertices& GrVertices::operator =(const GrVertices& di) { |
| 23 fPrimitiveType = di.fPrimitiveType; | 23 fPrimitiveType = di.fPrimitiveType; |
| 24 fStartVertex = di.fStartVertex; | 24 fStartVertex = di.fStartVertex; |
| 25 fStartIndex = di.fStartIndex; | 25 fStartIndex = di.fStartIndex; |
| 26 fVertexCount = di.fVertexCount; | 26 fVertexCount = di.fVertexCount; |
| 27 fIndexCount = di.fIndexCount; | 27 fIndexCount = di.fIndexCount; |
| 28 | 28 |
| 29 fInstanceCount = di.fInstanceCount; | 29 fInstanceCount = di.fInstanceCount; |
| 30 fVerticesPerInstance = di.fVerticesPerInstance; | 30 fVerticesPerInstance = di.fVerticesPerInstance; |
| 31 fIndicesPerInstance = di.fIndicesPerInstance; | 31 fIndicesPerInstance = di.fIndicesPerInstance; |
| 32 fMaxInstancesPerDraw = di.fMaxInstancesPerDraw; |
| 32 | 33 |
| 33 fVertexBuffer.reset(di.vertexBuffer()); | 34 fVertexBuffer.reset(di.vertexBuffer()); |
| 34 fIndexBuffer.reset(di.indexBuffer()); | 35 fIndexBuffer.reset(di.indexBuffer()); |
| 35 | 36 |
| 36 return *this; | 37 return *this; |
| 37 } | 38 } |
| 38 | 39 |
| 39 //////////////////////////////////////////////////////////////////////////////// | 40 //////////////////////////////////////////////////////////////////////////////// |
| 40 | 41 |
| 41 GrGpu::GrGpu(GrContext* context) | 42 GrGpu::GrGpu(GrContext* context) |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 this->fActiveTraceMarkers.remove(*marker); | 282 this->fActiveTraceMarkers.remove(*marker); |
| 282 this->didRemoveGpuTraceMarker(); | 283 this->didRemoveGpuTraceMarker(); |
| 283 --fGpuTraceMarkerCount; | 284 --fGpuTraceMarkerCount; |
| 284 } | 285 } |
| 285 } | 286 } |
| 286 | 287 |
| 287 //////////////////////////////////////////////////////////////////////////////// | 288 //////////////////////////////////////////////////////////////////////////////// |
| 288 | 289 |
| 289 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { | 290 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { |
| 290 this->handleDirtyContext(); | 291 this->handleDirtyContext(); |
| 291 this->onDraw(args, vertices); | 292 GrVertices::Iterator iter; |
| 293 const GrNonInstancedVertices* verts = iter.init(vertices); |
| 294 do { |
| 295 this->onDraw(args, *verts); |
| 296 } while ((verts = iter.next())); |
| 292 } | 297 } |
| 293 | 298 |
| 294 void GrGpu::stencilPath(const GrPath* path, const StencilPathState& state) { | 299 void GrGpu::stencilPath(const GrPath* path, const StencilPathState& state) { |
| 295 this->handleDirtyContext(); | 300 this->handleDirtyContext(); |
| 296 this->onStencilPath(path, state); | 301 this->onStencilPath(path, state); |
| 297 } | 302 } |
| 298 | 303 |
| 299 void GrGpu::drawPath(const DrawArgs& args, | 304 void GrGpu::drawPath(const DrawArgs& args, |
| 300 const GrPath* path, | 305 const GrPath* path, |
| 301 const GrStencilSettings& stencilSettings) { | 306 const GrStencilSettings& stencilSettings) { |
| 302 this->handleDirtyContext(); | 307 this->handleDirtyContext(); |
| 303 this->onDrawPath(args, path, stencilSettings); | 308 this->onDrawPath(args, path, stencilSettings); |
| 304 } | 309 } |
| 305 | 310 |
| 306 void GrGpu::drawPaths(const DrawArgs& args, | 311 void GrGpu::drawPaths(const DrawArgs& args, |
| 307 const GrPathRange* pathRange, | 312 const GrPathRange* pathRange, |
| 308 const void* indices, | 313 const void* indices, |
| 309 GrDrawTarget::PathIndexType indexType, | 314 GrDrawTarget::PathIndexType indexType, |
| 310 const float transformValues[], | 315 const float transformValues[], |
| 311 GrDrawTarget::PathTransformType transformType, | 316 GrDrawTarget::PathTransformType transformType, |
| 312 int count, | 317 int count, |
| 313 const GrStencilSettings& stencilSettings) { | 318 const GrStencilSettings& stencilSettings) { |
| 314 this->handleDirtyContext(); | 319 this->handleDirtyContext(); |
| 315 pathRange->willDrawPaths(indices, indexType, count); | 320 pathRange->willDrawPaths(indices, indexType, count); |
| 316 this->onDrawPaths(args, pathRange, indices, indexType, transformValues, | 321 this->onDrawPaths(args, pathRange, indices, indexType, transformValues, |
| 317 transformType, count, stencilSettings); | 322 transformType, count, stencilSettings); |
| 318 } | 323 } |
| OLD | NEW |