2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
3 * Free Software Foundation, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #define INPUT_FILENAME "morph_test1.swf"
24 #include "MovieTester.h"
25 #include "MovieClip.h"
26 #include "DisplayObject.h"
27 #include "DisplayList.h"
34 using namespace gnash
;
39 trymain(int /*argc*/, char** /*argv*/)
41 //string filename = string(TGTDIR) + string("/") + string(INPUT_FILENAME);
42 string filename
= string(INPUT_FILENAME
);
43 MovieTester
tester(filename
);
45 gnash::LogFile
& dbglogfile
= gnash::LogFile::getDefaultInstance();
46 dbglogfile
.setVerbosity(1);
49 rgba
red(255,0,0,255); //start color
50 rgba
green(0,255,0,255); //end color
52 MovieClip
* root
= tester
.getRootMovie();
54 check_equals(root
->get_frame_count(), 8);
58 // fill color: 1.0*red + 0.0*green
59 // center coordinates: <start_x+50, start_y+50>
60 check_pixel(50, 50, 50, red
, 2); // morph ratio = 0
64 // 0.8*red + 0.2*green
65 // center coordinates: <0.8*start_x+0.2*end_x+50, 0.8*start_y+0.2*end_y+50>
66 check_pixel(190, 150, 50, rgba(204,51,0,255), 2); // morph ratio = 0.2
70 // fill color: 0.6*red + 0.4*green
71 check_pixel(330, 250, 50, rgba(153,102,0,255), 2); // morph ratio = 0.4
75 // fill color: 0.4*red + 0.6*green
76 check_pixel(470, 350, 50, rgba(102,153,0,255), 2); // morph ratio = 0.6
80 // fill color: 0.2*red + 0.8*green
81 check_pixel(610, 450, 50, rgba(51,204,0,255), 2); // morph ratio = 0.8
85 // fill color: 0.0*red + 1.0*green
86 check_pixel(750, 550, 50, rgba(0,255,0,255), 2); // morph ratio = 1.0
90 // #39989. Nothing to check: empty morph shape.