Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Unified Diff: src/gpu/GrProgramElement.cpp

Issue 546043002: Don't take a ref on GP in AutoEffectRestore. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comment Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrDrawState.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrProgramElement.cpp
diff --git a/src/gpu/GrProgramElement.cpp b/src/gpu/GrProgramElement.cpp
index 70d5339e902e81a5baf5d8a84dd1af96824dc507..20a957f7c7ca9c3eea14da883c50bb1416d195ab 100644
--- a/src/gpu/GrProgramElement.cpp
+++ b/src/gpu/GrProgramElement.cpp
@@ -8,6 +8,15 @@
#include "GrProgramElement.h"
#include "GrProgramResource.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::convertRefToPendingExecution() const {
// This function makes it so that all the GrProgramResources own a single ref to their
// underlying GrGpuResource if there are any refs to the GrProgramElement and a single
« no previous file with comments | « src/gpu/GrDrawState.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698