| Summary: | Cairo backend does not return GetPixel() correctly | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Chris Sherlock <chris.sherlock79> |
| Component: | graphics stack | Assignee: | Not Assigned <libreoffice-bugs> |
| Status: | RESOLVED NOTABUG | ||
| Severity: | normal | CC: | aron.budea, chris.sherlock79, xiscofauli |
| Priority: | medium | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux (All) | ||
| Whiteboard: | |||
| Crash report or crash signature: | Regression By: | ||
|
Description
Chris Sherlock
2019-10-06 22:55:33 UTC
Please note, I did step through this, I think the issue may occur in Luckily we don't use GetPixel practically anywhere except for tests. This looks like an issue of not taking account of per-multiplied alpha and misinterpretation of RGBA / ARGB or something like that.. Anyway the GetPixel should already be tested in BackendTest.cxx once we can enable that (needs fixing issues with the backends first and enable backend by backend). I debugged this, and it isn't an issue with premultiplied alpha as far as I can see. In SvpSalGraphics::getPixel, the value of data is 0x0000 unsigned char *data = cairo_image_surface_get_data(target); data[SVP_CAIRO_ALPHA] is 0 data[SVP_CAIRO_BLUE] is 0 data[SVP_CAIRO_GREEN] is 0 data[SVP_CAIRO_RED] is 0 Amazing Post, Thank you for sharing this post really this is awesome and very useful. http://corporate-office-headquarters-au.com/coles/ ...
VirtualDevice aRenderContext;
aRenderContext.DrawPixel(Point(8, 1), COL_GREEN);
...
aRenderContext is 0x0 so you are drawing outside the bounds of the device. Change it to ...
VirtualDevice aRenderContext;
aRenderContext.SetOutputSizePixel(Size(10,10));
aRenderContext.DrawPixel(Point(8, 1), COL_GREEN);
and it will work
Thanks! |