| Index: src/gpu/batches/GrBatch.h
|
| diff --git a/src/gpu/batches/GrBatch.h b/src/gpu/batches/GrBatch.h
|
| index c5fc80c5d50dfbd622dfb69e3eb9adfbcd3c31f9..90b2fefb7b10983180d2003fddd674457c8090a1 100644
|
| --- a/src/gpu/batches/GrBatch.h
|
| +++ b/src/gpu/batches/GrBatch.h
|
| @@ -14,6 +14,10 @@
|
| #include "SkRect.h"
|
| #include "SkString.h"
|
|
|
| +#include "draws/GrDraw.h"
|
| +
|
| +#include "../private/SkTemplates.h"
|
| +
|
| class GrCaps;
|
| class GrBatchFlushState;
|
|
|
| @@ -109,6 +113,12 @@ public:
|
| /** Used for spewing information about batches when debugging. */
|
| virtual SkString dumpInfo() const = 0;
|
|
|
| + template <typename T, typename... Args> void initSnapStorage(Args&&... args) {
|
| + SkASSERT(!fSnap && sizeof(T) < fSnapStorage.size());
|
| + fSnap = new (SkTCast<T*>(fSnapStorage.get())) T(skstd::forward<Args>(args)...);
|
| + }
|
| + const GrDrawSnap* getDrawSnap() const { return fSnap; }
|
| +
|
| protected:
|
| // NOTE, compute some bounds, even if extremely conservative. Do *NOT* setLargest on the bounds
|
| // rect because we outset it for dst copy textures
|
| @@ -145,11 +155,14 @@ private:
|
|
|
| SkDEBUGCODE(bool fUsed;)
|
| const uint32_t fClassID;
|
| + GrDrawSnap* fSnap;
|
| + SkAlignedSStorage<128> fSnapStorage; // 128 bytes should be more than enough
|
| #if GR_BATCH_SPEW
|
| static uint32_t GenBatchID() { return GenID(&gCurrBatchUniqueID); }
|
| const uint32_t fUniqueID;
|
| static int32_t gCurrBatchUniqueID;
|
| #endif
|
| +
|
| static int32_t gCurrBatchClassID;
|
| typedef GrNonAtomicRef INHERITED;
|
| };
|
|
|