[cairo-bugs] [Bug 43397] EXTEND_NONE is used instead of EXTEND_PAD when src sample area is entirely within the surface

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Dec 6 07:11:43 PST 2011


--- Comment #6 from Benjamin Otte <otte at gnome.org> 2011-12-06 07:11:43 PST ---
I understand the view that it's not a Cairo bug, but I think it's possible to
optimize it in Cairo in a way that makes more people happy. But I also think
that it's EXA's or the driver's job to fix it - potentially in the same way.

The way I see it, the problem goes like this:
1) Do an operation where the EXTEND doesn't matter
2) Select any EXTEND (most likely randomly)
3) Performance depends on what you pick in (2)
The expected result should be:
3) Performance is identical (and optimal), no matter what EXTEND you pick.

Cairo has always taken the view that it's not the application author's job to
know about performance implications and it's Cairo's job to always pick the
fastest way to do something.
In fact, I would consider it preferable if all EXTEND modes were equally slow
to NONE being fast and PAD being slow, because then applications would get into
the business of adding extra code to compute a "proper" EXTEND when they

The reason why I assume Chris closed this bug is for 2 reasons:
1) Cairo overloads EXTEND_NONE with "EXTEND doesn't matter".
2) Historically, EXTEND_NONE was the fastest extend with XRender.

I think problem (1) is something that should be fixed inside Cairo (and might
be already, I haven't looked at recent changes), either by introducing an
internal EXTEND_ANY value that the backends transform to their fastest extend
mode on demand. Or by having code in the backends that can check if extend
matters for a certain information and then can pick the per-backend/operation
fastest extend mode.

However, problem (2) is not something Cairo can fix. Because if Cairo solved
problem (1), it would pick EXTEND_NONE, because that's the default extend to
use with XRender. So in that sense it is a bug in X. And I'm not sure if the
correct fix is to change the X specification to say "the fastest mode is PAD"
(because then you will have to guarantee that in the future), to add an
EXTEND_ANY to the XRender specification or to make X detect that the mode
doesn't matter. I would clearly vote for the detection, but I'll leave that for
you to figure out in your bug.

But considering that we do 2 things correctly:
1) Have the same performance characteristics for any EXTEND when it doesn't
2) Pass the desired mode for EXTEND_ANY
I don't think it's a bug in Cairo.

Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.

More information about the cairo-bugs mailing list