Re: [Pixman] [PATCH] Add fast paths for bilinear scaling

2012-06-28 Thread Siarhei Siamashka
On Tue, Jun 26, 2012 at 8:11 AM, Jeff Muizelaar jmuizel...@mozilla.com wrote:
 This patch adds fast paths for bilinear scaling of (SRC, r5g6b5, r5g6b5), 
 (OVER, a8r8g8b8, r5g6b5), and (OVER, a8r8g8b8, a8r8g8b8). These make a 
 noticeable
 improvement in the performance of Firefox on Android.

Hi, thanks. If this is a patch submission intended to be pushed to
pixman git, then it should normally meet some basic requirements to be
accepted:
1. make sure that make check test does not detect problems
2. for performance patches, some benchmark numbers demonstrating the
improvement are very much welcome in the commit message (preferably
with cairo-perf-trace, but lowlevel-blt-bench can be used too)


+static force_inline void
+scaled_bilinear_scanline___OVER (uint32_t *   dst,
+ const uint32_t * mask,
+ const uint32_t * src_top,
+ const uint32_t * src_bottom,
+ int32_t  w,
+ int  wt,
+ int  wb,
+ pixman_fixed_t   vx,
+ pixman_fixed_t   unit_x,
+ pixman_fixed_t   max_vx,
+ pixman_bool_tzero_src)
+{
+while ((w -= 1) = 0)
+{
+   uint32_t tl = src_top [pixman_fixed_to_int (vx)];
+   uint32_t tr = src_top [pixman_fixed_to_int (vx) + 1];
+   uint32_t bl = src_bottom [pixman_fixed_to_int (vx)];
+   uint32_t br = src_bottom [pixman_fixed_to_int (vx) + 1];
+   uint32_t src;
+   uint32_t d;
+   d = *dst;
+   src = bilinear_interpolation (tl, tr,
+ bl, br,
+ (vx  8)  0xff,
+ (wb  8)  0xff);

Currently 'wb' variable is a weight factor for the bottom row with
valid values in [0, 255] range. Shifting it right by 8 bits just
converts it to zero. Also the 'wt' variable is ignored, and this is
going to cause problems for NONE repeat:

http://cgit.freedesktop.org/pixman/tree/pixman/pixman-inlines.h?id=pixman-0.26.0#n761

+   vx += unit_x;
+   *dst++ = over (src, d);
+}
+}


But surely knowing what kind of fast paths are missing in pixman and
cause performance problems is a valuable information. This patch or
something similar has to be applied after we are done with the
bilinear interpolation precision tweaks (optimistically this should
not take long).

-- 
Best regards,
Siarhei Siamashka
___
Pixman mailing list
Pixman@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pixman


[Pixman] [PATCH] Add fast paths for bilinear scaling

2012-06-25 Thread Jeff Muizelaar
This patch adds fast paths for bilinear scaling of (SRC, r5g6b5, r5g6b5), 
(OVER, a8r8g8b8, r5g6b5), and (OVER, a8r8g8b8, a8r8g8b8). These make a 
noticeable
improvement in the performance of Firefox on Android.

-Jeff
___
Pixman mailing list
Pixman@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pixman


Re: [Pixman] [PATCH] Add fast paths for bilinear scaling

2012-06-25 Thread Jeff Muizelaar
And here's the patch.


patch
Description: Binary data


___
Pixman mailing list
Pixman@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pixman