Index: src/gpu/batches/GrBatch.h |
diff --git a/src/gpu/batches/GrBatch.h b/src/gpu/batches/GrBatch.h |
index c5fc80c5d50dfbd622dfb69e3eb9adfbcd3c31f9..ea1712f6452c4bd84437ceaaf653b257c4948ec1 100644 |
--- a/src/gpu/batches/GrBatch.h |
+++ b/src/gpu/batches/GrBatch.h |
@@ -14,6 +14,8 @@ |
#include "SkRect.h" |
#include "SkString.h" |
+#include "draws/GrDraw.h" |
+ |
class GrCaps; |
class GrBatchFlushState; |
@@ -109,6 +111,14 @@ public: |
/** Used for spewing information about batches when debugging. */ |
virtual SkString dumpInfo() const = 0; |
+ // TODO put on stack |
+ template <class T> T* getSnapStorage() { |
bsalomon
2015/09/23 13:49:38
Can we do anything here with var args to forward c
joshualitt
2015/09/25 18:17:12
Acknowledged.
|
+ SkASSERT(sizeof(T) < fSnapStorage.size()); |
+ fSnap = reinterpret_cast<GrDrawSnap*>(fSnapStorage.get()); |
+ return reinterpret_cast<T*>(fSnap); |
+ } |
+ const GrDrawSnap* drawSnap() 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 |
@@ -150,6 +160,9 @@ private: |
const uint32_t fUniqueID; |
static int32_t gCurrBatchUniqueID; |
#endif |
+ GrDrawSnap* fSnap; |
bsalomon
2015/09/23 13:49:38
alignment
robertphillips
2015/09/25 12:48:48
How was 256 arrived at ?
joshualitt
2015/09/25 18:17:12
magic! I'll add a comment
joshualitt
2015/09/25 18:17:12
Acknowledged.
|
+ SkAlignedSStorage<256> fSnapStorage; |
+ |
static int32_t gCurrBatchClassID; |
typedef GrNonAtomicRef INHERITED; |
}; |