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

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

Issue 1421853002: Add immediate mode option for gpu configs in dm (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add assert Created 5 years, 2 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/GrContext.cpp ('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 25 matching lines...) Expand all
36 class GrBatch; 36 class GrBatch;
37 class GrBatchFlushState; 37 class GrBatchFlushState;
38 class GrClip; 38 class GrClip;
39 class GrCaps; 39 class GrCaps;
40 class GrPath; 40 class GrPath;
41 class GrDrawPathBatchBase; 41 class GrDrawPathBatchBase;
42 class GrPathRangeDraw; 42 class GrPathRangeDraw;
43 43
44 class GrDrawTarget final : public SkRefCnt { 44 class GrDrawTarget final : public SkRefCnt {
45 public: 45 public:
46 struct Options {
47 bool fImmediateMode;
48 };
49
46 // The context may not be fully constructed and should not be used during Gr DrawTarget 50 // The context may not be fully constructed and should not be used during Gr DrawTarget
47 // construction. 51 // construction.
48 GrDrawTarget(GrGpu* gpu, GrResourceProvider*); 52 GrDrawTarget(GrGpu* gpu, GrResourceProvider*, const Options& options);
49 53
50 ~GrDrawTarget() override; 54 ~GrDrawTarget() override;
51 55
52 void makeClosed() { 56 void makeClosed() {
53 // We only close drawTargets When MDB is enabled. When MDB is disabled t here is only 57 // We only close drawTargets When MDB is enabled. When MDB is disabled t here is only
54 // ever one drawTarget and all calls will be funnelled into it. 58 // ever one drawTarget and all calls will be funnelled into it.
55 #ifdef ENABLE_MDB 59 #ifdef ENABLE_MDB
56 this->setFlag(kClosed_Flag); 60 this->setFlag(kClosed_Flag);
57 #endif 61 #endif
58 } 62 }
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 218 }
215 219
216 GrContext* context() const { return fDrawTarget->fContext; } 220 GrContext* context() const { return fDrawTarget->fContext; }
217 GrResourceProvider* resourceProvider() const { return fDrawTarget->fReso urceProvider; } 221 GrResourceProvider* resourceProvider() const { return fDrawTarget->fReso urceProvider; }
218 GrDrawTarget* fDrawTarget; 222 GrDrawTarget* fDrawTarget;
219 friend class GrClipMaskManager; 223 friend class GrClipMaskManager;
220 }; 224 };
221 225
222 const CMMAccess cmmAccess() { return CMMAccess(this); } 226 const CMMAccess cmmAccess() { return CMMAccess(this); }
223 227
224
225 private: 228 private:
226 friend class GrDrawingManager; // for resetFlag & TopoSortTraits 229 friend class GrDrawingManager; // for resetFlag & TopoSortTraits
227 230
228 enum Flags { 231 enum Flags {
229 kClosed_Flag = 0x01, //!< This drawTarget can't accept any more bat ches 232 kClosed_Flag = 0x01, //!< This drawTarget can't accept any more bat ches
230 233
231 kWasOutput_Flag = 0x02, //!< Flag for topological sorting 234 kWasOutput_Flag = 0x02, //!< Flag for topological sorting
232 kTempMark_Flag = 0x04, //!< Flag for topological sorting 235 kTempMark_Flag = 0x04, //!< Flag for topological sorting
233 }; 236 };
234 237
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 // The context is only in service of the clip mask manager, remove once CMM doesn't need this. 307 // The context is only in service of the clip mask manager, remove once CMM doesn't need this.
305 GrContext* fContext; 308 GrContext* fContext;
306 GrGpu* fGpu; 309 GrGpu* fGpu;
307 GrResourceProvider* fResourceProvider; 310 GrResourceProvider* fResourceProvider;
308 GrBatchFlushState fFlushState; 311 GrBatchFlushState fFlushState;
309 bool fFlushing; 312 bool fFlushing;
310 int fFirstUnpreparedBatch; 313 int fFirstUnpreparedBatch;
311 314
312 SkDEBUGCODE(int fDebugID;) 315 SkDEBUGCODE(int fDebugID;)
313 uint32_t fFlags; 316 uint32_t fFlags;
317 Options fOptions;
314 318
315 // 'this' drawTarget relies on the output of the drawTargets in 'fDependenci es' 319 // 'this' drawTarget relies on the output of the drawTargets in 'fDependenci es'
316 SkTDArray<GrDrawTarget*> fDependencies; 320 SkTDArray<GrDrawTarget*> fDependencies;
317 321
318 typedef SkRefCnt INHERITED; 322 typedef SkRefCnt INHERITED;
319 }; 323 };
320 324
321 #endif 325 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698