Remove unused unique ID from GrProgramElement

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>
This commit is contained in:
Brian Salomon 2017-01-09 10:14:34 -05:00 committed by Skia Commit-Bot
parent 951d4e1520
commit 19ae138901
2 changed files with 1 additions and 18 deletions

View File

@ -73,11 +73,6 @@ public:
this->validate(); 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 { void validate() const {
#ifdef SK_DEBUG #ifdef SK_DEBUG
SkASSERT(fRefCnt >= 0); SkASSERT(fRefCnt >= 0);
@ -87,7 +82,7 @@ public:
} }
protected: 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 /** 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 is and will remain owned by the subclass and this function will retain a raw ptr. Once a
@ -126,8 +121,6 @@ private:
executions. */ executions. */
virtual void notifyRefCntIsZero() const = 0; virtual void notifyRefCntIsZero() const = 0;
static uint32_t CreateUniqueID();
void removeRefs() const; void removeRefs() const;
void addPendingIOs() const; void addPendingIOs() const;
void pendingIOComplete() const; void pendingIOComplete() const;
@ -135,7 +128,6 @@ private:
mutable int32_t fRefCnt; mutable int32_t fRefCnt;
// Count of deferred executions not yet issued to the 3D API. // Count of deferred executions not yet issued to the 3D API.
mutable int32_t fPendingExecutions; mutable int32_t fPendingExecutions;
uint32_t fUniqueID;
SkSTArray<4, const GrGpuResourceRef*, true> fGpuResources; SkSTArray<4, const GrGpuResourceRef*, true> fGpuResources;

View File

@ -9,15 +9,6 @@
#include "GrGpuResourceRef.h" #include "GrGpuResourceRef.h"
#include "SkAtomics.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 { void GrProgramElement::addPendingIOs() const {
for (int i = 0; i < fGpuResources.count(); ++i) { for (int i = 0; i < fGpuResources.count(); ++i) {
fGpuResources[i]->markPendingIO(); fGpuResources[i]->markPendingIO();