aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrResourceAllocator.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-07-27 07:18:06 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-27 13:35:22 +0000
commitda1be46e240020674ae392ced3c6bf85e9ecd157 (patch)
treee381cbfdf20ad5b7a62e74610c5565ec32a98df1 /src/gpu/GrResourceAllocator.cpp
parent2739ab0986a6c5e7ae460dfd58539f9aef262d53 (diff)
Add more optional debugging printouts for resource allocation
Change-Id: I84e9d2cc8862d366fab3f9142fee5b8ed981bed7 Reviewed-on: https://skia-review.googlesource.com/143705 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrResourceAllocator.cpp')
-rw-r--r--src/gpu/GrResourceAllocator.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gpu/GrResourceAllocator.cpp b/src/gpu/GrResourceAllocator.cpp
index 199acefe7a..8cc695f4e7 100644
--- a/src/gpu/GrResourceAllocator.cpp
+++ b/src/gpu/GrResourceAllocator.cpp
@@ -18,6 +18,17 @@
#include "GrTextureProxy.h"
#include "GrUninstantiateProxyTracker.h"
+#if GR_TRACK_INTERVAL_CREATION
+uint32_t GrResourceAllocator::Interval::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;
+}
+#endif
+
void GrResourceAllocator::Interval::assign(sk_sp<GrSurface> s) {
SkASSERT(!fAssignedSurface);
fAssignedSurface = s;