Gitweb links:

...log 
http://git.netsurf-browser.org/libnsfb.git/shortlog/f23427a39e21b1b613a5582181d8067b54aa645b
...commit 
http://git.netsurf-browser.org/libnsfb.git/commit/f23427a39e21b1b613a5582181d8067b54aa645b
...tree 
http://git.netsurf-browser.org/libnsfb.git/tree/f23427a39e21b1b613a5582181d8067b54aa645b

The branch, master has been updated
       via  f23427a39e21b1b613a5582181d8067b54aa645b (commit)
      from  ffc7d20558295fea7a9d48352087822575968a0f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/libnsfb.git/commit/?id=f23427a39e21b1b613a5582181d8067b54aa645b
commit f23427a39e21b1b613a5582181d8067b54aa645b
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    32bpp-xrgb8888: Optimise pixel/colour conversion.
    
    This saves an `&` in the source, but also the compiler spots that
    `(c >> 16) | (c << 16)` is a rotation.
    
    Thanks to Adrian Lees.

diff --git a/src/plot/32bpp-xrgb8888.c b/src/plot/32bpp-xrgb8888.c
index 6f77f44..28e6673 100644
--- a/src/plot/32bpp-xrgb8888.c
+++ b/src/plot/32bpp-xrgb8888.c
@@ -66,9 +66,7 @@ static inline uint32_t colour_to_pixel(UNUSED nsfb_t *nsfb, 
nsfb_colour_t c)
  */
 static inline nsfb_colour_t pixel_to_colour(UNUSED nsfb_t *nsfb, uint32_t 
pixel)
 {
-        return ((pixel & 0xFF) << 16) |
-                ((pixel & 0xFF00)) |
-                ((pixel & 0xFF0000) >> 16);
+        return (((pixel >> 16) | (pixel << 16)) & 0xff00ff) | (pixel & 0xff00);
 }
 
 
@@ -81,7 +79,7 @@ static inline nsfb_colour_t pixel_to_colour(UNUSED nsfb_t 
*nsfb, uint32_t pixel)
  */
 static inline uint32_t colour_to_pixel(UNUSED nsfb_t *nsfb, nsfb_colour_t c)
 {
-        return ((c & 0xff0000) >> 16) | (c & 0xff00) | ((c & 0xff) << 16);
+        return (((c >> 16) | (c << 16)) & 0xff00ff) | (c & 0xff00);
 }
 
 #endif


-----------------------------------------------------------------------

Summary of changes:
 src/plot/32bpp-xrgb8888.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/plot/32bpp-xrgb8888.c b/src/plot/32bpp-xrgb8888.c
index 6f77f44..28e6673 100644
--- a/src/plot/32bpp-xrgb8888.c
+++ b/src/plot/32bpp-xrgb8888.c
@@ -66,9 +66,7 @@ static inline uint32_t colour_to_pixel(UNUSED nsfb_t *nsfb, 
nsfb_colour_t c)
  */
 static inline nsfb_colour_t pixel_to_colour(UNUSED nsfb_t *nsfb, uint32_t 
pixel)
 {
-        return ((pixel & 0xFF) << 16) |
-                ((pixel & 0xFF00)) |
-                ((pixel & 0xFF0000) >> 16);
+        return (((pixel >> 16) | (pixel << 16)) & 0xff00ff) | (pixel & 0xff00);
 }
 
 
@@ -81,7 +79,7 @@ static inline nsfb_colour_t pixel_to_colour(UNUSED nsfb_t 
*nsfb, uint32_t pixel)
  */
 static inline uint32_t colour_to_pixel(UNUSED nsfb_t *nsfb, nsfb_colour_t c)
 {
-        return ((c & 0xff0000) >> 16) | (c & 0xff00) | ((c & 0xff) << 16);
+        return (((c >> 16) | (c << 16)) & 0xff00ff) | (c & 0xff00);
 }
 
 #endif


-- 
NetSurf Framebuffer library

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to