Remove unused unique ID from GrProgramElement
authorBrian Salomon <bsalomon@google.com>
Mon, 9 Jan 2017 15:14:34 +0000 (10:14 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Mon, 9 Jan 2017 19:32:20 +0000 (19:32 +0000)
Change-Id: I27140b378ad665c40f6edced1a655150ebd4842c
Reviewed-on: https://skia-review.googlesource.com/6800
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

include/gpu/GrProgramElement.h
src/gpu/GrProgramElement.cpp

index ce09762..e0d8608 100644 (file)
@@ -73,11 +73,6 @@ public:
         this->validate();
     }
 
-    /**
-     * Gets an id that is unique for this GrProgramElement object. This will never return 0.
-     */
-    uint32_t getUniqueID() const { return fUniqueID; }
-
     void validate() const {
 #ifdef SK_DEBUG
         SkASSERT(fRefCnt >= 0);
@@ -87,7 +82,7 @@ public:
     }
 
 protected:
-    GrProgramElement() : fRefCnt(1), fPendingExecutions(0), fUniqueID(CreateUniqueID()) {}
+    GrProgramElement() : fRefCnt(1), fPendingExecutions(0) {}
 
     /** Subclasses registers their resources using this function. It is assumed the GrProgramResouce
         is and will remain owned by the subclass and this function will retain a raw ptr. Once a
@@ -126,8 +121,6 @@ private:
         executions. */
     virtual void notifyRefCntIsZero() const = 0;
 
-    static uint32_t CreateUniqueID();
-
     void removeRefs() const;
     void addPendingIOs() const;
     void pendingIOComplete() const;
@@ -135,7 +128,6 @@ private:
     mutable int32_t fRefCnt;
     // Count of deferred executions not yet issued to the 3D API.
     mutable int32_t fPendingExecutions;
-    uint32_t        fUniqueID;
 
     SkSTArray<4, const GrGpuResourceRef*, true> fGpuResources;
 
index f1f3f41..82bb721 100644 (file)
@@ -9,15 +9,6 @@
 #include "GrGpuResourceRef.h"
 #include "SkAtomics.h"
 
-uint32_t GrProgramElement::CreateUniqueID() {
-    static int32_t gUniqueID = SK_InvalidUniqueID;
-    uint32_t id;
-    do {
-        id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1);
-    } while (id == SK_InvalidUniqueID);
-    return id;
-}
-
 void GrProgramElement::addPendingIOs() const {
     for (int i = 0; i < fGpuResources.count(); ++i) {
         fGpuResources[i]->markPendingIO();