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

Side by Side Diff: src/gpu/GrDrawTarget.h

Issue 2066993003: Begin instanced rendering for simple shapes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rix perf regressions Created 4 years, 5 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/GrDrawContextPriv.h ('k') | src/gpu/GrDrawTarget.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 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 #ifndef GrDrawTarget_DEFINED 8 #ifndef GrDrawTarget_DEFINED
9 #define GrDrawTarget_DEFINED 9 #define GrDrawTarget_DEFINED
10 10
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 * src bounds then pixel values in the dst rect corresponding to area clipp ed 137 * src bounds then pixel values in the dst rect corresponding to area clipp ed
138 * by the src rect are not overwritten. This method is not guaranteed to suc ceed 138 * by the src rect are not overwritten. This method is not guaranteed to suc ceed
139 * depending on the type of surface, configs, etc, and the backend-specific 139 * depending on the type of surface, configs, etc, and the backend-specific
140 * limitations. 140 * limitations.
141 */ 141 */
142 bool copySurface(GrSurface* dst, 142 bool copySurface(GrSurface* dst,
143 GrSurface* src, 143 GrSurface* src,
144 const SkIRect& srcRect, 144 const SkIRect& srcRect,
145 const SkIPoint& dstPoint); 145 const SkIPoint& dstPoint);
146 146
147 /**
148 * Gets the shape rendering object if it is supported on this platform.
149 */
150 gr_instanced::InstancedRendering* instancedRendering() const { return fInsta ncedRendering; }
151
147 private: 152 private:
148 friend class GrDrawingManager; // for resetFlag & TopoSortTraits 153 friend class GrDrawingManager; // for resetFlag & TopoSortTraits
149 friend class GrDrawContextPriv; // for clearStencilClip 154 friend class GrDrawContextPriv; // for clearStencilClip
150 155
151 enum Flags { 156 enum Flags {
152 kClosed_Flag = 0x01, //!< This drawTarget can't accept any more bat ches 157 kClosed_Flag = 0x01, //!< This drawTarget can't accept any more bat ches
153 158
154 kWasOutput_Flag = 0x02, //!< Flag for topological sorting 159 kWasOutput_Flag = 0x02, //!< Flag for topological sorting
155 kTempMark_Flag = 0x04, //!< Flag for topological sorting 160 kTempMark_Flag = 0x04, //!< Flag for topological sorting
156 }; 161 };
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 const GrClip&, 207 const GrClip&,
203 const GrPipelineOptimizations& optimizations, 208 const GrPipelineOptimizations& optimizations,
204 GrXferProcessor::DstTexture*, 209 GrXferProcessor::DstTexture*,
205 const SkRect& batchBounds); 210 const SkRect& batchBounds);
206 211
207 void addDependency(GrDrawTarget* dependedOn); 212 void addDependency(GrDrawTarget* dependedOn);
208 213
209 // Used only by drawContextPriv. 214 // Used only by drawContextPriv.
210 void clearStencilClip(const SkIRect&, bool insideClip, GrRenderTarget*); 215 void clearStencilClip(const SkIRect&, bool insideClip, GrRenderTarget*);
211 216
212 SkSTArray<256, SkAutoTUnref<GrBatch>, true> fBatches; 217 SkSTArray<256, SkAutoTUnref<GrBatch>, true> fBatches;
213 // The context is only in service of the clip mask manager, remove once CMM doesn't need this. 218 // The context is only in service of the clip mask manager, remove once CMM doesn't need this.
214 GrContext* fContext; 219 GrContext* fContext;
215 GrGpu* fGpu; 220 GrGpu* fGpu;
216 GrResourceProvider* fResourceProvider; 221 GrResourceProvider* fResourceProvider;
217 GrAuditTrail* fAuditTrail; 222 GrAuditTrail* fAuditTrail;
218 223
219 SkDEBUGCODE(int fDebugID;) 224 SkDEBUGCODE(int fDebugID;)
220 uint32_t fFlags; 225 uint32_t fFlags;
221 226
222 // 'this' drawTarget relies on the output of the drawTargets in 'fDependenci es' 227 // 'this' drawTarget relies on the output of the drawTargets in 'fDependenci es'
223 SkTDArray<GrDrawTarget*> fDependencies; 228 SkTDArray<GrDrawTarget*> fDependencies;
224 GrRenderTarget* fRenderTarget; 229 GrRenderTarget* fRenderTarget;
225 230
226 bool fClipBatchToBounds; 231 bool fClipBatchToBounds;
227 bool fDrawBatchBounds; 232 bool fDrawBatchBounds;
228 int fMaxBatchLookback; 233 int fMaxBatchLookback;
229 int fMaxBatchLookahead; 234 int fMaxBatchLookahead;
235
236 SkAutoTDelete<gr_instanced::InstancedRendering> fInstancedRendering;
230 237
231 typedef SkRefCnt INHERITED; 238 typedef SkRefCnt INHERITED;
232 }; 239 };
233 240
234 #endif 241 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawContextPriv.h ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698