Bug 29250 - use XCopyArea for operator SOURCE with compatible COLOR_ALPHA surfaces
Summary: use XCopyArea for operator SOURCE with compatible COLOR_ALPHA surfaces
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: xlib backend (show other bugs)
Version: 1.9.13
Hardware: Other All
: medium normal
Assignee: Karl Tomlinson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-25 14:50 UTC by Karl Tomlinson
Modified: 2012-05-01 10:52 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
use XCopyArea for operator SOURCE with compatible COLOR_ALPHA surfaces (8.43 KB, patch)
2010-07-25 16:21 UTC, Karl Tomlinson
Details | Splinter Review

Description Karl Tomlinson 2010-07-25 14:50:46 UTC
My motivation here is that XCopyArea does what I want for simple self
copies, but XRenderComposite does not (at least not in all situations).

Also, even though I don't know why render should be slower than core, we
seem to get reports that it sometimes is, so there may be a performance
benefit on systems with some (buggy?) drivers.

XCopyArea is used for CONTENT_COLOR surfaces so it seems that it should also
be used for COLOR_ALPHA surfaces.

I'll attach a patch shortly.
Comment 1 Karl Tomlinson 2010-07-25 16:21:40 UTC
Created attachment 37387 [details] [review]
use XCopyArea for operator SOURCE with compatible COLOR_ALPHA surfaces

_operator_needs_alpha_composite was changed to take two _has_alpha arguments
instead of one (and started returning false for SOURCE) in
http://cgit.freedesktop.org/cairo/commit/?id=c25992479aca481d326f72665ebdcf0904273eac

The call added to _cairo_xlib_surface_composite in that changeset has since
been removed so _operator_needs_alpha_composite is now only used when the
source and destination have the same format.

I would have used a switch statement but -Wswitch-enum doesn't like
"default:".

I'm getting failures with svg12 outputting clear (blank) surfaces, but I
haven't marked them xfail because I'm getting a large number unexpected fails
for svg12 in other tests also.

I haven't run the test against win32 or quartz backends, but I expect it to
pass because, with Firefox, we only got reports of self-copy bugs on X11.
Comment 2 Chris Wilson 2010-07-26 05:47:56 UTC
With my driver author's hat on, this patch should not be necessary. Humph.
Comment 3 Chris Wilson 2012-04-10 16:00:33 UTC
Ok, cairo-1.12 should use the simpler XCopyArea for compatible surfaces and SOURCE (or reduced OVER) operators.


However, I see you have a test case as well, so I may as well add that to the repository.
Comment 4 Chris Wilson 2012-05-01 10:52:09 UTC
Principal bug should be fixed, excluding !owns_pixmap. :(


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.