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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | src/gpu/GrTraceMarker.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2 /*
3 * Copyright 2014 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9 #include "SkTDArray.h"
10
11 #ifndef GrTraceMarkerSet_DEFINED
12 #define GrTraceMarkerSet_DEFINED
13
14 class GrGpuTraceMarker {
15 public:
16 GrGpuTraceMarker() {};
17 GrGpuTraceMarker(const char* marker, int idCounter) : fMarker(marker), fID(i dCounter) {}
18
19 bool operator<(const GrGpuTraceMarker& rhs) const {
20 return this->fMarker < rhs.fMarker || (this->fMarker == rhs.fMarker && t his->fID < rhs.fID);
21 }
22
23 bool operator==(const GrGpuTraceMarker& rhs) const {
24 return (this->fID == rhs.fID && this->fMarker == rhs.fMarker);
25 }
26
27 const char* fMarker;
28 int fID;
29 };
30
31 ///////////////////////////////////////////////////////////////////////////////
32
33 class SkString;
34
35 class GrTraceMarkerSet {
36 public:
37 GrTraceMarkerSet() {}
38
39 GrTraceMarkerSet(const GrTraceMarkerSet& other);
40
41 // Adds marker to the set.
42 void add(const GrGpuTraceMarker& marker);
43 // Adds all markers from one set into this set.
44 void addSet(const GrTraceMarkerSet& markerSet);
45
46 void remove(const GrGpuTraceMarker& marker);
47
48 int count() const;
49
50 /**
51 * First sorts fMarkerArray and returns a string of the format
52 * MarkerName1(#,#,...)%MarkerName2(#,#,...):... where MarkerName is the
53 * marker string used in the TraceMarker and the (#,#,..) is a list of insta nce
54 * id's for the the given marker string
55 */
56 SkString toString() const;
57
58 class Iter;
59
60 Iter begin() const;
61
62 Iter end() const;
63
64 private:
65 mutable SkTDArray<GrGpuTraceMarker> fMarkerArray;
66 };
67
68 #endif
69
OLDNEW
« 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