diff -Nru openbox-3.5.0/debian/changelog openbox-3.5.0/debian/changelog --- openbox-3.5.0/debian/changelog 2013-03-27 13:53:21.000000000 +0000 +++ openbox-3.5.0/debian/changelog 2014-04-20 12:49:07.000000000 +0000 @@ -1,3 +1,10 @@ +openbox (3.5.0-7+rpi1) wheezy-staging; urgency=low + + * Apply patch by Derek foreman to Cache results of offset/shift functions + so we don't do 6 function calls per pixel when reducing color depth + + -- Peter Michael Green Sun, 20 Apr 2014 12:48:35 +0000 + openbox (3.5.0-7) unstable; urgency=low * QA upload. diff -Nru openbox-3.5.0/debian/patches/cache-offset-shift.patch openbox-3.5.0/debian/patches/cache-offset-shift.patch --- openbox-3.5.0/debian/patches/cache-offset-shift.patch 1970-01-01 00:00:00.000000000 +0000 +++ openbox-3.5.0/debian/patches/cache-offset-shift.patch 2014-04-20 12:48:15.000000000 +0000 @@ -0,0 +1,94 @@ +commit 3e1d00b105e45a0351b89766213690c5c2a11390 +Author: Derek Foreman +Date: Thu Apr 10 15:28:39 2014 -0500 + + Cache results of offset/shift functions so we don't do 6 function calls per pixel when reducing color depth + +Index: openbox-3.5.0/obrender/color.c +=================================================================== +--- openbox-3.5.0.orig/obrender/color.c 2011-08-01 20:14:58.000000000 +0000 ++++ openbox-3.5.0/obrender/color.c 2014-04-20 12:47:58.000000000 +0000 +@@ -121,22 +121,26 @@ + { + gint r, g, b; + gint x,y; ++ gint ro = RrRedOffset(inst); ++ gint bo = RrBlueOffset(inst); ++ gint go = RrGreenOffset(inst); ++ gint rs = RrRedShift(inst); ++ gint bs = RrBlueShift(inst); ++ gint gs = RrGreenShift(inst); + RrPixel32 *p32 = (RrPixel32 *) im->data; + RrPixel16 *p16 = (RrPixel16 *) im->data; + RrPixel8 *p8 = (RrPixel8 *) im->data; + switch (im->bits_per_pixel) { + case 32: +- if ((RrRedOffset(inst) != RrDefaultRedOffset) || +- (RrBlueOffset(inst) != RrDefaultBlueOffset) || +- (RrGreenOffset(inst) != RrDefaultGreenOffset)) { ++ if ((ro != RrDefaultRedOffset) || ++ (bo != RrDefaultBlueOffset) || ++ (go != RrDefaultGreenOffset)) { + for (y = 0; y < im->height; y++) { + for (x = 0; x < im->width; x++) { + r = (data[x] >> RrDefaultRedOffset) & 0xFF; + g = (data[x] >> RrDefaultGreenOffset) & 0xFF; + b = (data[x] >> RrDefaultBlueOffset) & 0xFF; +- p32[x] = (r << RrRedOffset(inst)) +- + (g << RrGreenOffset(inst)) +- + (b << RrBlueOffset(inst)); ++ p32[x] = (r << ro) + (g << go) + (b << bo); + } + data += im->width; + p32 += im->width; +@@ -147,9 +151,9 @@ + { + /* reverse the ordering, shifting left 16bit should be the first byte + out of three, etc */ +- const guint roff = (16 - RrRedOffset(inst)) / 8; +- const guint goff = (16 - RrGreenOffset(inst)) / 8; +- const guint boff = (16 - RrBlueOffset(inst)) / 8; ++ const guint roff = (16 - ro) / 8; ++ const guint goff = (16 - go) / 8; ++ const guint boff = (16 - bo) / 8; + gint outx; + for (y = 0; y < im->height; y++) { + for (x = 0, outx = 0; x < im->width; x++, outx += 3) { +@@ -169,14 +173,12 @@ + for (y = 0; y < im->height; y++) { + for (x = 0; x < im->width; x++) { + r = (data[x] >> RrDefaultRedOffset) & 0xFF; +- r = r >> RrRedShift(inst); ++ r = r >> rs; + g = (data[x] >> RrDefaultGreenOffset) & 0xFF; +- g = g >> RrGreenShift(inst); ++ g = g >> gs; + b = (data[x] >> RrDefaultBlueOffset) & 0xFF; +- b = b >> RrBlueShift(inst); +- p16[x] = (r << RrRedOffset(inst)) +- + (g << RrGreenOffset(inst)) +- + (b << RrBlueOffset(inst)); ++ b = b >> bs; ++ p16[x] = (r << ro) + (g << go) + (b << bo); + } + data += im->width; + p16 += im->bytes_per_line/2; +@@ -187,14 +189,12 @@ + for (y = 0; y < im->height; y++) { + for (x = 0; x < im->width; x++) { + r = (data[x] >> RrDefaultRedOffset) & 0xFF; +- r = r >> RrRedShift(inst); ++ r = r >> rs; + g = (data[x] >> RrDefaultGreenOffset) & 0xFF; +- g = g >> RrGreenShift(inst); ++ g = g >> gs; + b = (data[x] >> RrDefaultBlueOffset) & 0xFF; +- b = b >> RrBlueShift(inst); +- p8[x] = (r << RrRedOffset(inst)) +- + (g << RrGreenOffset(inst)) +- + (b << RrBlueOffset(inst)); ++ b = b >> bs; ++ p8[x] = (r << ro) + (g << go) + (b << bo); + } + data += im->width; + p8 += im->bytes_per_line; diff -Nru openbox-3.5.0/debian/patches/series openbox-3.5.0/debian/patches/series --- openbox-3.5.0/debian/patches/series 2013-03-27 13:53:20.000000000 +0000 +++ openbox-3.5.0/debian/patches/series 2014-04-20 12:46:49.000000000 +0000 @@ -9,3 +9,4 @@ 666676_wrong_undecorated_window_placement.patch clever-rectangle-picking.patch use-nearest-monitor.patch +cache-offset-shift.patch