office-gobmx/canvas
Miklos Vajna 94df17d2fc tdf#145416 canvas: fix rotated, not zero-sized bitmap, which is not rendered
The presentation had a rotated bitmap, which is not zero size, but we
still decided to just not render it. The bug is specific to the "cairo
canvas", which is the default on Linux, but not elsewhere.

The trouble is that CanvasHelper::implDrawBitmapSurface() accessed the
transform matrix directly, assuming that the (0,0) and (1,1) members
represent scaling as-is. This is only true in case there are no other
transforms in the matrix (rotation, sharing).

Fix the problem by getting the scale info via
cairo_matrix_transform_distance(), which correctly determines if the
scaling is 0 or not.

This went wrong in commit 78036f74fa
(tdf#135094 cairo canvas: fix black slide containing a very small image,
2020-08-14).  No testcase, our tests are typically headless and
currently SvpSalGraphics::SupportsCairo() reports false, so this would
be tricky to test.

Change-Id: I0af18e89a3fbc76805053ba2f2f8ce509716f678
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142722
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-11-15 09:57:01 +01:00
..
inc
opengl
qa/cppunit
source tdf#145416 canvas: fix rotated, not zero-sized bitmap, which is not rendered 2022-11-15 09:57:01 +01:00
workben
CppunitTest_canvas_test.mk
Executable_canvasdemo.mk
IwyuFilter_canvas.yaml
Library_cairocanvas.mk
Library_canvasfactory.mk
Library_canvastools.mk
Library_directx9canvas.mk
Library_gdipluscanvas.mk
Library_oglcanvas.mk
Library_simplecanvas.mk
Library_vclcanvas.mk
Makefile
Module_canvas.mk
Package_opengl.mk
README.md
README.vars
StaticLibrary_directxcanvas.mk

UNO-based Graphics Backend

UNO-based graphics backend, lesser impedance to modern graphics APIs than vcl.

The canvas Framework

The canvas framework is the successor of the system GUI and graphics backend VCL. Basic functionality is available, supplying just as much features as necessary to provide a VCL-equivalent feature set (except proper BiDi/CTL support).

The canvas framework consists of the following two modules, canvas and cppcanvas. Additionally, a new generic graphics tooling is used (but not exclusively by the canvas, Armin's drawinglayer module also make use of it), which resides in basegfx.

The UNO API used by the canvas is primarily under css::rendering, with css::rendering::XCanvas being the central interface.

The slideshow Engine

The slideshow engine has replaced the former Impress-embedded presentation framework with a fully independent UNO component, and it is based on the canvas. Some features used there are only available from canvas, like double-buffering, and hardware-accelerated alpha-blending (currently not on all platforms).

Cairo canvas

Cairo canvas is one of backends of canvas component. canvas is mostly used for slideshow rendering and also for emf+ rendering. we hoped it will even be used by drawing layer, but it didn't happen (yet?) for API look at offapi/com/sun/star/rendering/, the implementation is in canvas and cppcanvas modules.

Cairo canvas backend uses Cairo library for rendering. Main advantage is support of alpha transparency and in some cases accelerated rendering.

The backend itself is quite old and stable, not many changes in that area lately, mostly changes for emf+ rendering, communication with vcl and bugfixes

Future Works

Look at Cairo canvas and situation when it is used (mostly slideshow).

TODO

There still might be more cases when we can save some roundtrips when exchanging data with vcl.