src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTexturePool.h
branchmetal-prototype-branch
changeset 57416 e153174dba06
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTexturePool.h	Fri Jun 21 12:08:37 2019 +0530
@@ -0,0 +1,37 @@
+#ifndef MTLTexturePool_h_Included
+#define MTLTexturePool_h_Included
+#import <Metal/Metal.h>
+
+@interface MTLTexturePoolItem : NSObject
+{
+@private
+
+id<MTLTexture> texture;
+bool isBusy;
+}
+
+@property (readwrite, retain) id<MTLTexture> texture;
+@property (readwrite, assign) bool isBusy;
+
+- (id) initWithTexture:(id<MTLTexture>)tex;
+@end
+
+// NOTE: owns all MTLTexture objects
+@interface MTLTexturePool : NSObject
+{
+@private
+
+id<MTLDevice> device;
+NSMutableArray<MTLTexturePoolItem*> * pool;
+}
+
+@property (readwrite, assign) id<MTLDevice> device;
+@property (readwrite, retain) NSMutableArray<MTLTexturePoolItem*> * pool;
+
+- (id) initWithDevice:(id<MTLDevice>)device;
+- (id<MTLTexture>) getTexture:(int)width height:(int)height format:(MTLPixelFormat)format;
+- (void) markTextureFree:(id<MTLTexture>)texture;
+- (void) markAllTexturesFree;
+@end
+
+#endif /* MTLTexturePool_h_Included */