             createTexture(for: renderer)
         }
         
-        let context = try! Silica.Context(surface: surface, size: bounds.size)
-        
         // unlock and modify texture
-        texture.withUnsafeMutableBytes { (_, _) in
+        texture.withUnsafeMutableBytes {
+            
+            let surface = try! Cairo.Surface.Image(mutableBytes: $0.assumingMemoryBound(to: UInt8.self), format: .argb32, width: width, height: height, stride: $1)
+            
+            let context = try! Silica.Context(surface: surface, size: bounds.size)
             
             // CoreGraphics drawing
             draw(in: context)
+            
+            /// flush surface
+            surface.flush()
+            surface.finish()
         }
         
         renderer.copy(texture, destination: rect)

        
        // draw rect
        draw(bounds)
        surface.flush()
        
        UIGraphicsPopContext()
    }

    /// Cacao's equivalent of `UIView.layer` / `CALayer`.
    /// Instead of the CoreGraphics API you could draw directly to the texture's pixel data.
    private var texture: Texture!
    
    internal final var shouldRender: Bool { return isHidden == false && alpha > 0 }
    
