[cairo] Quartz gradients consistency
ranma42 at gmail.com
Tue Oct 12 14:29:26 PDT 2010
On Sun, Oct 10, 2010 at 11:55 PM, Robert O'Callahan
<robert at ocallahan.org> wrote:
> That's a really nice approach. However, there are still situations where we
> want the rasterization of gradients to be independent of the surface
> extents, even the extents of the final destination surface. For example,
> when resizing the window, we do not necessarily repaint the entire window,
> and we may draw using the contents of cached surfaces representing "layers"
> of content in the window.
The patch seems to gather some consensus and no objections.
It should be safe to apply it, because it doesn't affect the public API,
so I pushed it to master.
> So I think we need some API to override the "virtual extents", or some other
> way we can have the gradient rasterization in a fill(), stroke() or
> show_glyphs() depend only on the path/glyph extents.
The same API could be used to offer some explicit guarantees about dithering
> I also think we need to have a public discussion about exactly what
> guarantees cairo should offer in this area. For example, for an interactive
> application the ideal would be if cairo can promise:
> 1) Rasterization of pixels completely inside the clip region is independent
> of the clip region.
> 2) Rasterization of pixels inside the surface extents is independent of the
> surface extents.
> but I understand that this is too restrictive on implementations as a
> general rule.
These guarantees (expecially if both need to hold simultaneously) look very
strong. Currently they holst most of the times in most backends (the only
exceptions I know of being the dithering in xlib and gradients in quartz).
The "virtual extents" API might be a good way to control this: it would
probably be possible to guarantee that the rasterization depends only
on the virtual extents.
More information about the cairo