diff options
author | Ray Strode <rstrode@redhat.com> | 2007-04-07 02:20:21 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2007-04-07 02:20:21 -0400 |
commit | 9330de7f7cc99bad600acbd78b10b6b79ed80dba (patch) | |
tree | e55c3faca7fd0b0230908e0b28c2960417fcd48a | |
parent | 5519b92303bf297409daab6299f229f54e148e3b (diff) |
random thoughts on how to draw less each time around
-rw-r--r-- | FIGURING-OUT-WHAT-TO-REDRAW | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/FIGURING-OUT-WHAT-TO-REDRAW b/FIGURING-OUT-WHAT-TO-REDRAW new file mode 100644 index 0000000..b91c959 --- /dev/null +++ b/FIGURING-OUT-WHAT-TO-REDRAW @@ -0,0 +1,41 @@ +Right now every toplevel (direct descendent of a root window) window is +given an associated "view". The view is responsible for translating the +various offscreen window events to some on screen representation. In +it's current form that means just showing the window exactly as it was +before, verbatim. Eventually it will also mean doing translucency and +animations. + +One interesting property of the views is that they track window +"damage". That means that they know when parts of their windows get +drawn off screen. The views should take advantage of this to only +update the on screen area that corresponds to the offscreen area that +got redrawn (the damaged areas). + +Also, in order to facilitate a reasonable amount of large-sized windows, +we need to make sure that views that are completely occluded are +properly culled and not drawn. Figuring out the proper culling logic is +a bit tricky, because only the view knows its geometry at any given +instant, and each view doesn't know the geometry or relative stacking +order and opacity of its siblings. + +One possible way to solve the problem is to institute a sort comparison +function that returns the difference of two views. This function would +return an area that encompasses the part of the first view that doesn't +overlap with the second view. In addition, the area would need to +account for (include) overlapping areas where the second view isn't +fully opaque. To figure out which part of a given view needs to be +redrawn, the application would call the comparison function for that +view against all of the views that are higher in the stack than it. The +view's initial bounding area would be intersected with each run of the +comparison function, and the remaining area is the area that isn't +occluded. This area should get passed to the view when requesting it +render itself. It would then only redraw damaged areas within the +passed in area. + +It's important that the application keep a list of views with windows +that have been recently damaged and only do the comparison on those views +and on views that been recently exposed because of a higher stacked view +moving. + +Also, the final rendered output of any given run should be +cached and redrawn initially next time around. |