Changeset 3557


Ignore:
Timestamp:
07/19/09 23:12:39 (4 years ago)
Author:
pterjan
Message:
  • Also test blitting with mask
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/tests/dirty.cpp

    r3556 r3557  
    197197        caca_fill_box(cv2, 0, 0, 2, 1, 'x'); 
    198198 
    199         caca_blit(cv, 1, 1, cv2, NULL); 
    200         i = caca_get_dirty_rect_count(cv); 
    201         CPPUNIT_ASSERT_EQUAL(i, 1); 
    202         caca_get_dirty_rect(cv, 0, &dx, &dy, &dw, &dh); 
    203  
    204199        /* Check that blitting a canvas make a dirty rectangle 
    205200         * only for modified lines */ 
     201 
     202        caca_blit(cv, 1, 1, cv2, NULL); 
     203        i = caca_get_dirty_rect_count(cv); 
     204        CPPUNIT_ASSERT_EQUAL(i, 1); 
     205        caca_get_dirty_rect(cv, 0, &dx, &dy, &dw, &dh); 
     206 
    206207        CPPUNIT_ASSERT(dx == 1); 
    207208        CPPUNIT_ASSERT(dy == 1); 
    208209        CPPUNIT_ASSERT(dw >= 2); 
    209210        CPPUNIT_ASSERT(dh == 1); 
     211 
     212        caca_clear_canvas(cv); 
     213        caca_clear_dirty_rect_list(cv); 
     214 
     215        /* Check that blitting a canvas make a dirty rectangle 
     216         * only for modified chars when we have a mask */ 
     217 
     218        caca_blit(cv, 1, 1, cv2, cv2); 
     219        i = caca_get_dirty_rect_count(cv); 
     220        CPPUNIT_ASSERT_EQUAL(i, 1); 
     221        caca_get_dirty_rect(cv, 0, &dx, &dy, &dw, &dh); 
     222 
     223        CPPUNIT_ASSERT(dx == 1); 
     224        CPPUNIT_ASSERT(dy == 1); 
     225        CPPUNIT_ASSERT(dw == 2); 
     226        CPPUNIT_ASSERT(dh == 1); 
    210227    } 
    211228 
Note: See TracChangeset for help on using the changeset viewer.