-! Copyright (C) 2008 Slava Pestov.
+! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors colors arrays kernel sequences math byte-arrays
 namespaces grouping fry cap graphics.bitmap
 ui.gadgets ui.gadgets.packs ui.gadgets.borders ui.gadgets.grids
 ui.gadgets.grid-lines ui.gadgets.labels ui.gadgets.buttons
-ui.render ui opengl opengl.gl ;
+ui.render ui opengl opengl.gl colors.constants ;
 IN: ui.render.test
 
 SINGLETON: line-test


: bitmap= ( bitmap1 bitmap2 -- ? )
    [
        [ [ array>> ] [ stride 4 align ] bi group ] [ stride ] bi
        '[ _ head twiddle ] map
    ] bi@ = ;

: check-rendering ( gadget -- )

    <shelf>
        take-screenshot new >>boundary
        <gadget>
            COLOR: black <solid> >>interior
            { 98 98 } >>dim
        { 1 1 } <border> add-gadget
        <gadget>
            COLOR: gray <solid> >>boundary
            { 94 94 } >>dim
        { 3 3 } <border>
            COLOR: red <solid> >>boundary
        add-gadget
            <line-gadget> <line-gadget> <line-gadget> 3array
            <line-gadget> <line-gadget> <line-gadget> 3array
            <line-gadget> <line-gadget> <line-gadget> 3array
        3array <grid>
            { 5 5 } >>gap
            COLOR: blue <grid-lines> >>boundary
        add-gadget
        <gadget>
            { 14 14 } >>dim
            COLOR: black <checkmark-paint> >>interior
            COLOR: black <solid> >>boundary
        { 4 4 } <border>
        add-gadget ;
    
