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

Unified Diff: src/gpu/GrTraceMarker.cpp

Issue 378933002: Improve gpu tracing when applying markers directly to gpu target (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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/GrTraceMarker.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTraceMarker.cpp
diff --git a/src/gpu/GrTraceMarker.cpp b/src/gpu/GrTraceMarker.cpp
index 11cdd5e2c2532340c0998cd1b32f576d65d9845f..bc6d4566189dd8582462891d1da785dd4b41eb2a 100644
--- a/src/gpu/GrTraceMarker.cpp
+++ b/src/gpu/GrTraceMarker.cpp
@@ -39,6 +39,21 @@ int GrTraceMarkerSet::count() const {
return this->fMarkerArray.count();
}
+SkString GrTraceMarkerSet::toStringLast() const {
+ const int numMarkers = this->fMarkerArray.count();
+ SkString marker_string;
+ if (numMarkers > 0) {
+ GrGpuTraceMarker& lastMarker = this->fMarkerArray[numMarkers - 1];
+ marker_string.append(lastMarker.fMarker);
+ if (lastMarker.fID != -1) {
+ marker_string.append("(");
+ marker_string.appendS32(lastMarker.fID);
+ marker_string.append(")");
+ }
+ }
+ return marker_string;
+}
+
SkString GrTraceMarkerSet::toString() const {
SkTQSort<GrGpuTraceMarker>(this->fMarkerArray.begin(), this->fMarkerArray.end() - 1);
SkString marker_string;
@@ -57,12 +72,14 @@ SkString GrTraceMarkerSet::toString() const {
GrGpuTraceMarker& currMarker = this->fMarkerArray[i];
const char* currCmd = currMarker.fMarker;
if (currCmd != prevMarkerName) {
- if (counter != 0) {
+ if (prevMarkerID != -1) {
marker_string.append(") ");
}
marker_string.append(currCmd);
- marker_string.append("(");
- marker_string.appendS32(currMarker.fID);
+ if (currMarker.fID != -1) {
+ marker_string.append("(");
+ marker_string.appendS32(currMarker.fID);
+ }
prevMarkerName = currCmd;
} else if (currMarker.fID != prevMarkerID) {
marker_string.append(", ");
@@ -71,7 +88,7 @@ SkString GrTraceMarkerSet::toString() const {
prevMarkerID = currMarker.fID;
++counter;
}
- if (counter > 0) {
+ if (counter > 0 && prevMarkerID != -1) {
marker_string.append(")");
}
return marker_string;
« no previous file with comments | « src/gpu/GrTraceMarker.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698