[GSOC] Tiled Rendering, ahunt, Weekly Report 05 / WK25

Andrzej Hunt andrzej at ahunt.org
Mon Jun 23 00:12:04 PDT 2014


Hi All,

Status for the last week

* Started Working on Calc Tiled Rendering

** Getting some output to be shown was deceptively simple.
** Even images seem to be shown, however only as an outline
     (i.e. not showing the content) -- the same thing seems to
     be happening in Calc (where you need to touch/move/otherwise
     manipulate the document before the image itself is shown, so
     AFAICS not a tiled rendering specific bug).


** However scaling / matching document coordinates is tricky
     (and is what I've spent most of the week working on).

***: For document "size" we currently grab the area containing
        cells with data, which is then the suggested minimum area that
        should be rendered.
**** Client can request that additional are (with empty cells) be rendered,
        allowing for an infinitely expanding document as in calc.
**** However this area (or the way we currently determine it) doesn't
        take into account images (and presumably other objects) that aren't
        within a cell, and also cells that are merely formatted but 
don't have data.
        (I.e. will still need some improvement to be truly useful).

***: Scaling is also wrong, it turns out we have a bunch of rounding 
errors being
        propagated due to repeated scaling, which means that when you 
request
        a tile nominally covering the whole document you would get 
something like
        in calc_scalewrong.png (attached).
        (Ignore the image being cut for now, see above)
****: For some reason calc does most of its drawing in pixel mapped 
mode, rather
         than in document dimensions, i.e. it handles all the scaling 
itself, rather than using
         the virtual device scaling. This results in multiple 
multiplications with some fairly
         small fractions, with errors creeping in that way.
****: Managed to fix this (for the cell outlines only for now, cell 
contents/images
         still to be done), by rewriting the painting to only use the 
virtual devices built
         in scaling (whereas currently the scaling is passed into the 
ViewData, which multiplies
         the desired scale by the screen PPT[XY], which is where most of 
the error occurs).
         See calc_tiled.png for this (I've changed zoom-levels just to 
make scaling issues more
         apparent, this can be tweaked easily in the gtktiledviewer 
sources).
****: However using this means that Calc (non-tiled rendering mode) will 
also be affected,
         see calc_broken.png.
****: Still thinking about the best way to proceed, some options would be:
         1) Have tiled-rendering conditions throughout the code to use 
the correct scaling
             only then (probably a huge nightmare to maintain).
         2) Rewrite all of the frontend code to get rid of the internal 
scaling, instead relying on
             the virtualdevice scaling (better for maintenance, but 
potential for bugs in the short term).
             This probably shouldn't be too tricky, but will touch quite 
a bit of code.
         3) Combination of the above: work on the tiled rendering only 
for now, rewrite the frontend
             later to use the tiled output + use the tiled dimensions 
for the rest of the UI (i.e. the column/
             row bars), and finally scrap the old code.
****: We could potentially just ignore these scaling issues, but for 
tiled rendering I suspect
          it's crucial that coordinates stay in the same place since we 
might be grabbing the same content
          rendered at multiple zoom levels etc., and the document 
potentially moving around at different
          scaling levels would look quite glitchy I suspect.

* Some more LOK work:
** glib inspired class/object splitting.
** Since we're now breaking ABI anyway, got rid of the annoying
     double initialisation.

Cheers,

     Andrzej

-------------- next part --------------
A non-text attachment was scrubbed...
Name: calc_broken.png
Type: image/png
Size: 77175 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20140623/c7720cc1/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: calc_tiled.png
Type: image/png
Size: 35054 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20140623/c7720cc1/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: calc_scalewrong.png
Type: image/png
Size: 32597 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20140623/c7720cc1/attachment-0002.png>


More information about the LibreOffice mailing list