From 402acbcfadbc8fd9f45330b46a4bfaad3e02eb39 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Tue, 4 May 2021 11:32:11 +0200 Subject: make it possible to write canvas unittests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- canvas/Module_canvas.mk | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'canvas/Module_canvas.mk') diff --git a/canvas/Module_canvas.mk b/canvas/Module_canvas.mk index f62d7ef46299..0ca3c4c9bfe0 100644 --- a/canvas/Module_canvas.mk +++ b/canvas/Module_canvas.mk @@ -49,4 +49,8 @@ $(eval $(call gb_Module_add_targets,canvas,\ )) endif +$(eval $(call gb_Module_add_check_targets,canvas,\ + CppunitTest_canvas_test \ +)) + # vim: set noet sw=4 ts=4: -- cgit