Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: src/gpu/batches/GrBatch.h

Issue 1355353002: Create GrDraw and start fast pathing src over rects (Closed) Base URL: https://skia.googlesource.com/skia.git@strokerect2
Patch Set: tweaks Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/batches/GrAAFillRectBatch.cpp ('k') | src/gpu/batches/GrBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « src/gpu/batches/GrAAFillRectBatch.cpp ('k') | src/gpu/batches/GrBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698