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

Side by Side Diff: src/gpu/batches/GrTInstanceBatch.h

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/batches/GrPLSPathRenderer.cpp ('k') | src/gpu/batches/GrTessellatingPathRenderer.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 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 #ifndef GrTInstanceBatch_DEFINED 8 #ifndef GrTInstanceBatch_DEFINED
9 #define GrTInstanceBatch_DEFINED 9 #define GrTInstanceBatch_DEFINED
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 GrTInstanceBatch() : INHERITED(ClassID()) {} 89 GrTInstanceBatch() : INHERITED(ClassID()) {}
90 90
91 void onPrepareDraws(Target* target) const override { 91 void onPrepareDraws(Target* target) const override {
92 SkAutoTUnref<const GrGeometryProcessor> gp(Impl::CreateGP(this->seedGeom etry(), 92 SkAutoTUnref<const GrGeometryProcessor> gp(Impl::CreateGP(this->seedGeom etry(),
93 fOverrides)); 93 fOverrides));
94 if (!gp) { 94 if (!gp) {
95 SkDebugf("Couldn't create GrGeometryProcessor\n"); 95 SkDebugf("Couldn't create GrGeometryProcessor\n");
96 return; 96 return;
97 } 97 }
98 98
99 target->initDraw(gp, this->pipeline()); 99 target->initDraw(gp);
100 100
101 size_t vertexStride = gp->getVertexStride(); 101 size_t vertexStride = gp->getVertexStride();
102 int instanceCount = fGeoData.count(); 102 int instanceCount = fGeoData.count();
103 103
104 SkAutoTUnref<const GrIndexBuffer> indexBuffer( 104 SkAutoTUnref<const GrIndexBuffer> indexBuffer(
105 Impl::GetIndexBuffer(target->resourceProvider())); 105 Impl::GetIndexBuffer(target->resourceProvider()));
106 InstancedHelper helper; 106 InstancedHelper helper;
107 void* vertices = helper.init(target, kTriangles_GrPrimitiveType, vertexS tride, 107 void* vertices = helper.init(target, kTriangles_GrPrimitiveType, vertexS tride,
108 indexBuffer, Impl::kVertsPerInstance, 108 indexBuffer, Impl::kVertsPerInstance,
109 Impl::kIndicesPerInstance, instanceCount); 109 Impl::kIndicesPerInstance, instanceCount);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 return true; 144 return true;
145 } 145 }
146 146
147 GrXPOverridesForBatch fOverrides; 147 GrXPOverridesForBatch fOverrides;
148 SkSTArray<1, Geometry, true> fGeoData; 148 SkSTArray<1, Geometry, true> fGeoData;
149 149
150 typedef GrVertexBatch INHERITED; 150 typedef GrVertexBatch INHERITED;
151 }; 151 };
152 152
153 #endif 153 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrPLSPathRenderer.cpp ('k') | src/gpu/batches/GrTessellatingPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698