From caafa2704e01539dc4db3f2589ee2cec2b86b935 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 15 Sep 2008 18:47:37 +0000 Subject: Add general comment on knockout rendering. svn path=/trunk/netsurf/; revision=5327 --- desktop/knockout.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'desktop/knockout.c') diff --git a/desktop/knockout.c b/desktop/knockout.c index 658503313..678b83297 100644 --- a/desktop/knockout.c +++ b/desktop/knockout.c @@ -18,6 +18,48 @@ /** \file * Knockout rendering (implementation). + * + * Knockout rendering is an optimisation which is particularly for + * unaccelerated screen redraw. It tries to avoid plotting the same area more + * than once. + * + * If the object is to plot two overlapping rectangles (one large, one small), + * such as: + * + * +-----------------+ + * |#################| + * |####+-------+####| + * |####|:::::::|####| + * |####|:::::::|####| + * |####|:::::::|####| + * |####+-------+####| + * |#################| + * +-----------------+ + * + * Without knockout rendering we plot the bottom rectangle and then the top one: + * + * +-----------------+ +-----------------+ + * |#################| |#################| + * |#################| |####+-------+####| + * |#################| |####|:::::::|####| + * |#################| and then, |####|:::::::|####| + * |#################| |####|:::::::|####| + * |#################| |####+-------+####| + * |#################| |#################| + * +-----------------+ +-----------------+ + * + * With knockoout rendering, the bottom rectangle is split up into smaller + * ones and each pixel is just plotted once: + * + * +-----------------+ + * |#################| + * +----+-------+----+ + * |####|:::::::|####| + * |####|:::::::|####| + * |####|:::::::|####| + * +----+-------+----+ + * |#################| + * +-----------------+ */ #define NDEBUG -- cgit v1.2.3