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
20 #define INPUT_FILENAME "BitmapDataTest.swf"
22 #include "MovieTester.h"
23 #include "MovieClip.h"
24 #include "DisplayObject.h"
25 #include "DisplayList.h"
33 using namespace gnash
;
34 using namespace gnash::geometry
;
39 trymain(int /*argc*/, char** /*argv*/)
41 string filename
= string(TGTDIR
) + string("/") + string(INPUT_FILENAME
);
42 MovieTester
tester(filename
);
44 gnash::LogFile
& dbglogfile
= gnash::LogFile::getDefaultInstance();
45 dbglogfile
.setVerbosity(1);
47 MovieClip
* root
= tester
.getRootMovie();
50 const rgba
white(255, 255, 255, 255);
51 const rgba
blue(0, 0, 255, 255);
52 const rgba
cyan(0, 255, 255, 255);
53 const rgba
green(0, 255, 0, 255);
54 const rgba
yellow(255, 255, 0, 255);
55 const rgba
magenta(255, 0, 255, 255);
56 const rgba
red(255, 0, 0, 255);
60 check_pixel(15, 15, 1, yellow
, 8);
61 check_pixel(80, 80, 1, green
, 8);
62 check_pixel(95, 95, 1, green
, 8);
67 check_pixel(15, 15, 1, yellow
, 8);
68 check_pixel(80, 80, 1, green
, 8);
69 check_pixel(95, 95, 1, blue
, 8);
70 check_pixel(115, 115, 1, blue
, 8);
75 check_pixel(15, 15, 1, yellow
, 8);
76 check_pixel(80, 80, 1, white
, 8);
77 check_pixel(95, 95, 1, white
, 8);
78 check_pixel(115, 115, 1, white
, 8);
83 check_pixel(15, 15, 1, red
, 8);
84 check_pixel(80, 80, 1, white
, 8);
85 check_pixel(95, 95, 1, white
, 8);
86 check_pixel(115, 115, 1, white
, 8);
88 check_pixel(315, 15, 1, magenta
, 8);
90 // Frame 5 (same as previous).
93 check_pixel(15, 15, 1, red
, 8);
94 check_pixel(80, 80, 1, white
, 8);
95 check_pixel(95, 95, 1, white
, 8);
96 check_pixel(115, 115, 1, white
, 8);
98 check_pixel(315, 15, 1, magenta
, 8);
103 check_pixel(15, 15, 1, red
, 8);
104 check_pixel(80, 80, 1, green
, 8);
105 check_pixel(95, 95, 1, blue
, 8);
106 check_pixel(115, 115, 1, blue
, 8);
108 check_pixel(315, 15, 1, magenta
, 8);
110 // Frame 7 (no change)
113 check_pixel(15, 15, 1, red
, 8);
114 check_pixel(80, 80, 1, green
, 8);
115 check_pixel(95, 95, 1, blue
, 8);
116 check_pixel(115, 115, 1, blue
, 8);
118 check_pixel(315, 15, 1, magenta
, 8);
123 check_pixel(1, 1, 1, white
, 8);
124 check_pixel(15, 15, 1, yellow
, 8);
125 check_pixel(30, 30, 1, red
, 8);
126 check_pixel(80, 80, 1, green
, 8);
127 check_pixel(95, 95, 1, blue
, 8);
128 check_pixel(115, 115, 1, blue
, 8);
130 check_pixel(315, 15, 1, white
, 8);
135 check_pixel(1, 1, 1, red
, 8);
136 check_pixel(15, 15, 1, red
, 8);
137 check_pixel(30, 30, 1, red
, 8);
138 check_pixel(95, 95, 1, white
, 8);
139 check_pixel(115, 115, 1, white
, 8);
141 check_pixel(315, 15, 1, white
, 8);
143 // Frame 10 (no change)
146 check_pixel(1, 1, 1, red
, 8);
147 check_pixel(15, 15, 1, red
, 8);
148 check_pixel(30, 30, 1, red
, 8);
149 check_pixel(95, 95, 1, white
, 8);
150 check_pixel(115, 115, 1, white
, 8);
152 check_pixel(315, 15, 1, white
, 8);
157 check_pixel(1, 1, 1, white
, 8);
158 check_pixel(30, 30, 1, blue
, 8);
159 check_pixel(95, 95, 1, blue
, 8);
160 check_pixel(115, 115, 1, white
, 8);
162 check_pixel(315, 15, 1, white
, 8);
164 // Frame 12 (no change)
167 check_pixel(1, 1, 1, white
, 8);
168 check_pixel(30, 30, 1, blue
, 8);
169 check_pixel(95, 95, 1, blue
, 8);
170 check_pixel(115, 115, 1, white
, 8);
172 check_pixel(315, 15, 1, white
, 8);
174 // Frame 13 (red square, same as frame 9).
177 check_pixel(1, 1, 1, red
, 8);
178 check_pixel(15, 15, 1, red
, 8);
179 check_pixel(30, 30, 1, red
, 8);
180 check_pixel(95, 95, 1, white
, 8);
181 check_pixel(115, 115, 1, white
, 8);
183 check_pixel(315, 15, 1, white
, 8);
188 check_pixel(1, 1, 1, white
, 8);
189 check_pixel(30, 30, 1, blue
, 8);
190 check_pixel(95, 95, 1, blue
, 8);
191 check_pixel(115, 115, 1, white
, 8);
193 check_pixel(325, 35, 1, blue
, 8);
195 // Frame 14 (noise patterns, doesn't make much sense to test externally).