KOffice – TDE office suite
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.8KB

  1. Dirty marking and rendering
  2. Chalk organizes layers in the form of a tree, with a grouplayer at the root:
  3. group1 == image->rootLayer()
  4. layer2
  5. layer3
  6. layer4
  7. group2
  8. layer6
  9. layer7
  10. adjustmentlayer 1
  11. layer9
  12. group3
  13. adjustmentlayer 2
  14. layer10
  15. layer11
  16. group4
  17. layer12
  18. layer13
  19. In this example, group1 is the rootlayer; layer13 is group3 is shown topmost
  20. in the layerbox, with group4 right under that, and layer13 is the "highest"
  21. paint layer in the complete tree.
  22. Compositing
  23. At every group level, a projection layer caches the result of compositing
  24. the layerstack in a projection paint device. The cached projection is then
  25. composited with the layers of that level, etc, until everything is composited
  26. onto the projection or the root layer. The image does _not_ have a projection
  27. anymore.
  28. We composite from layer2 downwards onto the projection of rootLayer, group1.
  29. Dirty marking
  30. In order to do the least possible amount of work (which is very important,
  31. especially with large amounts of layers and adjustment layers), we keep track
  32. of which layer is dirty. Groups without dirty layers are not recomposited; this
  33. dirtiness of course travels upwards, meaning that the rootlayer will always be
  34. dirty.
  35. XXX: Should we keep a structure with dirty rects for every layer, so we
  36. can determine whether the changed rect in a layer is actually in the area
  37. we are recompositing? I don't think so, since we should always try to keep
  38. Adjustment layers also keep a copy of the result of their work; if in group 2,
  39. layer 9 is adjusted, we do not want to composite layer 6 and 7 and filter the
  40. result through adjustmentlayer 1; we want to composite the changes in layer 9
  41. directly onto the cached result of the adjustment layer.