text: /* CoreAnimation - CAMetalLayer.h
  
     Copyright (c) 2013-2015, Apple Inc.
     All rights reserved. */
  
  #import <QuartzCore/CALayer.h>
  #import <Metal/MTLPixelFormat.h>
  #import <Metal/MTLDrawable.h>
  
  @protocol MTLDevice;
  @protocol MTLTexture;
  @protocol MTLDrawable;
  
  @class CAMetalLayer;
  
  /* CAMetalDrawable represents a displayable buffer that vends an object
   * that conforms to the MTLTexture protocol that may be used to create
   * a render target for Metal.
   *
   * Note: CAMetalLayer maintains an internal pool of textures used for
   * display. In order for a texture to be re-used for a new CAMetalDrawable,
   * any prior CAMetalDrawable must have been deallocated and another
   * CAMetalDrawable presented. */
  
  @protocol CAMetalDrawable <MTLDrawable>
  
  /* This is an object that conforms to the MTLTexture protocol and will
   * typically be used to create an MTLRenderTargetDescriptor. */
  
  @property (readonly) id <MTLTexture> texture;
  
  /* This is the CAMetalLayer responsible for displaying the drawable */
  
  @property (readonly) CAMetalLayer *layer;
  
  @end
  
  /* Note: The default value of the `opaque' property for CAMetalLayer
   * instances is true. */
  
  NS_CLASS_AVAILABLE_IOS (8_0)
  @interface CAMetalLayer : CALayer
  {
  @private
    struct _CAMetalLayerPrivate *_priv;
  }
  
  /* This property determines which MTLDevice the MTLTexture objects for
   * the drawables will be created from. */
  
  @property (readwrite, retain) id <MTLDevice> device;
  
  /* This property controls the pixel format of the MTLTexture objects.
   * The two supported values are MTLPixelFormatBGRA8Unorm and
   * MTLPixelFormatBGRA8Unorm_sRGB. */
  
  @property (readwrite) MTLPixelFormat pixelFormat;
  
  /* This property controls whether or not the returned drawables'
   * MTLTextures may only be used for framebuffer attachments (YES) or
   * whether they may also be used for texture sampling and pixel
   * read/write operations (NO). A value of YES allows CAMetalLayer to
   * allocate the MTLTexture objects in ways that are optimized for display
   * purposes that makes them unsuitable for sampling. The recommended
   * value for most applications is YES. */
  
  @property (readwrite) BOOL framebufferOnly;
  
  /* This property controls the pixel dimensions of the returned drawable
   * objects. The most typical value will be the layer size multiplied by
   * the layer contentsScale property. */
  
  @property (readwrite) CGSize drawableSize;
  
  /* Returns a drawable. This will return nil if the layer has an invalid
   * combination of drawable properties. */
  
  - (id <CAMetalDrawable>)nextDrawable;
  
  /* Returns a new drawable. This will fail if the layer if the drawable
   * properties are nil.
   * Deprecated in favor of -nextDrawable. */
  
  - (id <CAMetalDrawable>)newDrawable;
  
  /* When false (the default value) changes to the layer's render buffer
   * appear on-screen asynchronously to normal layer updates. When true,
   * changes to the MTL content are sent to the screen via the standard
   * CATransaction mechanisms. */
  
  @property(getter=presentsWithTransaction) BOOL presentsWithTransaction;
  
  @end
  