]> gitweb.factorcode.org Git - factor.git/commitdiff
ui.render: set pack alignment to 1, so padding images isn't needed anymore
authorPhilipp Brüschweiler <blei42@gmail.com>
Tue, 1 Jun 2010 11:52:00 +0000 (13:52 +0200)
committerPhilipp Brüschweiler <blei42@gmail.com>
Tue, 1 Jun 2010 11:52:00 +0000 (13:52 +0200)
basis/images/png/png.factor
basis/ui/render/render.factor

index d4a9c4ab563a57b37ce0c12242d0b5b3f755ea5e..0b46fdf653aaefbc3197ba45ecbbdc0297be57f4 100644 (file)
@@ -290,14 +290,6 @@ ERROR: invalid-color-type/bit-depth loading-png ;
 : validate-truecolor-alpha ( loading-png -- loading-png )
     { 8 16 } validate-bit-depth ;
 
-: pad-bitmap ( image -- image )
-    dup dim>> second 4 divisor? [
-        dup [ bytes-per-pixel ]
-        [ dim>> first * ]
-        [ dim>> first 4 mod ] tri
-        '[ _ group [ _ 0 <array> append ] map B{ } concat-as ] change-bitmap
-    ] unless ;
-
 : loading-png>bitmap ( loading-png -- bytes component-order )
     dup color-type>> {
         { greyscale [
@@ -323,7 +315,7 @@ ERROR: invalid-color-type/bit-depth loading-png ;
         [ loading-png>bitmap [ >>bitmap ] [ >>component-order ] bi* ]
         [ [ width>> ] [ height>> ] bi 2array >>dim ]
         [ png-component >>component-type ]
-    } cleave pad-bitmap ;
+    } cleave ;
 
 : load-png ( stream -- loading-png )
     [
index 8ce90742258768bab3a321969611561cab977b36..84edbc35c36426bdb34f63be5ef5c9fd6fb0b1d1 100644 (file)
@@ -35,6 +35,8 @@ SLOT: background-color
     GL_BLEND glEnable
     GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA glBlendFunc
     GL_VERTEX_ARRAY glEnableClientState
+    GL_PACK_ALIGNMENT 1 glPixelStorei
+    GL_UNPACK_ALIGNMENT 1 glPixelStorei
     init-matrices
     [ init-clip ]
     [