         let region = MTLRegionMake2D(0, 0, Int(image.size.width), Int(image.size.height))
         texture.replace(region: region, mipmapLevel: 0, slice: 0, withBytes: image.bitmapData!, bytesPerRow: image.bytesPerRow, bytesPerImage: image.bytesPerRow * Int(image.size.height))
 
-//        var rect = NSMakeRect(0, 0, image.size.width, image.size.height)
-//        let cgImage = image.cgImage(forProposedRect: &rect, context: nil, hints: nil)!
-//        let loader = MTKTextureLoader(device: device)
-//        let texture = try! loader.newTexture(with:cgImage, options: nil)
-        
         return texture
     }
 

        a.isBlendingEnabled = true
        a.rgbBlendOperation = .add
        a.alphaBlendOperation = .add
        a.sourceRGBBlendFactor = .destinationAlpha
        a.sourceAlphaBlendFactor = .destinationAlpha
        a.destinationRGBBlendFactor = .oneMinusSourceColor
        a.destinationAlphaBlendFactor = .oneMinusSourceAlpha
        pipelineState = try! device.makeRenderPipelineState(descriptor: pipelineStateDescriptor)

        commandQueue = device.makeCommandQueue()

        color.set()
        path.fill()
        
        NSGraphicsContext.restoreGraphicsState()

        return imageRep
    }
    
    func createTextureForBitmapImageRep(_ image: NSBitmapImageRep) -> MTLTexture
