Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/lib/engines/software_x11
Modified Files:
evas_engine.h evas_outbuf.c evas_x_buffer.c
Log Message:
fix bit order for ppc - cleanly.
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/software_x11/evas_engine.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- evas_engine.h 22 May 2005 02:49:49 -0000 1.5
+++ evas_engine.h 26 Aug 2005 04:16:57 -0000 1.6
@@ -41,16 +41,17 @@
struct {
Convert_Pal *pal;
struct {
- Display *disp;
- Window win;
- Pixmap mask;
- Visual *vis;
- Colormap cmap;
- int depth;
- int shm;
- GC gc;
- GC gcm;
- int swap : 1;
+ Display *disp;
+ Window win;
+ Pixmap mask;
+ Visual *vis;
+ Colormap cmap;
+ int depth;
+ int shm;
+ GC gc;
+ GC gcm;
+ unsigned char swap : 1;
+ unsigned char bit_swap : 1;
} x;
struct {
DATA32 r, g, b;
@@ -112,7 +113,7 @@
/****/
void evas_software_x11_x_init (void);
-void evas_software_x11_x_write_mask_line
(X_Output_Buffer *xob, DATA32 *src, int w, int y);
+void evas_software_x11_x_write_mask_line (Outbuf *buf,
X_Output_Buffer *xob, DATA32 *src, int w, int y);
int evas_software_x11_x_can_do_shm (Display *d);
X_Output_Buffer *evas_software_x11_x_output_buffer_new (Display *d,
Visual *v, int depth, int w, int h, int try_shm, void *data);
void evas_software_x11_x_output_buffer_free
(X_Output_Buffer *xob, int sync);
@@ -120,6 +121,7 @@
DATA8 *evas_software_x11_x_output_buffer_data
(X_Output_Buffer *xob, int *bytes_per_line_ret);
int evas_software_x11_x_output_buffer_depth
(X_Output_Buffer *xob);
int evas_software_x11_x_output_buffer_byte_order
(X_Output_Buffer *xob);
+int evas_software_x11_x_output_buffer_bit_order
(X_Output_Buffer *xob);
void evas_software_x11_x_color_init (void);
Convert_Pal *evas_software_x11_x_color_allocate (Display
*disp, Colormap cmap, Visual *vis, Convert_Pal_Mode colors);
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/software_x11/evas_outbuf.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- evas_outbuf.c 22 May 2005 03:02:15 -0000 1.7
+++ evas_outbuf.c 26 Aug 2005 04:16:57 -0000 1.8
@@ -72,9 +72,13 @@
#ifdef WORDS_BIGENDIAN
if (evas_software_x11_x_output_buffer_byte_order(xob) == LSBFirst)
buf->priv.x.swap = 1;
+ if (evas_software_x11_x_output_buffer_bit_order(xob) == MSBFirst)
+ buf->priv.x.bit_swap = 1;
#else
if (evas_software_x11_x_output_buffer_byte_order(xob) == MSBFirst)
buf->priv.x.swap = 1;
+ if (evas_software_x11_x_output_buffer_bit_order(xob) == MSBFirst)
+ buf->priv.x.bit_swap = 1;
#endif
if ((vis->class == TrueColor) || (vis->class == DirectColor))
{
@@ -446,7 +450,7 @@
if (obr->mxob)
{
for (yy = 0; yy < obr->h; yy++)
- evas_software_x11_x_write_mask_line(obr->mxob,
+ evas_software_x11_x_write_mask_line(buf, obr->mxob,
src_data +
(yy * obr->w), obr->w, yy);
}
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/software_x11/evas_x_buffer.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- evas_x_buffer.c 22 May 2005 02:49:49 -0000 1.4
+++ evas_x_buffer.c 26 Aug 2005 04:16:57 -0000 1.5
@@ -4,7 +4,7 @@
static int _x_err = 0;
void
-evas_software_x11_x_write_mask_line(X_Output_Buffer *xob, DATA32 *src, int w,
int y)
+evas_software_x11_x_write_mask_line(Outbuf *buf, X_Output_Buffer *xob, DATA32
*src, int w, int y)
{
int x;
DATA32 *src_ptr;
@@ -14,19 +14,39 @@
src_ptr = src;
dst_ptr = evas_software_x11_x_output_buffer_data(xob, &bpl);
dst_ptr = dst_ptr + (bpl * y);
- for (x = 0; x < w; x += 8)
+ if (buf->priv.x.bit_swap)
{
- *dst_ptr =
- ((A_VAL(&(src_ptr[0])) >> 7) << 0) |
- ((A_VAL(&(src_ptr[1])) >> 7) << 1) |
- ((A_VAL(&(src_ptr[2])) >> 7) << 2) |
- ((A_VAL(&(src_ptr[3])) >> 7) << 3) |
- ((A_VAL(&(src_ptr[4])) >> 7) << 4) |
- ((A_VAL(&(src_ptr[5])) >> 7) << 5) |
- ((A_VAL(&(src_ptr[6])) >> 7) << 6) |
- ((A_VAL(&(src_ptr[7])) >> 7) << 7);
- src_ptr += 8;
- dst_ptr++;
+ for (x = 0; x < w; x += 8)
+ {
+ *dst_ptr =
+ ((A_VAL(&(src_ptr[0])) >> 7) << 7) |
+ ((A_VAL(&(src_ptr[1])) >> 7) << 6) |
+ ((A_VAL(&(src_ptr[2])) >> 7) << 5) |
+ ((A_VAL(&(src_ptr[3])) >> 7) << 4) |
+ ((A_VAL(&(src_ptr[4])) >> 7) << 3) |
+ ((A_VAL(&(src_ptr[5])) >> 7) << 2) |
+ ((A_VAL(&(src_ptr[6])) >> 7) << 1) |
+ ((A_VAL(&(src_ptr[7])) >> 7) << 0);
+ src_ptr += 8;
+ dst_ptr++;
+ }
+ }
+ else
+ {
+ for (x = 0; x < w; x += 8)
+ {
+ *dst_ptr =
+ ((A_VAL(&(src_ptr[0])) >> 7) << 0) |
+ ((A_VAL(&(src_ptr[1])) >> 7) << 1) |
+ ((A_VAL(&(src_ptr[2])) >> 7) << 2) |
+ ((A_VAL(&(src_ptr[3])) >> 7) << 3) |
+ ((A_VAL(&(src_ptr[4])) >> 7) << 4) |
+ ((A_VAL(&(src_ptr[5])) >> 7) << 5) |
+ ((A_VAL(&(src_ptr[6])) >> 7) << 6) |
+ ((A_VAL(&(src_ptr[7])) >> 7) << 7);
+ src_ptr += 8;
+ dst_ptr++;
+ }
}
for (; x < w; x ++)
{
@@ -192,3 +212,9 @@
{
return xob->xim->byte_order;
}
+
+int
+evas_software_x11_x_output_buffer_bit_order(X_Output_Buffer *xob)
+{
+ return xob->xim->bitmap_bit_order;
+}
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs