Ignore:
Timestamp:
Jul 24, 2009, 8:48:35 AM (11 years ago)
Author:
Sam Hocevar
Message:

Store dirty rectangles in a structure list. For now there is still only
one dirty rectangle, but this is the first step to improvement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/canvas.c

    r3494 r3568  
    371371    _caca_save_frame_info(cv);
    372372
     373    /* Preload new width and height values into the canvas to optimise
     374     * dirty rectangle handling */
    373375    cv->width = width;
    374376    cv->height = height;
    375377    new_size = width * height;
     378
     379    /* If width or height is smaller (or both), we have the opportunity to
     380     * reduce or even remove dirty rectangles */
     381    if(width < old_width || height < old_height)
     382        _caca_clip_dirty_rect_list(cv);
    376383
    377384    /* Step 1: if new area is bigger, resize the memory area now. */
     
    471478    }
    472479
    473     /* XXX: technically we should not worry about the dirty rectangle in
    474      * the bottom-right corner, because we only handle one dirty rectangle,
    475      * but in case the API changes later, we make sure this is handled. */
     480    /* If both width and height are larger, there is a new dirty rectangle
     481     * that needs to be created in the lower right corner. */
    476482    if(width > old_width && height > old_height)
    477483        caca_add_dirty_rect(cv, old_width, old_height,
Note: See TracChangeset for help on using the changeset viewer.