~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to testsuite/misc-ming.all/DrawingApiTestRunner.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Sindhudweep Narayan Sarkar
  • Date: 2009-10-07 00:06:10 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20091007000610-mj9rwqe774gizn1j
Tags: 0.8.6-0ubuntu1
new upstream release 0.8.6 (LP: #435897)

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include "MovieTester.h"
24
24
#include "MovieClip.h"
25
 
#include "character.h"
 
25
#include "DisplayObject.h"
26
26
#include "DisplayList.h"
27
27
#include "log.h"
28
28
#include "GnashKey.h" // for gnash::key::code
124
124
 
125
125
        // Inside cyan clockwise fill
126
126
        tester.movePointerTo(190, 112);
127
 
        // this fails since Udo's rewrite of shape_character_def::point_test
 
127
        // this fails since Udo's rewrite of Shape_def::point_test
128
128
        // won't turn it into an 'expected' change as reverting the point_test 
129
129
        // would fix it.
130
130
        check(tester.isMouseOverMouseEntity());
758
758
        // Cairo succeeds.
759
759
        check_pixel(xo + (20*scale), yo + (25*scale), 3, white, 2);
760
760
 
761
 
        //----------------------------------------------------------
 
761
    // Test picture 3
 
762
        tester.pressKey(gnash::key::_3); tester.advance();
 
763
 
 
764
    const int w = 100, h = 100;
 
765
 
 
766
    int x = 20, y = 20;
 
767
 
 
768
    // Shape 1
 
769
 
 
770
    // Bottom left corner (green line).
 
771
    check_pixel(x, y + h, 2, green, 2);
 
772
    // Bottom left fill (red)
 
773
    check_pixel(x + 20, y + 60, 2, red, 2);
 
774
    // Top right fill (red)
 
775
    check_pixel(x + 80, y + 20, 2, red, 2);
 
776
    // Dead centre fill (red)
 
777
    xcheck_pixel(x + w / 2, y + h / 2, 2, red, 2);
 
778
    // Top right corner (blue line)
 
779
    check_pixel(x + w, y, 2, blue, 2);
 
780
 
 
781
    // Shape 2
 
782
    
 
783
    x += 200;
 
784
 
 
785
    // Bottom left corner (green line).
 
786
    check_pixel(x, y + h, 2, green, 2);
 
787
    // Bottom left fill (red)
 
788
    check_pixel(x + 20, y + 60, 2, red, 2);
 
789
    // Top right fill (red)
 
790
    xcheck_pixel(x + 80, y + 20, 2, red, 2);
 
791
    // Dead centre fill (red)
 
792
    xcheck_pixel(x + w / 2, y + h / 2, 2, red, 2);
 
793
    // Top right corner (blue line, is correct to be over black line ending)
 
794
    check_pixel(x + w, y, 2, blue, 2);
 
795
    // Top centre (black line)
 
796
    check_pixel(x + w / 2, y, 2, black, 2);
 
797
 
 
798
    // Shape 3
 
799
    
 
800
    x += 200;
 
801
 
 
802
    // Bottom left corner (black line).
 
803
    check_pixel(x, y + h, 2, black, 2);
 
804
    // Bottom left fill (none)
 
805
    check_pixel(x + 20, y + 60, 2, white, 2);
 
806
    // Top right fill (none)
 
807
    check_pixel(x + 80, y + 20, 2, white, 2);
 
808
    // Dead centre fill (none)
 
809
    check_pixel(x + w / 2, y + h / 2, 2, white, 2);
 
810
    // Top right corner (nothing)
 
811
    check_pixel(x + w, y, 2, white, 2);
 
812
 
 
813
    // Shape 4
 
814
    
 
815
    x = 20;
 
816
    y += 150;
 
817
 
 
818
    // Should look the same as Shape 3
 
819
 
 
820
    // Bottom left corner (black line).
 
821
    check_pixel(x, y + h, 2, black, 2);
 
822
    // Bottom left fill (none)
 
823
    check_pixel(x + 20, y + 60, 2, white, 2);
 
824
    // Top right fill (none)
 
825
    check_pixel(x + 80, y + 20, 2, white, 2);
 
826
    // Dead centre fill (none)
 
827
    check_pixel(x + w / 2, y + h / 2, 2, white, 2);
 
828
    // Top right corner (nothing)
 
829
    check_pixel(x + w, y, 2, white, 2);
 
830
 
 
831
    // Shape 5
 
832
 
 
833
    x += 200;
 
834
 
 
835
    // Bottom left corner (black line).
 
836
    check_pixel(x, y + h, 2, black, 2);
 
837
    // Bottom left fill (black)
 
838
    check_pixel(x + 20, y + 60, 2, black, 2);
 
839
    // Top right fill (none)
 
840
    check_pixel(x + 80, y + 20, 2, white, 2);
 
841
    // Dead centre (black line)
 
842
    check_pixel(x + w / 2, y + h / 2, 2, black, 2);
 
843
    // Top right corner (nothing)
 
844
    check_pixel(x + w, y, 2, white, 2);
 
845
    
 
846
    // Shape 6
 
847
 
 
848
    x += 200;
 
849
 
 
850
    // NB: the rendering of this shape is not consistent
 
851
    // across different versions of the pp. It doesn't seem
 
852
    // like a sane case, so there is probably no need
 
853
    // to worry about compatibility.
 
854
 
 
855
    // Bottom left corner (yellow line).
 
856
    check_pixel(x, y + h, 2, yellow, 2);
 
857
    // Bottom left fill (green)
 
858
    check_pixel(x + 20, y + 60, 2, green, 2);
 
859
 
 
860
    // The following tests are possibly meaningless:
 
861
    
 
862
    // Top right fill (blue)
 
863
    check_pixel(x + 80, y + 20, 2, blue, 2);
 
864
    // Dead centre (yellow line)
 
865
    check_pixel(x + w / 2, y + h / 2, 2, yellow, 2);
 
866
    // Top right corner (yellow line)
 
867
    check_pixel(x + w, y, 2, yellow, 2);
 
868
 
 
869
    //----------------------------------------------------------
762
870
        // TODO: check startDrag/stopDrag on the hit detector
763
871
        // (hit 'd' key to toggle)
764
872
        //----------------------------------------------------------