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

Unified Diff: src/gpu/vk/GrVkResource.h

Issue 2167453003: Add GrVkRecycledResource subclass (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: pass gpu into recycle function Created 4 years, 5 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
« src/gpu/vk/GrVkCommandBuffer.cpp ('K') | « src/gpu/vk/GrVkCommandBuffer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkResource.h
diff --git a/src/gpu/vk/GrVkResource.h b/src/gpu/vk/GrVkResource.h
index 83e82fb5b1ac908f7e564c1ff6421946e759eb0e..5772cb4974f865f40071fa13d479b8fbb93ec22b 100644
--- a/src/gpu/vk/GrVkResource.h
+++ b/src/gpu/vk/GrVkResource.h
@@ -191,5 +191,17 @@ private:
typedef SkNoncopyable INHERITED;
};
+// This subclass allows for recycling
+class GrVkRecycledResource : public GrVkResource {
+public:
+ void recycle(GrVkGpu* gpu) const {
+ if (this->unique()) {
+ this->onRecycle(gpu);
jvanverth1 2016/07/20 14:08:47 Why not put the unref in here?
egdaniel 2016/07/20 14:48:39 Done.
+ }
+ }
+
+private:
+ virtual void onRecycle(GrVkGpu* gpu) const = 0;
+};
#endif
« src/gpu/vk/GrVkCommandBuffer.cpp ('K') | « src/gpu/vk/GrVkCommandBuffer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698