<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
<small>I've looked into Chris's initial version and can give leave
some<br>
comments.</small><small> And I also have some questions about
pixman polygon<br>
image to </small><span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0);
font-family: 'Times New Roman'; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px; font-size:
medium;"><span class="Apple-style-span" style="border-collapse:
collapse; color: rgb(51, 51, 51); font-family: sans-serif;
font-size: 13px; white-space: nowrap;">Søren</span></span><small>
in below comments.</small><br>
<small>So, let's start.</small><br>
<br>
<br>
On 08/01/2011 08:49 PM, <a class="moz-txt-link-abbreviated" href="mailto:chris@chris-wilson.co.uk">chris@chris-wilson.co.uk</a> wrote:
<blockquote cite="mid:e0d58a$v8rtr@orsmga002.jf.intel.com"
type="cite">
<pre wrap="">Currently Cairo generates a temporary alpha mask for any non-pixel
aligned shape. In those circumstances, it would be faster if we could
pass the shape-information to pixman and have it composite in a
single-operation. (With secondary benefits for reducing the number of
sampled pixels.) A further goal is to be able to reduce the unaligned
clipping operation to a single pass as well. Furthermore it will also be
useful to supply a unified-opacity value to support a "global alpha" when
our source/mask channels are already utilised. One suggested approach
is to create a polygon image and have pixman generate spans internally.
This satisfies compositing a polygon in a single pass, and if we
additionally add clip-polygons we can accomplish the further goal of
single-pass clipping as well.
</pre>
</blockquote>
<br>
<br>
<small>I totally agree with that current pixman interface is not
sufficient for<br>
efficient polygon scan rasterizaion.</small><small> Sampling every
pixels inside of<br>
mask extents is huge overhead.</small> <small>And some
applications require<br>
additional global opacity to be applied while mask is used for
some<br>
other purposes. With current pixman, we have to do this by<br>
rendering things into a temp image and then compositing to <br>
destination with solid mask with opacity alpha value (multi-pass).<br>
<br>
Currently, there are two approaches to support polygon filling.<br>
pixman polygon image vs spans.<br>
<br>
I think pixman polygon image is a vector representation of an
alpha<br>
mask. I have several questions to s</small><span
class="Apple-style-span" style="border-collapse: separate; color:
rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
font-size: medium;"><span class="Apple-style-span"
style="border-collapse: collapse; color: rgb(51, 51, 51);
font-family: sans-serif; font-size: 13px; white-space: nowrap;">øren</span></span><small>
about polygon image.<br>
<br>
1. If polygon image is used as a src, is it treated as just a8
image?<br>
2. If polygon image is used as a dest, is it converted to bits
image?<br>
3. What if pixman_image_get_data() is called on polygon image?<br>
4. How can I fill intersection of two (or more) polygon images?<br>
<br>
Extra note:<br>
If we want pixman to be more powerful and general stateless<br>
backend for vector and raster graphics library, I think it would
be<br>
good to introduce GPU-backend with pixman path image. That can<br>
give us full chance of optimizing shape filling pipeline. But if
we<br>
consider S/W rendering only, polygon image would be sufficient.<br>
<br>
I don't think that those two approaches are conflicting. We can<br>
support both interfaces. Each of them have pros and cons.<br>
<br>
</small><br>
<blockquote cite="mid:e0d58a$v8rtr@orsmga002.jf.intel.com"
type="cite">
<pre wrap="">I've push an intiial implementation to
git://people.freedesktop.org/~ickle/pixman wip/spans
git://people.freedesktop.org/~ickle/cairo wip/spans
</pre>
</blockquote>
<br>
<br>
<small>As I mentioned on IRC, general paths can be implemented by
simply applying<br>
combine_in just before giving scanlines to composite function if
opacity is not<br>
fully opaque. I think people will not want performance regressions
even on<br>
general paths.<br>
<br>
And some additional mechanisms seem to be needed to utilize
existing fast<br>
paths. Fast paths for solid mask can be reused to support opacity
by simply <br>
combining solid color with opacity value. Solid mask is also same.
Adding fast<br>
paths with non-solid mask and non-opaque opacity should be
sufficient for our<br>
requirement.<br>
<br>
For example, over_n_8_8888 does not need to have
FAST_PATH_IS_OPAQUE<br>
flag if the function internally pre-combine opacity with solid
color. Your C fast<br>
paths can be modified to take advantage of existing fast paths
with small<br>
amount of effort.<br>
<br>
<br>
</small>
<blockquote cite="mid:e0d58a$v8rtr@orsmga002.jf.intel.com"
type="cite">
<pre wrap="">Even without optimised fast-paths, there are quite a few traces where
passing spans to pixman is a win (where the shape only occupies a
fraction of the mask extents and so where doing so reduces the number of
pixels we have to sample; and the opaque portions still hit the existing
fast paths.)
-Chris
</pre>
</blockquote>
<br>
<br>
<small>I will also evaluate the performance of HTML5 canvas bench.</small><br>
<small>Thank you Chris!</small><br>
<br>
<small>--<br>
Best Regards,<br>
Taekyun Kim</small><br>
<br>
</body>
</html>