Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: src/gpu/GrGpu.cpp

Issue 1127273007: Iterate over instanced draws in GrGpu rather than above GrBatchTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove dead code Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698