aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrResourceAllocator.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-11-08 13:34:43 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-08 19:06:17 +0000
commitf290376736b42a19b87da78c6ba2558313896860 (patch)
tree664ff0fb2802069f4373238a6127b287cc3db8a6 /src/gpu/GrResourceAllocator.h
parent47ba5cd0974273192c83cc27addb9ae1880c1d6d (diff)
Prepare to enable explicit gpu resource allocation
Change-Id: I407e45711c61831febbac3d3d3a88e3fdde92c5f Reviewed-on: https://skia-review.googlesource.com/68212 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrResourceAllocator.h')
-rw-r--r--src/gpu/GrResourceAllocator.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gpu/GrResourceAllocator.h b/src/gpu/GrResourceAllocator.h
index 3be4836ca9..d7aed0591e 100644
--- a/src/gpu/GrResourceAllocator.h
+++ b/src/gpu/GrResourceAllocator.h
@@ -54,7 +54,6 @@ public:
}
void assign();
- SkDEBUGCODE(void dump();)
private:
class Interval;
@@ -72,6 +71,7 @@ private:
}
static uint32_t Hash(const GrScratchKey& key) { return key.hash(); }
+ static void OnFree(GrSurface* s) { s->unref(); }
};
typedef SkTMultiMap<GrSurface, GrScratchKey, FreePoolTraits> FreePoolMultiMap;
@@ -98,12 +98,27 @@ private:
fNext = nullptr;
}
+ const GrSurfaceProxy* proxy() const { return fProxy; }
+ GrSurfaceProxy* proxy() { return fProxy; }
+ unsigned int start() const { return fStart; }
+ unsigned int end() const { return fEnd; }
+ const Interval* next() const { return fNext; }
+ Interval* next() { return fNext; }
+
+ void setNext(Interval* next) { fNext = next; }
+
+ void extendEnd(unsigned int newEnd) {
+ SkASSERT(newEnd >= fEnd);
+ fEnd = newEnd;
+ }
+
// for SkTDynamicHash
static const uint32_t& GetKey(const Interval& intvl) {
return intvl.fProxyID;
}
static uint32_t Hash(const uint32_t& key) { return key; }
+ private:
GrSurfaceProxy* fProxy;
uint32_t fProxyID; // This is here b.c. DynamicHash requires a ref to the key
unsigned int fStart;