Enlightenment CVS committal Author : raster Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/lib/engines/common Modified Files: evas_gradient_linear.c evas_gradient_main.c evas_image_main.c evas_pipe.c Log Message: and fix the gradient bug - yes. it is a GRADIENT BUG. you emms() when u are totally done and may hand control back to a non rendering codepath - or before u do any fp ops u are unsure of the cpu state beforehand. see the big fat comment. i was right. it was a missing emms. =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_gradient_linear.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- evas_gradient_linear.c 28 Dec 2006 12:36:41 -0000 1.7 +++ evas_gradient_linear.c 31 May 2008 04:16:39 -0000 1.8 @@ -167,8 +167,8 @@ linear_data->off = 0.0; linear_data->len = 32; linear_data->at_angle = 0; + gr->type.gdata = linear_data; } - gr->type.gdata = linear_data; linear_data->type = 0; if (gr->type.name && !strcmp(gr->type.name, "linear.diag")) @@ -220,7 +220,7 @@ linear_data->yy0 = (linear_data->ca * (yoff << 16)) - (linear_data->sa * (xoff << 16)); linear_data->off = gr->map.offset; - + if ((linear_data->ca != 1.0) || (linear_data->sa != 0.0)) linear_data->at_angle = 1; } =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_gradient_main.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- evas_gradient_main.c 12 Apr 2008 00:32:25 -0000 1.16 +++ evas_gradient_main.c 31 May 2008 04:16:39 -0000 1.17 @@ -433,13 +433,13 @@ int direct_copy = 0, buf_step = 0; if (!dst || !dc || !gr || !dst || !dst->image.data) - return; + return; if (!gr->map.data || !gr->type.geometer) - return; + return; if ((gr->fill.w < 1) || (gr->fill.h < 1)) - return; + return; if ((w < 1) || (h < 1)) - return; + return; clx = 0; cly = 0; clw = dst->cache_entry.w; clh = dst->cache_entry.h; if ((clw < 1) || (clh < 1)) return; @@ -457,40 +457,41 @@ if (!gr->type.geometer->has_mask(gr, dc->render_op)) { if ((dc->render_op == _EVAS_RENDER_FILL) || - (dc->render_op == _EVAS_RENDER_COPY)) + (dc->render_op == _EVAS_RENDER_COPY)) { direct_copy = 1; buf_step = dst->cache_entry.w; if (gr->type.geometer->has_alpha(gr, dc->render_op)) - dst->flags |= RGBA_IMAGE_HAS_ALPHA; + dst->flags |= RGBA_IMAGE_HAS_ALPHA; } else if ((dc->render_op == _EVAS_RENDER_BLEND) && - !gr->type.geometer->has_alpha(gr, dc->render_op)) + !gr->type.geometer->has_alpha(gr, dc->render_op)) { direct_copy = 1; buf_step = dst->cache_entry.w; } } + if (!direct_copy) { argb_buf = evas_common_image_line_buffer_obtain(w); if (!argb_buf) - return; + return; if (gr->type.geometer->has_alpha(gr, dc->render_op)) - argb_buf->flags |= RGBA_IMAGE_HAS_ALPHA; + argb_buf->flags |= RGBA_IMAGE_HAS_ALPHA; else - argb_buf->flags &= ~RGBA_IMAGE_HAS_ALPHA; - + argb_buf->flags &= ~RGBA_IMAGE_HAS_ALPHA; + if (gr->type.geometer->has_mask(gr, dc->render_op)) { - alpha_buf = evas_common_image_alpha_line_buffer_obtain(w); - if (!alpha_buf) - { - evas_common_image_line_buffer_release(argb_buf); - return; - } - bfunc = evas_common_gfx_func_composite_pixel_mask_span_get(argb_buf, dst, w, dc->render_op); + alpha_buf = evas_common_image_alpha_line_buffer_obtain(w); + if (!alpha_buf) + { + evas_common_image_line_buffer_release(argb_buf); + return; + } + bfunc = evas_common_gfx_func_composite_pixel_mask_span_get(argb_buf, dst, w, dc->render_op); } else - bfunc = evas_common_gfx_func_composite_pixel_span_get(argb_buf, dst, w, dc->render_op); + bfunc = evas_common_gfx_func_composite_pixel_span_get(argb_buf, dst, w, dc->render_op); } gfunc = gr->type.geometer->get_fill_func(gr, dc->render_op, dc->anti_alias); @@ -506,6 +507,29 @@ return; } + /* I TOLD YOU! this here STOPS the gradeint bugs. it's a missing + * emms() before doing floating point operations! the thread pipe code + * just brought it out reliably. i swear i had seen this long before i + * ever added the thread/pipe code. + * + * now here is why it happens. NO drawing function... EXCEPT + * evas_common_polygon_draw() and evas_common_gradient_draw() use floating + * point for drawing (the poly stuff should really lose it actually), but + * nicely nestled in the poly draw code is a evas_common_cpu_end_opt() + * before it does any operations that would use floating point. the fact + * is the gradient code was LUCKY before without the thread pipes to almost + * all the time have another func do a evas_common_cpu_end_opt() before it + * was called. that was no longer the case with the thread renderer and + * it suffered. that is why on amd systems it seemed to work as i beileve + * on amd cpu's the amms done by evas_common_cpu_end_opt() is not needed + * to do floatingpoint ops again. + * + * after a lot of futzing about - this was the culprit (well axx and axy + * were garbage values eventually i found after much debugging and i traced + * their garbageness back to here). + */ + evas_common_cpu_end_opt(); + angle = (gr->fill.angle * M_PI) / 180.0; axx = (cos(angle) * 65536.0); ayy = axx; @@ -520,10 +544,10 @@ { buf = argb_buf->image.data; if (alpha_buf) - mask = (DATA8 *)alpha_buf->image.data; + mask = (DATA8 *)alpha_buf->image.data; } else - buf = pdst; + buf = pdst; while (pdst < dst_end) { #ifdef EVAS_SLI @@ -531,6 +555,7 @@ #endif { gfunc(map, len, buf, mask, w, xoff, yoff, axx, axy, ayx, ayy, gdata); + evas_common_cpu_end_opt(); if (!direct_copy) bfunc(buf, mask, 0, pdst, w); evas_common_cpu_end_opt(); @@ -539,7 +564,7 @@ pdst += dst->cache_entry.w; yoff++; } - + if (!direct_copy) { evas_common_image_line_buffer_release(argb_buf); =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_image_main.c,v retrieving revision 1.65 retrieving revision 1.66 diff -u -3 -r1.65 -r1.66 --- evas_image_main.c 19 May 2008 03:29:54 -0000 1.65 +++ evas_image_main.c 31 May 2008 04:16:39 -0000 1.66 @@ -450,7 +450,7 @@ EAPI void evas_common_image_line_buffer_release(RGBA_Image *im) { - _evas_common_rgba_image_delete(&im->cache_entry);; + _evas_common_rgba_image_delete(&im->cache_entry); /* if (!evas_rgba_line_buffer) return; if (EVAS_RGBA_LINE_BUFFER_MAX_LEN < evas_rgba_line_buffer->image->w) @@ -470,7 +470,7 @@ EAPI void evas_common_image_line_buffer_free(RGBA_Image *im) { - _evas_common_rgba_image_delete(&im->cache_entry);; + _evas_common_rgba_image_delete(&im->cache_entry); /* if (!evas_rgba_line_buffer) return; evas_common_image_free(evas_rgba_line_buffer); @@ -508,7 +508,7 @@ EAPI void evas_common_image_alpha_line_buffer_release(RGBA_Image *im) { - _evas_common_rgba_image_delete(&im->cache_entry);; + _evas_common_rgba_image_delete(&im->cache_entry); /* if (!evas_alpha_line_buffer) return; if (EVAS_ALPHA_LINE_BUFFER_MAX_LEN < evas_alpha_line_buffer->image->w) =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_pipe.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- evas_pipe.c 3 May 2008 05:32:13 -0000 1.11 +++ evas_pipe.c 31 May 2008 04:16:39 -0000 1.12 @@ -470,7 +470,6 @@ { RGBA_Pipe_Op *op; -// return; /* FIXME: still need locks in fonts */ if ((!fn) || (!text)) return; dst->pipe = evas_common_pipe_add(dst->pipe, &op); if (!dst->pipe) return; ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs