From 19ae138901ce0601c11dcef0587336fb480ed017 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Mon, 9 Jan 2017 10:14:34 -0500 Subject: [PATCH] Remove unused unique ID from GrProgramElement Change-Id: I27140b378ad665c40f6edced1a655150ebd4842c Reviewed-on: https://skia-review.googlesource.com/6800 Reviewed-by: Robert Phillips Commit-Queue: Brian Salomon --- include/gpu/GrProgramElement.h | 10 +--------- src/gpu/GrProgramElement.cpp | 9 --------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/include/gpu/GrProgramElement.h b/include/gpu/GrProgramElement.h index ce09762693..e0d86082d1 100644 --- a/include/gpu/GrProgramElement.h +++ b/include/gpu/GrProgramElement.h @@ -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; diff --git a/src/gpu/GrProgramElement.cpp b/src/gpu/GrProgramElement.cpp index f1f3f41343..82bb7217bf 100644 --- a/src/gpu/GrProgramElement.cpp +++ b/src/gpu/GrProgramElement.cpp @@ -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(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();