OLD | NEW |
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 14 matching lines...) Expand all Loading... |
25 #include "SkClipStack.h" | 25 #include "SkClipStack.h" |
26 #include "SkMatrix.h" | 26 #include "SkMatrix.h" |
27 #include "SkPath.h" | 27 #include "SkPath.h" |
28 #include "SkStringUtils.h" | 28 #include "SkStringUtils.h" |
29 #include "SkStrokeRec.h" | 29 #include "SkStrokeRec.h" |
30 #include "SkTArray.h" | 30 #include "SkTArray.h" |
31 #include "SkTLazy.h" | 31 #include "SkTLazy.h" |
32 #include "SkTypes.h" | 32 #include "SkTypes.h" |
33 #include "SkXfermode.h" | 33 #include "SkXfermode.h" |
34 | 34 |
35 //#define ENABLE_MDB 1 | 35 #define ENABLE_MDB 1 |
36 | 36 |
37 class GrBatch; | 37 class GrBatch; |
38 class GrClip; | 38 class GrClip; |
39 class GrCaps; | 39 class GrCaps; |
| 40 class GrFoo; |
40 class GrPath; | 41 class GrPath; |
41 class GrDrawPathBatchBase; | 42 class GrDrawPathBatchBase; |
42 class GrPathRangeDraw; | 43 class GrPathRangeDraw; |
| 44 class GrDrawContext; |
| 45 class GrDrawTarget; |
| 46 |
43 | 47 |
44 class GrDrawTarget final : public SkRefCnt { | 48 class GrDrawTarget final : public SkRefCnt { |
45 public: | 49 public: |
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(GrRenderTarget* rt, GrGpu* gpu, GrResourceProvider*); | 52 GrDrawTarget(GrRenderTarget* rt, GrGpu* gpu, GrResourceProvider*); |
49 | 53 |
| 54 /////////////////////////////////////////////////////////////////////////// |
| 55 bool isEmpty3() const { |
| 56 return fBatches.count() == 0; |
| 57 } |
| 58 |
| 59 void addRequiredDep(GrDrawTarget* srcDT) { |
| 60 *fRequired.push() = srcDT; |
| 61 } |
| 62 |
| 63 // fRequired dependances are from the TextureAccess system |
| 64 SkTDArray<GrDrawTarget*> fRequired; |
| 65 |
| 66 GrRenderTarget* rt_delete_me() { return fRenderTarget; } |
| 67 |
| 68 /////////////////////////////////////////////////////////////////////////// |
| 69 |
50 ~GrDrawTarget() override; | 70 ~GrDrawTarget() override; |
51 | 71 |
52 void makeClosed() { | 72 void makeClosed() { |
53 // We only close drawTargets When MDB is enabled. When MDB is disabled t
here is only | 73 // 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. | 74 // ever one drawTarget and all calls will be funnelled into it. |
55 #ifdef ENABLE_MDB | 75 #ifdef ENABLE_MDB |
56 this->setFlag(kClosed_Flag); | 76 this->setFlag(kClosed_Flag); |
57 #endif | 77 #endif |
58 } | 78 } |
59 bool isClosed() const { return this->isSetFlag(kClosed_Flag); } | 79 bool isClosed() const { return this->isSetFlag(kClosed_Flag); } |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 // Check to see if this set of draw commands has been sent out | 308 // Check to see if this set of draw commands has been sent out |
289 void getPathStencilSettingsForFilltype(GrPathRendering::FillType, | 309 void getPathStencilSettingsForFilltype(GrPathRendering::FillType, |
290 const GrStencilAttachment*, | 310 const GrStencilAttachment*, |
291 GrStencilSettings*); | 311 GrStencilSettings*); |
292 bool setupClip(const GrPipelineBuilder&, | 312 bool setupClip(const GrPipelineBuilder&, |
293 GrPipelineBuilder::AutoRestoreFragmentProcessorState*
, | 313 GrPipelineBuilder::AutoRestoreFragmentProcessorState*
, |
294 GrPipelineBuilder::AutoRestoreStencil*, | 314 GrPipelineBuilder::AutoRestoreStencil*, |
295 GrScissorState*, | 315 GrScissorState*, |
296 const SkRect* devBounds); | 316 const SkRect* devBounds); |
297 | 317 |
| 318 void checkUses() const; |
| 319 |
298 void addDependency(GrDrawTarget* dependedOn); | 320 void addDependency(GrDrawTarget* dependedOn); |
299 | 321 |
300 // Used only by CMM. | 322 // Used only by CMM. |
301 void clearStencilClip(const SkIRect&, bool insideClip, GrRenderTarget*); | 323 void clearStencilClip(const SkIRect&, bool insideClip, GrRenderTarget*); |
302 | 324 |
303 SkSTArray<256, SkAutoTUnref<GrBatch>, true> fBatches; | 325 SkSTArray<256, SkAutoTUnref<GrBatch>, true> fBatches; |
304 SkAutoTDelete<GrClipMaskManager> fClipMaskManager; | 326 SkAutoTDelete<GrClipMaskManager> fClipMaskManager; |
305 // The context is only in service of the clip mask manager, remove once CMM
doesn't need this. | 327 // The context is only in service of the clip mask manager, remove once CMM
doesn't need this. |
306 GrContext* fContext; | 328 GrContext* fContext; |
307 GrGpu* fGpu; | 329 GrGpu* fGpu; |
308 GrResourceProvider* fResourceProvider; | 330 GrResourceProvider* fResourceProvider; |
309 bool fFlushing; | 331 bool fFlushing; |
310 | 332 |
311 SkDEBUGCODE(int fDebugID;) | 333 SkDEBUGCODE(int fDebugID;) |
312 uint32_t fFlags; | 334 uint32_t fFlags; |
313 | 335 |
314 // 'this' drawTarget relies on the output of the drawTargets in 'fDependenci
es' | 336 // 'this' drawTarget relies on the output of the drawTargets in 'fDependenci
es' |
315 SkTDArray<GrDrawTarget*> fDependencies; | 337 SkTDArray<GrDrawTarget*> fDependencies; |
316 GrRenderTarget* fRenderTarget; | 338 GrRenderTarget* fRenderTarget; |
317 | 339 |
318 typedef SkRefCnt INHERITED; | 340 typedef SkRefCnt INHERITED; |
319 }; | 341 }; |
320 | 342 |
321 #endif | 343 #endif |
OLD | NEW |