bugGnash - The GNU Flash player - Bugs: bug #26329, Drawing API bug

 
 

bug #26329: Drawing API bug

Submitter:  Benjamin Wolsey <bwy>
Submitted:  Fri 24 Apr 2009 09:28:49 AM UTC
   
 
Category:  ActionScript Severity:  3 - Normal
Release:  None Status:  Confirmed
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 08 Feb 2016 03:22:56 PM UTC, comment #11: 

This problem is still reproducible on current Gnash git version, @bwy's
test file (file #18005) is still showing a filled triangle. @strk's patch
(file #18379) doesn't seem to apply on current codebase anymore.

I have made another test SWF file (using libming's makeswf) which tries to
re-demonstate this problem on both object filling and stroking, and also
include point-based `MovieClip.hitTest()` checks on the resulting shape.

This is a correct result from Adobe Flash Player:
http://i.imgur.com/mfaS7BS.png

Player's trace output from the run:

PASSED: Center part of star polygon should be filled
PASSED: Top part of star polygon should be filled
PASSED: Top-right part of star polygon should be filled
PASSED: Bottom-right part of star polygon should be filled
PASSED: Bottom-left part of star polygon should be filled
PASSED: Top-left part of star polygon should be filled
PASSED: Top-right part of outer pentagon should not be filled
PASSED: Bottom-right part of outer pentagon should not be filled
PASSED: Bottom part of outer pentagon should not be filled
PASSED: Bottom-left part of outer pentagon should not be filled
PASSED: Top-left part of outer pentagon should not be filled
PASSED: Right edge of top part of star polygon should be stroked
PASSED: Top edge of top-right part of star polygon should be stroked
PASSED: Bottom edge of top-right part of star polygon should not be stroked
PASSED: Right edge of bottom-right part of star polygon should not be stroked
PASSED: Left edge of bottom-right part of star polygon should be stroked
PASSED: Right edge of bottom-left part of star polygon should be stroked
PASSED: Left edge of bottom-left part of star polygon should not be stroked
PASSED: Bottom edge of top-left part of star polygon should not be stroked
PASSED: Top edge of top-left part of star polygon should not be stroked
PASSED: Left edge of top part of star polygon should not be stroked
PASSED: Top-right edge of outer pentagon should not be stroked
PASSED: Bottom-right edge of outer pentagon should not be stroked
PASSED: Bottom edge of outer pentagon should not be stroked
PASSED: Bottom-left edge of outer pentagon should not be stroked
PASSED: Top-left edge of outer pentagon should not be stroked


You'd see that the code rendered as a filled star with two unconnected
border lines, and all point-based `MovieClip.hitTest()` checks on the shape
are all passing.

This is an image result from Gnash:
http://i.imgur.com/ijx8lkQ.png

Gnash's trace output from the run:

131 TRACE: FAILED: Center part of star polygon should be filled
131 TRACE: FAILED: Top part of star polygon should be filled
131 TRACE: FAILED: Top-right part of star polygon should be filled
131 TRACE: FAILED: Bottom-right part of star polygon should be filled
131 TRACE: FAILED: Bottom-left part of star polygon should be filled
132 TRACE: FAILED: Top-left part of star polygon should be filled
132 TRACE: FAILED: Top-right part of outer pentagon should not be filled
132 TRACE: FAILED: Bottom-right part of outer pentagon should not be filled
132 TRACE: FAILED: Bottom part of outer pentagon should not be filled
132 TRACE: FAILED: Bottom-left part of outer pentagon should not be filled
132 TRACE: FAILED: Top-left part of outer pentagon should not be filled
132 TRACE: PASSED: Right edge of top part of star polygon should be stroked
132 TRACE: PASSED: Top edge of top-right part of star polygon should be stroked
132 TRACE: FAILED: Bottom edge of top-right part of star polygon should not be stroked
132 TRACE: FAILED: Right edge of bottom-right part of star polygon should not be stroked
132 TRACE: PASSED: Left edge of bottom-right part of star polygon should be stroked
132 TRACE: PASSED: Right edge of bottom-left part of star polygon should be stroked
133 TRACE: FAILED: Left edge of bottom-left part of star polygon should not be stroked
133 TRACE: FAILED: Bottom edge of top-left part of star polygon should not be stroked
133 TRACE: FAILED: Top edge of top-left part of star polygon should not be stroked
133 TRACE: FAILED: Left edge of top part of star polygon should not be stroked
133 TRACE: FAILED: Top-right edge of outer pentagon should not be stroked
133 TRACE: PASSED: Bottom-right edge of outer pentagon should not be stroked
133 TRACE: FAILED: Bottom edge of outer pentagon should not be stroked
133 TRACE: PASSED: Bottom-left edge of outer pentagon should not be stroked
133 TRACE: PASSED: Top-left edge of outer pentagon should not be stroked


You'd see that the code rendered as a filled pentagon with star-shaped hole
instead, and two lines drawn are also closed in loop. Point-based
`MovieClip.hitTest()` checks on the shape are also mostly failing.

Test SWF, source code, build script, screenshots, and logs are attached as
`linereset-star.zip`.

Gnash: 0.8.11dev (git 435d3e9 6-Feb-2016)
Adobe Flash Player: 11.2 r202 (11.2.202.491) Standalone
System: Debian GNU/Linux 7.0 Wheezy i386

(file #36276)

Nutchanon Wetchasit <nachanon>
Tue 07 Jul 2009 08:51:20 PM UTC, comment #10: 

Just in case of disaster, I attach the fills.patch file fixing the bugs exposed by fills.as. Plan to commit them after the tests in fills.as are integrated into DrawingApiTest.as and runner.

(file #18379)

Sandro Santilli <strk>
Group Member
Tue 07 Jul 2009 08:43:33 PM UTC, comment #9: 

The attached fills.as contain more tests which fail with current gnash, and for which I already implemented fixes.
Note that the yellow stroked square behaves in odd ways, leaving leaking fills with pp 9 and using smaller stroke thickness in pp 10.

(file #18378)

Sandro Santilli <strk>
Group Member
Tue 07 Jul 2009 08:35:52 PM UTC, comment #8: 

I've noticed that the pp version 10 gives a FAIL in DrawingApiTest.swf, whereas version 9 doesn't:

FAILED: x.hitTest(122, 157, true) [/usr/src/gnash/gnash-head/testsuite/misc-ming.all/DrawingApiTest.as:255]

Does seem related to auto-closup of filled paths

Sandro Santilli <strk>
Group Member
Tue 07 Jul 2009 11:16:40 AM UTC, comment #7: 

Tests added.

Benjamin Wolsey <bwy>
Group Member
Thu 02 Jul 2009 02:23:51 PM UTC, comment #6: 

The attached bf2.as contains comment showing
where the problem lies (it's 2 of them)

(file #18352)

Sandro Santilli <strk>
Group Member
Thu 02 Jul 2009 02:15:20 PM UTC, comment #5: 

If anyone feels like adding the testcase to the existing
misc-ming.all/DrawingApiTest.as and related runner I'll try to fix.

Sandro Santilli <strk>
Group Member
Thu 02 Jul 2009 01:29:42 PM UTC, comment #4: 

I've also verified that a beginFill does instead force closeup of previous shape. Even if the fill parameters are the same.

Sandro Santilli <strk>
Group Member
Thu 02 Jul 2009 01:28:43 PM UTC, comment #3: 

The problem is that the call to lineStyle forces closeup of the current shape. I've tried having last lineStyle call use a different color to see if that should make a difference, but NOPE: the adobe player still considers it a single rectangle. No forced closeup.

Sandro Santilli <strk>
Group Member
Thu 02 Jul 2009 01:25:57 PM UTC, comment #2: 

More interesting things if you do make 'n' and 'a' available
in the .as file:

    n = 10;
    a = 100;

Gnash renders a diagonal line, the pp doesn't.

Indeed the AS code doesn't contain any diagonal line
AFAICS

Sandro Santilli <strk>
Group Member
Fri 24 Apr 2009 09:33:30 AM UTC, comment #1: 

The bug is visible in this real-life case:

http://www.alex-uhlmann.de/flash/animationpackage/ap1/de/alex_uhlmann/animationpackage/drawing/SuperShape_preview.swf

it also has other problems, namely enormous memory usage and not displaying the main shape.

Seems to be free software, so I'm attaching it too.

(file #18006)

Benjamin Wolsey <bwy>
Group Member
Fri 24 Apr 2009 09:28:49 AM UTC, original submission:  

The following code (attached as AS and SWF) should create a solid square. Gnash only fills half the square. The problem is in the two lineStyle changes.

createEmptyMovieClip("mc", 4);

with(mc)
{
    col = 0xff0000;
    colc = 100;
    x = 20;
    y = 20;
    xr = 100;
    yr = 100;

    beginFill(col,colc);
    lineStyle(n,1,a);

    moveTo(x,y);
    lineTo(x+xr,y);

    lineStyle(n,1,a);

    lineTo((x+xr),(y+yr));

    lineStyle(n,1,a);

    lineTo(x,(y+yr));
    lineTo(x,y);

    endFill();
}

Benjamin Wolsey <bwy>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #36276:  linereset-star.zip added by nachanon (25KiB - application/zip - Star-rendering test SWF file (Flash 7), with source code, screenshots, and logs)
file #18379:  fills.patch added by strk (4KiB - text/x-diff)
file #18378:  fills.as added by strk (1KiB - application/x-applix-spreadsheet)
file #18352:  bf2.as added by strk (601B - application/x-applix-spreadsheet - Commented source code)
file #18006:  SuperShape_preview.swf added by bwy (88KiB - application/x-shockwave-flash)
file #18004:  bf.as added by bwy (357B - application/x-applix-spreadsheet)
file #18005:  bf.swf added by bwy (243B - application/x-shockwave-flash)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nachanon (Updated the item)
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by bwy (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-02-08 nachanon Attached File- Added linereset-star.zip, #36276
    2009-07-07 strk Attached File- Added fills.patch, #18379
    2009-07-07 strk Attached File- Added fills.as, #18378
    2009-07-02 strk Attached File- Added bf2.as, #18352
    2009-07-02 strk StatusNone Confirmed
    2009-04-24 bwy Attached File- Added SuperShape_preview.swf, #18006
    2009-04-24 bwy Attached File- Added bf.as, #18004
        Attached File- Added bf.swf, #18005

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code