mozilla / shumway

Shumway is a Flash VM and runtime written in JavaScript
Apache License 2.0
3.68k stars 396 forks source link

Shape Rendering #1363

Open mbebenita opened 10 years ago

mbebenita commented 10 years ago

Tracking bug for correct shape rendering.

mbebenita commented 10 years ago
mbebenita commented 10 years ago
applySegmentToStyles (shape.js:68)
convertRecordsToShapeData (shape.js:118)
defineShape (shape.js:379)
defineSymbol (resourceLoader.js:58)
onprogress (resourceLoader.js:183)
readTags (parser.js:65)
BodyParser.push (parser.js:309)
CompressedPipe.push (parser.js:231)
parseSWF (parser.js:394)
pipe.push (parser.js:347)
(anonymous function) (resourceLoader.js:390)
ResourceLoader.listener (resourceLoader.js:355)
ResourceLoader.postMessage (resourceLoader.js:350)
Loader._load.session.onprogress (Loader.js:481)
(anonymous function) (inspector.js:310)
BinaryFileReader.readAsync.xhr.onreadystatechange (binaryFileReader.js:80)
mbebenita commented 10 years ago

image

I think this is a bitmap fill and looks like the fill is not transformed correctly.

tschneidereit commented 10 years ago

I think this is a bitmap fill and looks like the fill is not transformed correctly.

Yeah, we're not yet doing bitmap fill transforms correctly.

mbebenita commented 10 years ago

Yeah, we're not yet doing bitmap fill transforms correctly.

Similar thing at shape 931:

image

while the actual bitmap is okay: (930)

image

mbebenita commented 10 years ago

expected:

image

actual:

image

mbebenita commented 10 years ago

image

I'm guess this is due to the stroke bounds not being computed correctly.

mbebenita commented 10 years ago

Expected:

image

Actual:

image

The green edge is a lot ticker, it seems like this happens if the width < 1, here it's set to 0.5. Also the bounds don't seem to be computed correctly.

mbebenita commented 10 years ago
tbtlr commented 10 years ago
tschneidereit commented 10 years ago

Support morphing.

Yes. My thinking on this has evolved a bit: I don't any longer think it's useful to write the morph-end coordinates into the same buffer as the morph-start ones. If we store them in their own buffer, we can keep that on the symbol and make the Graphics instance completely oblivious to the fact that there might be a morph. Only the (de-)serializer and renderer need to know about it. Oh, and I guess the engine for bounds calculations. Not sure yet where best to plug that in.

tschneidereit commented 10 years ago

CanvasPattern#setTransform has landed in Nightly, so at least there and in Chrome bitmap fills now work properly.

mbebenita commented 10 years ago

Various transformed bitmap fills it think (fail/char-image.swf)

image

To save space (I think), the image is only the top left portion of the shape. The rest of the shape is composed of bitmap fills that are flipped along the x and y axis.

I took the shape apart in (fail/char-image-apart.swf) the .fla is also there.

image

Simplified use case @ fail/f.swf

mbebenita commented 10 years ago
tschneidereit commented 10 years ago

I'm guess this is due to the stroke bounds not being computed correctly.

This was caused by us reading fill and line bounds the wrong way around for embedded shapes. Fixed by 5b503f4.

mbebenita commented 10 years ago

Graphics objects don't seem to be updated correctly in these games:

They are all related, so fixing one will probably fix them all.

mbebenita commented 10 years ago
mbebenita commented 10 years ago

Error parsing gradient.

mbebenita commented 10 years ago

Looks like the vertical line is too thick.