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

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

Issue 1806983002: Update how we send draws to gpu backend to reduce state setting. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 4 years, 9 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/GrMesh.h » ('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 * Copyright 2010 Google Inc. 2 * Copyright 2010 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "GrGpu.h" 9 #include "GrGpu.h"
10 10
11 #include "GrCaps.h" 11 #include "GrCaps.h"
12 #include "GrContext.h" 12 #include "GrContext.h"
13 #include "GrGpuResourcePriv.h" 13 #include "GrGpuResourcePriv.h"
14 #include "GrIndexBuffer.h" 14 #include "GrIndexBuffer.h"
15 #include "GrMesh.h"
15 #include "GrPathRendering.h" 16 #include "GrPathRendering.h"
16 #include "GrPipeline.h" 17 #include "GrPipeline.h"
17 #include "GrResourceCache.h" 18 #include "GrResourceCache.h"
18 #include "GrResourceProvider.h" 19 #include "GrResourceProvider.h"
19 #include "GrRenderTargetPriv.h" 20 #include "GrRenderTargetPriv.h"
20 #include "GrStencilAttachment.h" 21 #include "GrStencilAttachment.h"
21 #include "GrSurfacePriv.h" 22 #include "GrSurfacePriv.h"
22 #include "GrTransferBuffer.h" 23 #include "GrTransferBuffer.h"
23 #include "GrVertexBuffer.h" 24 #include "GrVertexBuffer.h"
24 #include "GrVertices.h"
25 #include "SkTypes.h" 25 #include "SkTypes.h"
26 26
27 GrVertices& GrVertices::operator =(const GrVertices& di) { 27 GrMesh& GrMesh::operator =(const GrMesh& di) {
28 fPrimitiveType = di.fPrimitiveType; 28 fPrimitiveType = di.fPrimitiveType;
29 fStartVertex = di.fStartVertex; 29 fStartVertex = di.fStartVertex;
30 fStartIndex = di.fStartIndex; 30 fStartIndex = di.fStartIndex;
31 fVertexCount = di.fVertexCount; 31 fVertexCount = di.fVertexCount;
32 fIndexCount = di.fIndexCount; 32 fIndexCount = di.fIndexCount;
33 33
34 fInstanceCount = di.fInstanceCount; 34 fInstanceCount = di.fInstanceCount;
35 fVerticesPerInstance = di.fVerticesPerInstance; 35 fVerticesPerInstance = di.fVerticesPerInstance;
36 fIndicesPerInstance = di.fIndicesPerInstance; 36 fIndicesPerInstance = di.fIndicesPerInstance;
37 fMaxInstancesPerDraw = di.fMaxInstancesPerDraw; 37 fMaxInstancesPerDraw = di.fMaxInstancesPerDraw;
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 fMultisampleSpecsMap[effectiveKey] = &specs; 485 fMultisampleSpecsMap[effectiveKey] = &specs;
486 if (effectiveSampleCnt != desc.fSampleCnt) { 486 if (effectiveSampleCnt != desc.fSampleCnt) {
487 SkASSERT(surfDescKey < effectiveKey); 487 SkASSERT(surfDescKey < effectiveKey);
488 fMultisampleSpecsMap[surfDescKey] = &specs; 488 fMultisampleSpecsMap[surfDescKey] = &specs;
489 } 489 }
490 return specs; 490 return specs;
491 } 491 }
492 492
493 //////////////////////////////////////////////////////////////////////////////// 493 ////////////////////////////////////////////////////////////////////////////////
494 494
495 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { 495 void GrGpu::draw(const GrPipeline& pipeline,
496 const GrPrimitiveProcessor& primProc,
497 const GrMesh* meshes,
498 int meshCount) {
496 this->handleDirtyContext(); 499 this->handleDirtyContext();
497 if (GrXferBarrierType barrierType = args.fPipeline->xferBarrierType(*this->c aps())) {
498 this->xferBarrier(args.fPipeline->getRenderTarget(), barrierType);
499 }
500 500
501 GrVertices::Iterator iter; 501 this->onDraw(pipeline, primProc, meshes, meshCount);
502 const GrNonInstancedVertices* verts = iter.init(vertices);
503 do {
504 this->onDraw(args, *verts);
505 fStats.incNumDraws();
506 } while ((verts = iter.next()));
507 } 502 }
508 503
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrMesh.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698