forked from amazingfate/loongoffice
One of the problems is that canvas apparently works only with windows, but tests obviously need an offscreen surface. This patch moves Window::GetCanvas() to OutputDevice, and makes vclcanvas capable of working with OutputDevice classes that are not windows. Other canvas implementations still don't work, but presumably at least cairocanvas could be fixed too. This commit adds a "simple" test that just draws a line and tries to verify it's been drawn properly. Adding another test should be a matter of basing it on this existing one, and then copy&pasting the complicated UNO way of drawing using canvas from somewhere, such as canvas/workben/canvasdemo.cxx. Change-Id: I42db12b09433763cd31c3dd497c10157424b8598 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115117 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
12 lines
574 B
Plaintext
12 lines
574 B
Plaintext
How to write a canvas test:
|
|
===========================
|
|
|
|
The easiest (relatively speaking) way is to copy&paste from somewhere. Use existing tests
|
|
as the base, or canvas/workben/canvasdemo.cxx should be a good source too. If that doesn't
|
|
help, then you'll need to find the right UNO interfaces (see canvas/README). Have "fun".
|
|
|
|
|
|
Currently only the vclcanvas implementation is tested, because it's the only one
|
|
capable of working with offscreen surfaces. Other implementations would need to
|
|
be fixed, and then added to the gb_CppunitTest_use_components list in the makefile.
|