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

Unified Diff: src/gpu/GrDrawTarget.h

Issue 184443003: Add Gpu Tracing to Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added files Created 6 years, 9 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
Index: src/gpu/GrDrawTarget.h
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 19ce16f64a68818512f0d32b7192c90a06dd6b4e..20231ea4505e9c7a82c1c23f1bbfb070d04041bb 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -11,6 +11,7 @@
#include "GrClipData.h"
#include "GrDrawState.h"
#include "GrIndexBuffer.h"
+#include "GrTracing.h"
#include "SkClipStack.h"
#include "SkMatrix.h"
@@ -423,18 +424,12 @@ public:
GrRenderTarget* renderTarget = NULL) = 0;
/**
- * instantGpuTraceEvent places a single "sign post" type marker into command stream. The
- * argument marker will be the name of the annotation that is added.
+ * Called at start and end of gpu trace marking
+ * GR_CREATE_GPU_TRACE_MARKER(marker_str, target) will automatically call these at the start
+ * and end of a code block respectively
*/
- void instantGpuTraceEvent(const char* marker);
- /**
- * The following two functions are used for marking groups of commands. Use pushGpuTraceEvent
- * to set the beginning of a command set, and popGpuTraceEvent is be called at end of the
- * command set. The argument marker is the name for the annotation that is added. The push and
- * pops can be used hierarchically, but every push must have a match pop.
- */
- void pushGpuTraceEvent(const char* marker);
- void popGpuTraceEvent();
+ void addGpuTraceMarker(GrGpuTraceMarker* marker);
+ void removeGpuTraceMarker(GrGpuTraceMarker* marker);
/**
* Copies a pixel rectangle from one surface to another. This call may finalize
@@ -487,6 +482,8 @@ public:
this->onDrawPath(path, fill, dstCopy);
}
+ bool isGpuTracingEnabled() const;
+
////////////////////////////////////////////////////////////////////////////
/**
@@ -763,6 +760,8 @@ protected:
// Subclass must initialize this in its constructor.
SkAutoTUnref<const GrDrawTargetCaps> fCaps;
+ const GrTraceMarkerSet& getActiveTraceMarkers() { return fActiveTraceMarkers; }
+
/**
* Used to communicate draws to subclass's onDraw function.
*/
@@ -868,9 +867,8 @@ private:
virtual void onDrawPath(const GrPath*, SkPath::FillType,
const GrDeviceCoordTexture* dstCopy) = 0;
- virtual void onInstantGpuTraceEvent(const char* marker) = 0;
- virtual void onPushGpuTraceEvent(const char* marker) = 0;
- virtual void onPopGpuTraceEvent() = 0;
+ virtual void didAddGpuTraceMarker() = 0;
+ virtual void didRemoveGpuTraceMarker() = 0;
// helpers for reserving vertex and index space.
bool reserveVertexSpace(size_t vertexSize,
@@ -906,8 +904,9 @@ private:
GrDrawState fDefaultDrawState;
// The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTarget.
GrContext* fContext;
- // To keep track that we always have at least as many debug marker pushes as pops
- int fPushGpuTraceCount;
+ // To keep track that we always have at least as many debug marker adds as removes
+ int fGpuTraceMarkerCount;
+ GrTraceMarkerSet fActiveTraceMarkers;
typedef SkRefCnt INHERITED;
};

Powered by Google App Engine
This is Rietveld 408576698