<html>
<body>
Hey guys,<br><br>
I'm testing an optimization to automatically switch from an OVER operator
to SOURCE whenever the source is fully opaque. It's working very well,
but I encounter a problem in the case where these three conditions are
met:<br>
-the source is smaller the destination<br>
-the extend mode is none<br>
-we use the verb paint without specifying a clip area<br><br>
You can see the result of the <b>filter-nearest-offset</b> test as
attachment with and without the optimization. With the optimization
(Faulty.png), the last 4x4 is drawn and the SOURCE operator overwrite
everything else in the image.<br><br>
I see two possible solutions:<br>
1- I disable that optimization when the extend mode is at none (as
there's a chance we'll sample transparent pixels outside the image)<br>
2- The behavior shown is not the desired one and we never noticed it
before because we were using an OVER operator<br><br>
My question is then: when painting (cairo_paint) a small source onto a
larger destination, do we A) really want to sample the source for every
pixel of the destination, or do we B) only want to paint the source
within its bounds onto the destination (thus using its bounds as a clip
area)?<br><br>
If the answer is A), then my second question is: do we have any better
way to just paste a small source onto a larger destination (without
having to define a clip area each time)? I suppose this is a very common
thing to do and many users would see a speed boost. Our
<b>filter-nearest-offset </b>is not in perf, but it would still go a lot
faster if we weren't sampling (AND compositing) everywhere for each 4x4.
I suspect many people would do that mistake.<br><br>
Antoine</body>
</html>