 ! See http://factorcode.org/license.txt for BSD license.
 USING: cairo cairo.ffi ui.render kernel opengl.gl opengl
 math byte-arrays ui.gadgets accessors arrays 
-namespaces io.backend memoize ;
+namespaces io.backend memoize colors ;
 
 IN: cairo.gadgets
 

    GL_TEXTURE_2D [
        [
            dup render-to-texture
            GL_TEXTURE_2D over texture>> glBindTexture
            GL_QUADS [
                [ width>> ] [ height>> ] bi 2array four-sides

    gen-texture >>texture drop ;

M: cached-cairo ungraft* ( gadget -- )
    [ texture>> delete-texture ]
    [ \ render-to-texture invalidate-memoized ] bi ;
    
M: cairo-gadget pref-dim* ( gadget -- rect )
    [ width>> ] [ height>> ] bi 2array ;
