Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/modules/engines/software_generic


Modified Files:
        evas_engine.c 


Log Message:


1. evas gets a pipeline with deferred rendering ability (sometimes faster,
sometimes slower)
2. --enable-pthreads will enable multi-threaded rendering (current support is
for up to 4 threads so if you have a new fanled quad core or dual cpu dual
core box or whatever you will in theory be able to max moe of its cpu grunt
with the software rendering engine. this can only be done because i added the
pipelines which means almsot entirely lock-free multithreading internally in
evas. the only locks are for fonts but with a little work i might be able to
remove some/most of those too)

for now pthreaded rendering likely will be linux only (it relies on sched.h
for setting scheduler params to force the slave threads to run on separate
cpu's as linux likes to keep them on the same cpu otherwise and thus we get
no speedups at all - only slowdowns).

aso note that it is a bit of a mixed bag. complex ops (like smooth scaling
with alpha blending) get speedups, but simple ops (like blits/fills) slow down.

this all neds examination and tweaking still - but it's a start.

===================================================================
RCS file: 
/cvs/e/e17/libs/evas/src/modules/engines/software_generic/evas_engine.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- evas_engine.c       30 Sep 2006 10:18:34 -0000      1.8
+++ evas_engine.c       13 Nov 2006 23:23:44 -0000      1.9
@@ -140,15 +140,23 @@
 static void
 eng_rectangle_draw(void *data, void *context, void *surface, int x, int y, int 
w, int h)
 {
+#ifdef BUILD_PTHREAD
+   evas_common_pipe_rectangle_draw(surface, context, x, y, w, h);
+#else
    evas_common_rectangle_draw(surface, context, x, y, w, h);
    evas_common_cpu_end_opt();
+#endif   
 }
 
 static void
 eng_line_draw(void *data, void *context, void *surface, int x1, int y1, int 
x2, int y2)
 {
+#ifdef BUILD_PTHREAD
+   evas_common_pipe_line_draw(surface, context, x1, y1, x2, y2);
+#else   
    evas_common_line_draw(surface, context, x1, y1, x2, y2);
    evas_common_cpu_end_opt();
+#endif   
 }
 
 static void *
@@ -166,8 +174,12 @@
 static void
 eng_polygon_draw(void *data, void *context, void *surface, void *polygon)
 {
+#ifdef BUILD_PTHREAD
+   evas_common_pipe_polygon_draw(surface, context, polygon);
+#else
    evas_common_polygon_draw(surface, context, polygon);
    evas_common_cpu_end_opt();
+#endif
 }
 
 static void *
@@ -295,7 +307,12 @@
 static void
 eng_gradient_draw(void *data, void *context, void *surface, void *gradient, 
int x, int y, int w, int h)
 {
+#ifdef BUILD_PTHREAD
+   evas_common_pipe_grad_draw(surface, context, x, y, w, h, gradient);
+#else   
    evas_common_gradient_draw(surface, context, x, y, w, h, gradient);
+   evas_common_cpu_end_opt();
+#endif   
 }
 
 static void *
@@ -484,6 +501,11 @@
 eng_image_draw(void *data, void *context, void *surface, void *image, int 
src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int 
dst_h, int smooth)
 {
    evas_common_load_image_data_from_file(image);
+#ifdef BUILD_PTHREAD
+   evas_common_pipe_image_draw(image, surface, context, smooth,
+                              src_x, src_y, src_w, src_h,
+                              dst_x, dst_y, dst_w, dst_h);
+#else
    if (smooth)
      evas_common_scale_rgba_in_to_out_clip_smooth(image, surface, context,
                                      src_x, src_y, src_w, src_h,
@@ -493,6 +515,7 @@
                                      src_x, src_y, src_w, src_h,
                                      dst_x, dst_y, dst_w, dst_h);
    evas_common_cpu_end_opt();
+#endif
 }
 
 static char *
@@ -631,8 +654,13 @@
 static void
 eng_font_draw(void *data, void *context, void *surface, void *font, int x, int 
y, int w, int h, int ow, int oh, const char *text)
 {
-   if ((w == ow) && (h == oh))
-     evas_common_font_draw(surface, context, font, x, y, text);
+#ifdef BUILD_PTHREAD
+   evas_common_pipe_text_draw(surface, context, font, x, y, text);
+#else   
+   evas_common_font_draw(surface, context, font, x, y, text);
+   evas_common_cpu_end_opt();
+#endif   
+#if 0   
    else
      {
        /* create output surface size ow x oh and scale to w x h */
@@ -670,7 +698,7 @@
             evas_common_draw_context_free(dc);
          }
      }
-   evas_common_cpu_end_opt();
+#endif   
 }
 
 static void



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to