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

Unified Diff: src/gpu/GrTraceMarker.h

Issue 184443003: Add Gpu Tracing to Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Merge fixes 2 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
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | src/gpu/GrTraceMarker.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTraceMarker.h
diff --git a/src/gpu/GrTraceMarker.h b/src/gpu/GrTraceMarker.h
new file mode 100644
index 0000000000000000000000000000000000000000..38e87fd0fb5bd9776d67dcfaeddeb7551b44198c
--- /dev/null
+++ b/src/gpu/GrTraceMarker.h
@@ -0,0 +1,69 @@
+
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkTDArray.h"
+
+#ifndef GrTraceMarkerSet_DEFINED
+#define GrTraceMarkerSet_DEFINED
+
+class GrGpuTraceMarker {
+public:
+ GrGpuTraceMarker() {};
+ GrGpuTraceMarker(const char* marker, int idCounter) : fMarker(marker), fID(idCounter) {}
+
+ bool operator<(const GrGpuTraceMarker& rhs) const {
+ return this->fMarker < rhs.fMarker || (this->fMarker == rhs.fMarker && this->fID < rhs.fID);
+ }
+
+ bool operator==(const GrGpuTraceMarker& rhs) const {
+ return (this->fID == rhs.fID && this->fMarker == rhs.fMarker);
+ }
+
+ const char* fMarker;
+ int fID;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+
+class SkString;
+
+class GrTraceMarkerSet {
+public:
+ GrTraceMarkerSet() {}
+
+ GrTraceMarkerSet(const GrTraceMarkerSet& other);
+
+ // Adds marker to the set.
+ void add(const GrGpuTraceMarker& marker);
+ // Adds all markers from one set into this set.
+ void addSet(const GrTraceMarkerSet& markerSet);
+
+ void remove(const GrGpuTraceMarker& marker);
+
+ int count() const;
+
+ /**
+ * First sorts fMarkerArray and returns a string of the format
+ * MarkerName1(#,#,...)%MarkerName2(#,#,...):... where MarkerName is the
+ * marker string used in the TraceMarker and the (#,#,..) is a list of instance
+ * id's for the the given marker string
+ */
+ SkString toString() const;
+
+ class Iter;
+
+ Iter begin() const;
+
+ Iter end() const;
+
+private:
+ mutable SkTDArray<GrGpuTraceMarker> fMarkerArray;
+};
+
+#endif
+
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | src/gpu/GrTraceMarker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698