Changeset 3583 for libcaca/trunk/caca/dirty.c
- Timestamp:
- Jul 26, 2009, 9:17:35 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/dirty.c
r3580 r3583 36 36 37 37 static void merge_new_rect(caca_canvas_t *cv, int n); 38 39 /** \brief Disable dirty rectangles. 40 * 41 * Disable dirty rectangle handling for all \e libcaca graphic calls. This 42 * is handy when the calling application needs to do slow operations within 43 * a known area. Just call caca_add_dirty_rect() afterwards. 44 * 45 * This function is recursive. Dirty rectangles are only reenabled when 46 * caca_enable_dirty_rect() is called as many times. 47 * 48 * This function never fails. 49 * 50 * \param cv A libcaca canvas. 51 * \return This function always returns 0. 52 */ 53 int caca_disable_dirty_rect(caca_canvas_t *cv) 54 { 55 cv->dirty_disabled++; 56 57 return 0; 58 } 59 60 /** \brief Enable dirty rectangles. 61 * 62 * This function can only be called after caca_disable_dirty_rect() was 63 * called. 64 * 65 * If an error occurs, -1 is returned and \b errno is set accordingly: 66 * - \c EINVAL Dirty rectangles were not disabled. 67 * 68 * \param cv A libcaca canvas. 69 * \return 0 in case of success, -1 if an error occurred. 70 */ 71 int caca_enable_dirty_rect(caca_canvas_t *cv) 72 { 73 if(cv->dirty_disabled <= 0) 74 { 75 seterrno(EINVAL); 76 return -1; 77 } 78 79 cv->dirty_disabled--; 80 81 return 0; 82 } 38 83 39 84 /** \brief Get the number of dirty rectangles in the canvas.
Note: See TracChangeset
for help on using the changeset viewer.