Move some GrAuditTrail fuctions to cpp file
authorjoshualitt <joshualitt@chromium.org>
Tue, 1 Mar 2016 15:47:56 +0000 (07:47 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 1 Mar 2016 15:47:56 +0000 (07:47 -0800)
TBR=ethannicholas@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1753753002

Review URL: https://codereview.chromium.org/1753753002

include/private/GrAuditTrail.h
src/gpu/GrAuditTrail.cpp

index 14873cd..dab6fe7 100644 (file)
@@ -79,31 +79,7 @@ public:
         GrAuditTrail* fAuditTrail;
     };
 
-    void addBatch(const char* name, const SkRect& bounds) {
-        SkASSERT(fEnabled);
-        Batch* batch = new Batch;
-        fBatchPool.emplace_back(batch);
-        batch->fName = name;
-        batch->fBounds = bounds;
-        batch->fClientID = kGrAuditTrailInvalidID;
-        batch->fBatchListID = kGrAuditTrailInvalidID;
-        batch->fChildID = kGrAuditTrailInvalidID;
-        fCurrentBatch = batch;
-        
-        if (fClientID != kGrAuditTrailInvalidID) {
-            batch->fClientID = fClientID;
-            Batches** batchesLookup = fClientIDLookup.find(fClientID);
-            Batches* batches = nullptr;
-            if (!batchesLookup) {
-                batches = new Batches;
-                fClientIDLookup.set(fClientID, batches);
-            } else {
-                batches = *batchesLookup;
-            }
-
-            batches->push_back(fCurrentBatch);
-        }
-    }
+    void addBatch(const char* name, const SkRect& bounds);
 
     void batchingResultCombined(GrBatch* combiner);
 
@@ -139,15 +115,7 @@ public:
 
     void getBoundsByClientID(SkTArray<BatchInfo>* outInfo, int clientID);
 
-    void fullReset() {
-        SkASSERT(fEnabled);
-        fBatchList.reset();
-        fIDLookup.reset();
-        // free all client batches
-        fClientIDLookup.foreach([](const int&, Batches** batches) { delete *batches; });
-        fClientIDLookup.reset();
-        fBatchPool.reset(); // must be last, frees all of the memory
-    }
+    void fullReset();
 
     static const int kGrAuditTrailInvalidID;
 
index 6b20876..d463873 100644 (file)
 
 const int GrAuditTrail::kGrAuditTrailInvalidID = -1;
 
+void GrAuditTrail::addBatch(const char* name, const SkRect& bounds) {
+    SkASSERT(fEnabled);
+    Batch* batch = new Batch;
+    fBatchPool.emplace_back(batch);
+    batch->fName = name;
+    batch->fBounds = bounds;
+    batch->fClientID = kGrAuditTrailInvalidID;
+    batch->fBatchListID = kGrAuditTrailInvalidID;
+    batch->fChildID = kGrAuditTrailInvalidID;
+    fCurrentBatch = batch;
+    
+    if (fClientID != kGrAuditTrailInvalidID) {
+        batch->fClientID = fClientID;
+        Batches** batchesLookup = fClientIDLookup.find(fClientID);
+        Batches* batches = nullptr;
+        if (!batchesLookup) {
+            batches = new Batches;
+            fClientIDLookup.set(fClientID, batches);
+        } else {
+            batches = *batchesLookup;
+        }
+
+        batches->push_back(fCurrentBatch);
+    }
+}
+
 void GrAuditTrail::batchingResultCombined(GrBatch* combiner) {
     int* indexPtr = fIDLookup.find(combiner);
     SkASSERT(indexPtr);
@@ -75,6 +101,15 @@ void GrAuditTrail::getBoundsByClientID(SkTArray<BatchInfo>* outInfo, int clientI
     }
 }
 
+void GrAuditTrail::fullReset() {
+    SkASSERT(fEnabled);
+    fBatchList.reset();
+    fIDLookup.reset();
+    // free all client batches
+    fClientIDLookup.foreach([](const int&, Batches** batches) { delete *batches; });
+    fClientIDLookup.reset();
+    fBatchPool.reset(); // must be last, frees all of the memory
+}
 
 template <typename T>
 void GrAuditTrail::JsonifyTArray(SkString* json, const char* name, const T& array,