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

Unified Diff: src/gpu/GrTargetCommands.h

Issue 1276913002: Add Batch logging (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 4 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/GrReorderCommandBuilder.cpp ('k') | src/gpu/GrTargetCommands.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTargetCommands.h
diff --git a/src/gpu/GrTargetCommands.h b/src/gpu/GrTargetCommands.h
index 55c1dfc552370870fb75f4d04b0a032d49d1d146..7745018484b88ca1dc229289cd6a9e4e973d0fa6 100644
--- a/src/gpu/GrTargetCommands.h
+++ b/src/gpu/GrTargetCommands.h
@@ -43,7 +43,13 @@ public:
kXferBarrier_CmdType = 9,
};
- Cmd(CmdType type) : fMarkerID(-1), fType(type) {}
+ Cmd(CmdType type)
+ : fMarkerID(-1)
+ , fType(type)
+#if GR_BATCH_SPEW
+ , fUniqueID(GenID(&gUniqueID))
+#endif
+{}
virtual ~Cmd() {}
virtual void execute(GrGpu*) = 0;
@@ -54,10 +60,21 @@ public:
bool isTraced() const { return -1 != fMarkerID; }
void setMarkerID(int markerID) { SkASSERT(-1 == fMarkerID); fMarkerID = markerID; }
int markerID() const { return fMarkerID; }
+ GrBATCH_SPEW(uint32_t uniqueID() const { return fUniqueID;} )
private:
+ // TODO move this to a common header so it can be shared with GrBatch
+ static uint32_t GenID(int32_t* idCounter) {
+ uint32_t id = static_cast<uint32_t>(sk_atomic_inc(idCounter)) + 1;
+ if (!id) {
+ SkFAIL("This should never wrap\n");
+ }
+ return id;
+ }
int fMarkerID;
CmdType fType;
+ GrBATCH_SPEW(uint32_t fUniqueID);
+ GrBATCH_SPEW(static int32_t gUniqueID;)
};
void reset();
« no previous file with comments | « src/gpu/GrReorderCommandBuilder.cpp ('k') | src/gpu/GrTargetCommands.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698