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 15 matching lines...) Expand all Loading... |
26 #include "SkClipStack.h" | 26 #include "SkClipStack.h" |
27 #include "SkMatrix.h" | 27 #include "SkMatrix.h" |
28 #include "SkPath.h" | 28 #include "SkPath.h" |
29 #include "SkStringUtils.h" | 29 #include "SkStringUtils.h" |
30 #include "SkStrokeRec.h" | 30 #include "SkStrokeRec.h" |
31 #include "SkTArray.h" | 31 #include "SkTArray.h" |
32 #include "SkTLazy.h" | 32 #include "SkTLazy.h" |
33 #include "SkTypes.h" | 33 #include "SkTypes.h" |
34 #include "SkXfermode.h" | 34 #include "SkXfermode.h" |
35 | 35 |
36 //#define ENABLE_MDB 1 | |
37 | |
38 class GrBatch; | 36 class GrBatch; |
39 class GrBatchFlushState; | 37 class GrBatchFlushState; |
40 class GrClip; | 38 class GrClip; |
41 class GrCaps; | 39 class GrCaps; |
42 class GrPath; | 40 class GrPath; |
43 class GrDrawPathBatchBase; | 41 class GrDrawPathBatchBase; |
44 class GrPathRangeDraw; | 42 class GrPathRangeDraw; |
45 | 43 |
46 class GrDrawTarget final : public SkRefCnt { | 44 class GrDrawTarget final : public SkRefCnt { |
47 public: | 45 public: |
48 // The context may not be fully constructed and should not be used during Gr
DrawTarget | 46 // The context may not be fully constructed and should not be used during Gr
DrawTarget |
49 // construction. | 47 // construction. |
50 GrDrawTarget(GrRenderTarget* rt, GrGpu* gpu, GrResourceProvider*); | 48 GrDrawTarget(GrGpu* gpu, GrResourceProvider*); |
51 | 49 |
52 ~GrDrawTarget() override; | 50 ~GrDrawTarget() override; |
53 | 51 |
54 void makeClosed() { | 52 void makeClosed() { |
55 // We only close drawTargets When MDB is enabled. When MDB is disabled t
here is only | 53 // We only close drawTargets When MDB is enabled. When MDB is disabled t
here is only |
56 // ever one drawTarget and all calls will be funnelled into it. | 54 // ever one drawTarget and all calls will be funnelled into it. |
57 #ifdef ENABLE_MDB | 55 #ifdef ENABLE_MDB |
58 this->setFlag(kClosed_Flag); | 56 this->setFlag(kClosed_Flag); |
59 #endif | 57 #endif |
60 } | 58 } |
61 bool isClosed() const { return this->isSetFlag(kClosed_Flag); } | 59 bool isClosed() const { return this->isSetFlag(kClosed_Flag); } |
62 | 60 |
63 // TODO: this entry point is only needed in the non-MDB world. Remove when | |
64 // we make the switch to MDB | |
65 void clearRT() { fRenderTarget = nullptr; } | |
66 | |
67 /* | 61 /* |
68 * Notify this drawTarget that it relies on the contents of 'dependedOn' | 62 * Notify this drawTarget that it relies on the contents of 'dependedOn' |
69 */ | 63 */ |
70 void addDependency(GrSurface* dependedOn); | 64 void addDependency(GrSurface* dependedOn); |
71 | 65 |
72 /* | 66 /* |
73 * Does this drawTarget depend on 'dependedOn'? | 67 * Does this drawTarget depend on 'dependedOn'? |
74 */ | 68 */ |
75 bool dependsOn(GrDrawTarget* dependedOn) const { | 69 bool dependsOn(GrDrawTarget* dependedOn) const { |
76 return fDependencies.find(dependedOn) >= 0; | 70 return fDependencies.find(dependedOn) >= 0; |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 GrResourceProvider* fResourceProvider; | 307 GrResourceProvider* fResourceProvider; |
314 GrBatchFlushState fFlushState; | 308 GrBatchFlushState fFlushState; |
315 bool fFlushing; | 309 bool fFlushing; |
316 int fFirstUnpreparedBatch; | 310 int fFirstUnpreparedBatch; |
317 | 311 |
318 SkDEBUGCODE(int fDebugID;) | 312 SkDEBUGCODE(int fDebugID;) |
319 uint32_t fFlags; | 313 uint32_t fFlags; |
320 | 314 |
321 // 'this' drawTarget relies on the output of the drawTargets in 'fDependenci
es' | 315 // 'this' drawTarget relies on the output of the drawTargets in 'fDependenci
es' |
322 SkTDArray<GrDrawTarget*> fDependencies; | 316 SkTDArray<GrDrawTarget*> fDependencies; |
323 GrRenderTarget* fRenderTarget; | |
324 | 317 |
325 typedef SkRefCnt INHERITED; | 318 typedef SkRefCnt INHERITED; |
326 }; | 319 }; |
327 | 320 |
328 #endif | 321 #endif |
OLD | NEW |