diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2008-09-15 18:47:37 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2008-09-15 18:47:37 +0000 |
commit | caafa2704e01539dc4db3f2589ee2cec2b86b935 (patch) | |
tree | a223adb8261dc81c7434324f0bb8aead6fc775e8 /desktop/knockout.c | |
parent | 7447ca1d4cda3e16d5284383cbd6c77ff6867e09 (diff) | |
download | netsurf-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.c | 42 |
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 |