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

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

Issue 1831133004: Revert of Consolidate GPU buffer implementations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 16 matching lines...) Expand all
27 * void SetBounds(const Geometry& seedGeometry, SkRect* outBounds) 27 * void SetBounds(const Geometry& seedGeometry, SkRect* outBounds)
28 * 28 *
29 * void UpdateBoundsAfterAppend(const Geometry& lastGeometry, SkRect* curren tBounds) 29 * void UpdateBoundsAfterAppend(const Geometry& lastGeometry, SkRect* curren tBounds)
30 * 30 *
31 * bool CanCombine(const Geometry& mine, const Geometry& theirs, 31 * bool CanCombine(const Geometry& mine, const Geometry& theirs,
32 * const GrXPOverridesForBatch&) 32 * const GrXPOverridesForBatch&)
33 * 33 *
34 * const GrGeometryProcessor* CreateGP(const Geometry& seedGeometry, 34 * const GrGeometryProcessor* CreateGP(const Geometry& seedGeometry,
35 * const GrXPOverridesForBatch& override s) 35 * const GrXPOverridesForBatch& override s)
36 * 36 *
37 * const GrBuffer* GetIndexBuffer(GrResourceProvider*) 37 * const GrIndexBuffer* GetIndexBuffer(GrResourceProvider*)
38 * 38 *
39 * Tesselate(intptr_t vertices, size_t vertexStride, const Geometry& geo, 39 * Tesselate(intptr_t vertices, size_t vertexStride, const Geometry& geo,
40 * const GrXPOverridesForBatch& overrides) 40 * const GrXPOverridesForBatch& overrides)
41 */ 41 */
42 template <typename Impl> 42 template <typename Impl>
43 class GrTInstanceBatch : public GrVertexBatch { 43 class GrTInstanceBatch : public GrVertexBatch {
44 public: 44 public:
45 DEFINE_BATCH_CLASS_ID 45 DEFINE_BATCH_CLASS_ID
46 46
47 typedef typename Impl::Geometry Geometry; 47 typedef typename Impl::Geometry Geometry;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
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); 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 GrBuffer> 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);
110 if (!vertices || !indexBuffer) { 110 if (!vertices || !indexBuffer) {
111 SkDebugf("Could not allocate vertices\n"); 111 SkDebugf("Could not allocate vertices\n");
112 return; 112 return;
113 } 113 }
114 114
(...skipping 29 matching lines...) Expand all
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