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

Side by Side Diff: src/gpu/instanced/InstancedRendering.h

Issue 2182783004: Add test configs for instanced rendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add test configs for instanced rendering Created 4 years, 4 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/instanced/InstanceProcessor.cpp ('k') | src/gpu/instanced/InstancedRendering.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 2016 Google Inc. 2 * Copyright 2016 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 gr_instanced_InstancedRendering_DEFINED 8 #ifndef gr_instanced_InstancedRendering_DEFINED
9 #define gr_instanced_InstancedRendering_DEFINED 9 #define gr_instanced_InstancedRendering_DEFINED
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 Draw* fHeadDraw; 136 Draw* fHeadDraw;
137 Draw* fTailDraw; 137 Draw* fTailDraw;
138 138
139 typedef GrDrawBatch INHERITED; 139 typedef GrDrawBatch INHERITED;
140 140
141 friend class InstancedRendering; 141 friend class InstancedRendering;
142 }; 142 };
143 143
144 typedef SkTInternalLList<Batch> BatchList; 144 typedef SkTInternalLList<Batch> BatchList;
145 145
146 InstancedRendering(GrGpu* gpu, AntialiasMode lastSupportedAAMode, bool canRe nderToFloat); 146 InstancedRendering(GrGpu* gpu);
147 147
148 const BatchList& trackedBatches() const { return fTrackedBatches; } 148 const BatchList& trackedBatches() const { return fTrackedBatches; }
149 const GrBuffer* vertexBuffer() const { SkASSERT(fVertexBuffer); return fVert exBuffer; } 149 const GrBuffer* vertexBuffer() const { SkASSERT(fVertexBuffer); return fVert exBuffer; }
150 const GrBuffer* indexBuffer() const { SkASSERT(fIndexBuffer); return fIndexB uffer; } 150 const GrBuffer* indexBuffer() const { SkASSERT(fIndexBuffer); return fIndexB uffer; }
151 151
152 virtual void onBeginFlush(GrResourceProvider*) = 0; 152 virtual void onBeginFlush(GrResourceProvider*) = 0;
153 virtual void onDraw(const GrPipeline&, const InstanceProcessor&, const Batch *) = 0; 153 virtual void onDraw(const GrPipeline&, const InstanceProcessor&, const Batch *) = 0;
154 virtual void onEndFlush() = 0; 154 virtual void onEndFlush() = 0;
155 virtual void onResetGpuResources(ResetType) = 0; 155 virtual void onResetGpuResources(ResetType) = 0;
156 156
157 private: 157 private:
158 enum class State : bool { 158 enum class State : bool {
159 kRecordingDraws, 159 kRecordingDraws,
160 kFlushing 160 kFlushing
161 }; 161 };
162 162
163 Batch* SK_WARN_UNUSED_RESULT recordShape(ShapeType, const SkRect& bounds, 163 Batch* SK_WARN_UNUSED_RESULT recordShape(ShapeType, const SkRect& bounds,
164 const SkMatrix& viewMatrix, GrColor , 164 const SkMatrix& viewMatrix, GrColor ,
165 const SkRect& localRect, bool antia lias, 165 const SkRect& localRect, bool antia lias,
166 const GrInstancedPipelineInfo&, boo l* requireHWAA); 166 const GrInstancedPipelineInfo&, boo l* requireHWAA);
167 167
168 bool selectAntialiasMode(const SkMatrix& viewMatrix, bool antialias, 168 bool selectAntialiasMode(const SkMatrix& viewMatrix, bool antialias,
169 const GrInstancedPipelineInfo&, bool* useHWAA, Anti aliasMode*); 169 const GrInstancedPipelineInfo&, bool* useHWAA, Anti aliasMode*);
170 170
171 virtual Batch* createBatch() = 0; 171 virtual Batch* createBatch() = 0;
172 172
173 const SkAutoTUnref<GrGpu> fGpu; 173 const SkAutoTUnref<GrGpu> fGpu;
174 const AntialiasMode fLastSupportedAAMode;
175 const bool fCanRenderToFloat;
176 State fState; 174 State fState;
177 GrMemoryPool fDrawPool; 175 GrMemoryPool fDrawPool;
178 SkSTArray<1024, ParamsTexel, true> fParams; 176 SkSTArray<1024, ParamsTexel, true> fParams;
179 BatchList fTrackedBatches; 177 BatchList fTrackedBatches;
180 SkAutoTUnref<const GrBuffer> fVertexBuffer; 178 SkAutoTUnref<const GrBuffer> fVertexBuffer;
181 SkAutoTUnref<const GrBuffer> fIndexBuffer; 179 SkAutoTUnref<const GrBuffer> fIndexBuffer;
182 SkAutoTUnref<GrBuffer> fParamsBuffer; 180 SkAutoTUnref<GrBuffer> fParamsBuffer;
183 }; 181 };
184 182
185 } 183 }
186 184
187 #endif 185 #endif
OLDNEW
« no previous file with comments | « src/gpu/instanced/InstanceProcessor.cpp ('k') | src/gpu/instanced/InstancedRendering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698