-
-
Notifications
You must be signed in to change notification settings - Fork 832
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add avm2/bitmapdata_draw_cpu_overwrite_gpu test
- Loading branch information
1 parent
21bdfdd
commit 05c1576
Showing
6 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
tests/tests/swfs/avm2/bitmapdata_draw_cpu_overwrite_gpu/Test.as
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package { | ||
import flash.display.*; | ||
import flash.text.*; | ||
import flash.geom.*; | ||
import flash.utils.*; | ||
|
||
/** | ||
* In this test we're doing: | ||
* 1. draw (GPU) | ||
* 2. full fill (CPU) | ||
* 3. draw (GPU) | ||
* | ||
* And we're verifying whether these operations are properly | ||
* synchronized, especially the "CPU overwriting GPU" part (1 vs 2). | ||
*/ | ||
[SWF(width="50", height="50")] | ||
public class Test extends MovieClip { | ||
[Embed(source="TestFont.ttf", fontName="TestFont", embedAsCFF="false", unicodeRange="U+0061-U+0064")] | ||
private var TestFont:Class; | ||
|
||
public function Test() { | ||
var bd = new BitmapData(50, 50); | ||
|
||
var tf = new TextField(); | ||
tf.defaultTextFormat = new TextFormat("TestFont", 20); | ||
tf.embedFonts = true; | ||
tf.text = "ab"; | ||
|
||
var mx = new Matrix(); | ||
bd.draw(tf, mx); | ||
bd.fillRect(new Rectangle(0, 0, 100, 100), 0); | ||
|
||
mx.translate(20, 0); | ||
bd.draw(tf, mx); | ||
|
||
addChild(new Bitmap(bd)); | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file added
BIN
+230 Bytes
tests/tests/swfs/avm2/bitmapdata_draw_cpu_overwrite_gpu/output.expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Binary file not shown.
7 changes: 7 additions & 0 deletions
7
tests/tests/swfs/avm2/bitmapdata_draw_cpu_overwrite_gpu/test.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
num_ticks = 1 | ||
|
||
[image_comparisons.output] | ||
tolerance = 0 | ||
|
||
[player_options] | ||
with_renderer = { optional = false, sample_count = 4 } |