Flash does not support nested mask regions and instead merges them
into a single clip region.
For example, this occurs when using a dynamic text field as a mask.
One mask layer contains the glyphs, while the second layer is the
bounds of the text field. The text field bounds end up being
ignored when the text field is used as a mask, allowing the text
outside the bounds to be visible.
Add `CommandList::maskers_in_progress` to keep track of the mask
state and discard drawing commands for inner maskers.
Fixes#9664.
1. toString and toLocaleString should only be defined on the prototype.
2. concat should only be defined as an as3 and proto property, not as an instace property.
3. Array doesn't have a valueOf defined directly on it.
This matches the Context3D docs. Calling 'present' swaps
the buffers.
I wasn't certain if we actually need a double-buffered depth
texture, but I included one just to be safe.
Now that most of the complicated Context3D methods have been
implemented, we can simplify the overall design. Instead of queueing
up commands and having `present` execute them in a loop, we
can execute each command immediately. The key insight is that
a `RenderPass` is only needed for `DrawTriangles`, so we don't
have to store it in `Context3D` and deal with complicated lifetime
issues.
The old behavior gave us implicit double-buffering behavior,
since nothing would get rendered until a 'present' call.
Now that a 'drawTriangles' call will immediately submit
a draw command, we need to implement actual double buffering.
This is done in the next commit.
The `Avm2::{dispatch, broadcast}_event` methods now log and swallow any
AVM2 error occuring during the dispatch, instead of repeating the
handling code for each caller.
This also introduces some behavioral changes:
- Errors messages are more consistent;
- For consistency with `broadcast_event`, `dispatch_event` panics if
given a non-event object to dispatch.