summaryrefslogtreecommitdiff
path: root/desktop/knockout.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2008-09-15 18:47:37 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2008-09-15 18:47:37 +0000
commitcaafa2704e01539dc4db3f2589ee2cec2b86b935 (patch)
treea223adb8261dc81c7434324f0bb8aead6fc775e8 /desktop/knockout.c
parent7447ca1d4cda3e16d5284383cbd6c77ff6867e09 (diff)
downloadnetsurf-caafa2704e01539dc4db3f2589ee2cec2b86b935.tar.gz
netsurf-caafa2704e01539dc4db3f2589ee2cec2b86b935.tar.bz2
Add general comment on knockout rendering.
svn path=/trunk/netsurf/; revision=5327
Diffstat (limited to 'desktop/knockout.c')
-rw-r--r--desktop/knockout.c42
1 files changed, 42 insertions, 0 deletions
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