Index: src/gpu/GrTraceMarker.h |
diff --git a/src/gpu/GrTraceMarker.h b/src/gpu/GrTraceMarker.h |
index 7cc2f7f9552012b6e9db71ce9c3cb4737826d58e..fa4904e0c9c270aa21cb80f69c0b2d92ae6ff667 100644 |
--- a/src/gpu/GrTraceMarker.h |
+++ b/src/gpu/GrTraceMarker.h |
@@ -65,4 +65,34 @@ private: |
mutable SkTDArray<GrGpuTraceMarker> fMarkerArray; |
}; |
+class GrTraceMarkerSet::Iter { |
+public: |
+ Iter() {}; |
+ Iter& operator=(const Iter& i) { |
+ fCurrentIndex = i.fCurrentIndex; |
+ fMarkers = i.fMarkers; |
+ return *this; |
+ } |
+ bool operator==(const Iter& i) const { |
+ return fCurrentIndex == i.fCurrentIndex && fMarkers == i.fMarkers; |
+ } |
+ bool operator!=(const Iter& i) const { return !(*this == i); } |
+ const GrGpuTraceMarker& operator*() const { return fMarkers->fMarkerArray[fCurrentIndex]; } |
+ Iter& operator++() { |
+ SkASSERT(*this != fMarkers->end()); |
+ ++fCurrentIndex; |
+ return *this; |
+ } |
+ |
+private: |
+ friend class GrTraceMarkerSet; |
+ Iter(const GrTraceMarkerSet* markers, int index) |
+ : fMarkers(markers), fCurrentIndex(index) { |
+ SkASSERT(markers); |
+ } |
+ |
+ const GrTraceMarkerSet* fMarkers; |
+ int fCurrentIndex; |
+}; |
+ |
#endif |