| 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 16 matching lines...) Expand all Loading... |
| 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 GrAuditTrail; |
| 37 class GrBatch; | 38 class GrBatch; |
| 38 class GrClip; | 39 class GrClip; |
| 39 class GrCaps; | 40 class GrCaps; |
| 40 class GrPath; | 41 class GrPath; |
| 41 class GrDrawPathBatchBase; | 42 class GrDrawPathBatchBase; |
| 42 | 43 |
| 43 class GrDrawTarget final : public SkRefCnt { | 44 class GrDrawTarget final : public SkRefCnt { |
| 44 public: | 45 public: |
| 45 /** Options for GrDrawTarget behavior. */ | 46 /** Options for GrDrawTarget behavior. */ |
| 46 struct Options { | 47 struct Options { |
| 47 Options () : fClipBatchToBounds(false), fDrawBatchBounds(false), fMaxBat
chLookback(-1) {} | 48 Options () : fClipBatchToBounds(false), fDrawBatchBounds(false), fMaxBat
chLookback(-1) {} |
| 48 bool fClipBatchToBounds; | 49 bool fClipBatchToBounds; |
| 49 bool fDrawBatchBounds; | 50 bool fDrawBatchBounds; |
| 50 int fMaxBatchLookback; | 51 int fMaxBatchLookback; |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 GrDrawTarget(GrRenderTarget*, GrGpu*, GrResourceProvider*, const Options&); | 54 GrDrawTarget(GrRenderTarget*, GrGpu*, GrResourceProvider*, GrAuditTrail*, co
nst Options&); |
| 54 | 55 |
| 55 ~GrDrawTarget() override; | 56 ~GrDrawTarget() override; |
| 56 | 57 |
| 57 void makeClosed() { | 58 void makeClosed() { |
| 58 // We only close drawTargets When MDB is enabled. When MDB is disabled t
here is only | 59 // We only close drawTargets When MDB is enabled. When MDB is disabled t
here is only |
| 59 // ever one drawTarget and all calls will be funnelled into it. | 60 // ever one drawTarget and all calls will be funnelled into it. |
| 60 #ifdef ENABLE_MDB | 61 #ifdef ENABLE_MDB |
| 61 this->setFlag(kClosed_Flag); | 62 this->setFlag(kClosed_Flag); |
| 62 #endif | 63 #endif |
| 63 } | 64 } |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 282 |
| 282 // Used only by CMM. | 283 // Used only by CMM. |
| 283 void clearStencilClip(const SkIRect&, bool insideClip, GrRenderTarget*); | 284 void clearStencilClip(const SkIRect&, bool insideClip, GrRenderTarget*); |
| 284 | 285 |
| 285 SkSTArray<256, SkAutoTUnref<GrBatch>, true> fBatches; | 286 SkSTArray<256, SkAutoTUnref<GrBatch>, true> fBatches; |
| 286 SkAutoTDelete<GrClipMaskManager> fClipMaskManager; | 287 SkAutoTDelete<GrClipMaskManager> fClipMaskManager; |
| 287 // The context is only in service of the clip mask manager, remove once CMM
doesn't need this. | 288 // The context is only in service of the clip mask manager, remove once CMM
doesn't need this. |
| 288 GrContext* fContext; | 289 GrContext* fContext; |
| 289 GrGpu* fGpu; | 290 GrGpu* fGpu; |
| 290 GrResourceProvider* fResourceProvider; | 291 GrResourceProvider* fResourceProvider; |
| 292 GrAuditTrail* fAuditTrail; |
| 291 | 293 |
| 292 SkDEBUGCODE(int fDebugID;) | 294 SkDEBUGCODE(int fDebugID;) |
| 293 uint32_t fFlags; | 295 uint32_t fFlags; |
| 294 | 296 |
| 295 // 'this' drawTarget relies on the output of the drawTargets in 'fDependenci
es' | 297 // 'this' drawTarget relies on the output of the drawTargets in 'fDependenci
es' |
| 296 SkTDArray<GrDrawTarget*> fDependencies; | 298 SkTDArray<GrDrawTarget*> fDependencies; |
| 297 GrRenderTarget* fRenderTarget; | 299 GrRenderTarget* fRenderTarget; |
| 298 | 300 |
| 299 bool fDrawBatchBounds; | 301 bool fDrawBatchBounds; |
| 300 int fMaxBatchLookback; | 302 int fMaxBatchLookback; |
| 301 | 303 |
| 302 typedef SkRefCnt INHERITED; | 304 typedef SkRefCnt INHERITED; |
| 303 }; | 305 }; |
| 304 | 306 |
| 305 #endif | 307 #endif |
| OLD | NEW |