bugGnash - The GNU Flash player - Bugs: bug #20655, SWFs without...

 
 

bug #20655: SWFs without "background" puts a black bg instead of white [head]

Submitter:  Sergio Costas <rastersoft>
Submitted:  Wed 01 Aug 2007 10:24:10 PM UTC
   
 
Category:  renderer Severity:  4 - Important
Release:  None Status:  Fixed
Privacy:  Public Assigned to:  zoulunkai
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 27 Aug 2007 02:52:04 AM UTC, comment #44: 


>Two more test cases, not directly related to this bug item, but
>still about masks: PP is very delicate about masks. You can't use
>text in a mask unless it's part of a movie clip and uses an
>embedded font. Gnash handles any case well (as most probably
>intended by a designer) but the PP is stubborn.
>Do we want to implement this limitation?


We might need to implement this 'limitation' later. Currently,  all character instances(including TextField) could act as masks, this is not bad, just not PP compatible:). I think this specific item has been tested enough now, time to close.

To strk: I think this is another case I'd like to know the instance type of a character:) TextField characters act differently as other normal characters as masks.

Zou Lunkai <zoulunkai>
Thu 23 Aug 2007 10:25:39 AM UTC, comment #43: 

yeah, masks seems stable now.
Just leave it open for one more day, I'll do some random checks tomorrow. Feeling good about the whole co-operation:)

Zou Lunkai <zoulunkai>
Thu 23 Aug 2007 10:11:09 AM UTC, comment #42: 

Works for me. I confirm the blue line. The original pdf2swf output also still works fine. Should we close this bug item ?

Sandro Santilli <strk>
Group Member
Thu 23 Aug 2007 09:56:50 AM UTC, comment #41: 

Should be fixed for AGG now (please test). There is a minimal anti-aliasing issue visible in mask-simple.swf (slight blue edges at the left and right side of the text field) but it will be hard to avoid that in a multi-pass renderer like Gnash. The PP has no problems with that, probably because it just uses 4-times oversampling (Gnash uses 256, which is much more accurate).

I checked OGL and it did already mask the polygon. That's good for text fields, but bad when masks are not desired (currently only when showing invalidated bounds). I haven't enough (say: "no") knowledge about OpenGL so I can't implement the unmasked version for OGL.

Udo Giacomozzi <udog>
Group Member
Thu 23 Aug 2007 09:12:56 AM UTC, comment #40: 

Ok, I will take care of this.

Udo Giacomozzi <udog>
Group Member
Thu 23 Aug 2007 08:06:50 AM UTC, comment #39: 

+1 for the extra parameter

Sandro Santilli <strk>
Group Member
Thu 23 Aug 2007 05:35:52 AM UTC, comment #38: 

OK, I took a look at edit_text_character::display().

The border is drawn by render::draw_poly(), which ignors the masks buffer in AGG renderer. Shouldn't be difficult to fix in this case.

The question is the semantics of render::draw_poly(). Is it supposed to respect the masks buffer? For example, if draw_poly() is used for Flash elements like EditTextFiled borders, then it should consider masks; but if draw_poly() is used for synthetical  rectangles(eg. invalidated region for debugging and some other purpose), it is also reasonable not to care about the masks.

What we do? Change the interface to take an extra parameter for masks? Any comments?



Zou Lunkai <zoulunkai>
Thu 23 Aug 2007 03:45:59 AM UTC, comment #37: 


>About masktest-simple.swf, gnash only problem is that the
>textfield border is not masked, right ?


yes. Any idea about that?

The border is expected to be masked in both conceptual model and the current implementation. I haven't figured out why it fails. Is the border handled differently with normal shapes?


Zou Lunkai <zoulunkai>
Wed 22 Aug 2007 09:57:04 AM UTC, comment #36: 

About masktest-simple.swf, gnash only problem is that the textfield border is not masked, right ?

Sandro Santilli <strk>
Group Member
Wed 22 Aug 2007 09:41:55 AM UTC, comment #35: 

Well done!!

I created another test case to check if nested movie clips (in a mask) are handled correctly, to see if a deeply nested child is still visible even if one of it's parents (not the direct parent)  is invisible. Gnash handles this very well! The test file is masktest-hide-depth.swf

Two more test cases, not directly related to this bug item, but still about masks: PP is very delicate about masks. You can't use text in a mask unless it's part of a movie clip and uses an embedded font. Gnash handles any case well (as most probably intended by a designer) but the PP is stubborn.
Do we want to implement this limitation?

Test files (description included in the movies):
masktest-text.swf
masktest-text-mc.swf
masktest-text-mc-embed.swf

Note: Gnash still fails rendering masked text fields correctly! (masktest-simple.swf)

(file #13762, file #13763, file #13764, file #13765)

Udo Giacomozzi <udog>
Group Member
Wed 22 Aug 2007 05:03:10 AM UTC, comment #34: 


UdoG: thanks for the test files.

mask-hide.swf, mask-hide2.swf, mask-hide3.swf passed.

"_visible" is ignored for all masks in cvs-head.

Zou Lunkai <zoulunkai>
Tue 21 Aug 2007 12:16:08 PM UTC, comment #33: 

Another testcase (animated mask), handled /nicely/ ba Gnash :)


(file #13756)

Udo Giacomozzi <udog>
Group Member
Tue 21 Aug 2007 12:10:42 PM UTC, comment #32: 

Additional note to the prev. comment: Disable invalidated bounds (ENABLE_REGION_UPDATES_DEBUGGING in gui.cpp) to see the real effects. It shows that Gnash effectively disables the mask completely when the movieclip is invisibile.


New testcase: This one uses one movieclip "i1" for the mask. Inside "i1" there is another movieclip (n2, a square) that toggles visibility at 1/2 second intervals. i1 is visible all the time.

_root
  |
  +-- large rectangular graphic with radial gradient (maskED)
  |
  +-- "i1" movieclip instance (MASK)
      |
      +-- circle graphic in i1
      |
      +-- "n2" movieclip instance <- toggles visibility
          |
          +-- square graphic in n2

(hope the above diagram is readable)

PP behavior: Masks using both the circle and the square all the time. No animation is visible, ie. doesn't care about _visible.

Gnash behavior: Hides/shows the square part of the mask according to _visible.

As i Flash designer I would say that Gnash is correct, but PP does it's own way... :(

(file #13754)

Udo Giacomozzi <udog>
Group Member
Tue 21 Aug 2007 11:48:26 AM UTC, comment #31: 

Looks good! :) But it doesn't handle hidden characters (as part of the mask) correctly.

Attached movie uses a movieclip for mask which is visible for 500ms and then hides (in a loop). There is nothing else in the mask.

PP just doesn't care about the visibility. Gnash toggles between circle and square.

Note that the masked graphic with the red/yellow radial gradient is much bigger (about 3/4 of the stage width).

(file #13753)

Udo Giacomozzi <udog>
Group Member
Tue 21 Aug 2007 11:34:07 AM UTC, comment #30: 

Committed a attempt to fix the masks. try cvs-head.

Zou Lunkai <zoulunkai>
Tue 21 Aug 2007 10:12:31 AM UTC, comment #29: 

zou: there's no explicit mask (set by AS or SWF tags)
but I'm thinking that a clean implementation would use
masks internally to make sure text glyphs don't get
rendered outside of the TextField bounds.

Sandro Santilli <strk>
Group Member
Tue 21 Aug 2007 09:26:57 AM UTC, comment #28: 

Attached two more test cases I made for my own a while back.

(file #13750, file #13751)

Udo Giacomozzi <udog>
Group Member
Tue 21 Aug 2007 03:33:48 AM UTC, comment #27: 

strk: what do you mean by your attached file? There are no masks in it.

BTW, any other known testcases for masks?

Zou Lunkai <zoulunkai>
Tue 21 Aug 2007 12:06:56 AM UTC, comment #26: 

Another testcase for nested mask (I belive we need them) is the attached TextField with a growing bound.
The expected behavour is that only the portion of the text masked by the TextField boundary is shown. This would be easy if we support nested mask...

(file #13746, file #13747)

Sandro Santilli <strk>
Group Member
Sun 19 Aug 2007 09:03:27 PM UTC, comment #25: 

I run again autogen.sh and it fixed the problem. Now it compiles fine.

Sorry.

Sergio Costas <rastersoft>
Sun 19 Aug 2007 08:58:36 PM UTC, comment #24: 

Could you file a bug report for the VM.cpp compilation problem ?
Also, could you build from the release_0_8_1 branch ?

Sandro Santilli <strk>
Group Member
Sun 19 Aug 2007 11:22:10 AM UTC, comment #23: 

Sorry again for the delay. I created the simplest example possible: I used a single-page PDF with just a white background, nothing else. With Gnash it shows a black background; with adobe plugin, the right white background.

I tested this only with last week CVS. I updated today but the compilation breaks in VM.cpp (seems related with patch 6155).

(file #13721)

Sergio Costas <rastersoft>
Sun 19 Aug 2007 02:14:55 AM UTC, comment #22: 

I'll take care of the masks this week.

Zou Lunkai <zoulunkai>
Sat 18 Aug 2007 05:13:57 PM UTC, comment #21: 

Since we're at it, there's some masking to test for setMask too, as that's now needed by one of the movies on youtube.com.

Sandro Santilli <strk>
Group Member
Mon 13 Aug 2007 03:24:07 AM UTC, comment #20: 

Using pdf2swf to produce testcases for masks, that's crazy:) It is very difficult to control the details by using pdf2swf. And I have no problem to creat one by Ming, I'll do it later.

BTW, I guess Udog also has no difficulty to produce testcases for himself, what he need is just engough time.


Zou Lunkai <zoulunkai>
Mon 13 Aug 2007 02:39:08 AM UTC, comment #19: 

zou, it seems pdf2swf is part of SWFTools, so should be easy for us to produce a small testcase, and actually also include it in the testsuite and automate it should be easy.

Sandro Santilli <strk>
Group Member
Mon 13 Aug 2007 01:43:46 AM UTC, comment #18: 

Sergio,

we were not sure what caused this bug, so we need a smaller testcase.

I think this should be clear now, as it is related to masks. Of course, it is still good if you can provide a smaller testcase:)

Zou Lunkai <zoulunkai>
Mon 13 Aug 2007 01:09:21 AM UTC, comment #17: 

<i>Sergio, could you produce the smallest possible SWF with pdf2swf to make comparisons between old and new handling easier ?</i>

Sorry for the delay (summer holidays...). Can you be more explicit? I'm not sure about what do you want me to do :?

Sergio Costas <rastersoft>
Fri 10 Aug 2007 02:18:26 PM UTC, comment #16: 

Ok. Zou reverted your patch in the 0.8.1 branch.
This means that in 0.8.1 the background color (this bug) is fixed,
while bug #20527 will still be an issue.

In the head branch, nothing was changed, so the background color (this bug) is still an issue, while bug #20527 is fixed.

Feel free to change this, was just an idea for not introducing
regressions.

Sandro Santilli <strk>
Group Member
Fri 10 Aug 2007 02:12:04 PM UTC, comment #15: 

Ehm, sorry for my ignorance, but which one is the old version now? :)

Udo Giacomozzi <udog>
Group Member
Fri 10 Aug 2007 01:50:28 PM UTC, comment #14: 

I'd keep the old version for 0.8.1 to not introduce a regression.
In head we can skip the reversion and let this background thing fail till we fixed it. So I'll reopen this bug item and assign to Udo.

Sandro Santilli <strk>
Group Member
Fri 10 Aug 2007 11:38:21 AM UTC, comment #13: 

The patch you reverted just makes sure that Gnash remains in a defined state no matter how masks are handled. The old (and now the reverted code) blindly assume that no mask is active while a new mask is "started". The renderers assume that the number of calls to begin_submit_mask() is equal to the number of calls to disable_mask() before rendering of a frame ends (sort of a hierarchy).

AGG will now print again "warning: rendering ended while masks were still active" with such SWF files. Dunno how other renderers deal with this violation.

We still need to find the correct solution but note that my patch wasn't intended to fix the rendering issue, it just had to fix the calls to render_handler::xxxxx_mask().

It was just a side effect that it also fixed rendering for that specific SWF :)

So I suggest that either the patch remains for 0.8.1 or (better) we fix mask handling completely.

I hope I can have a look at it soon, but I'm very busy with lots of other things ATM...

Udo Giacomozzi <udog>
Group Member
Fri 10 Aug 2007 09:49:50 AM UTC, comment #12: 


>> Apparently both solutions are wrong!

Agree.

The reverting just fix this specific case. And we still don't have a 100% correct model for the masks. And no matter with a without this patch, bug #20527 will not be fixed(the rendering). So I did this reverting, just for this bug item and the coming release.

It will be great if you fix both bug items:) Or let's consider bug #20527 after the release.

Zou Lunkai <zoulunkai>
Fri 10 Aug 2007 09:34:22 AM UTC, comment #11: 

Just to avoid confusion: bug #20527 is not specifically about masks, but along the discussion there are some notes about renderer warnings about masks (and incorrect rendering).

Udo Giacomozzi <udog>
Group Member
Fri 10 Aug 2007 09:30:53 AM UTC, comment #10: 

This fixes one bug but breaks bug #20527 again. Apparently both solutions are wrong!

Udo Giacomozzi <udog>
Group Member
Fri 10 Aug 2007 06:01:10 AM UTC, comment #9: 

OK, I commited the fix to 0.8.1, please test.

Zou Lunkai <zoulunkai>
Fri 10 Aug 2007 02:24:26 AM UTC, comment #8: 


I found reverting the changes in dlist.cpp from 1.74 to 1.73 could fix this bug.


Or modify the source in CVS head directly:

dlist.cpp, line 805, 
if (ch->isMask() && !masked) --->  if (ch->isMask())

dlist.cpp, line 816
if (ch->isMask() && !masked) --->  if (ch->isMask())

So, this is bug related to clipDepths or masks.

Zou Lunkai <zoulunkai>
Thu 09 Aug 2007 05:11:22 AM UTC, comment #7: 

Sergio, could you produce the smallest possible SWF with pdf2swf to make comparisons between old and new handling easier ?

Sandro Santilli <strk>
Group Member
Thu 09 Aug 2007 04:34:51 AM UTC, comment #6: 

( ehm... that was 0.8.0 of course )

Sandro Santilli <strk>
Group Member
Thu 02 Aug 2007 02:48:56 PM UTC, comment #5: 

I tried with gnash-0.8.1 and the background is white, so this is a regression.

Sandro Santilli <strk>
Group Member
Thu 02 Aug 2007 02:25:37 PM UTC, comment #4: 

You're right, sorry. I tought the SWF itself didn't contain a SETBACKGROUND tag, but bgtest.swf does...

I tried with ogl, btw, and it works fine for me.

Maybe it's some huge black shape, or an open black fill or something else.

Sandro Santilli <strk>
Group Member
Thu 02 Aug 2007 08:40:26 AM UTC, comment #3: 

Still fails :(

Sergio Costas <rastersoft>
Thu 02 Aug 2007 07:10:06 AM UTC, comment #2: 

file #13547:  bgtest.swf still has a black background for me (current head)

Benjamin Wolsey <bwy>
Group Member
Thu 02 Aug 2007 04:57:50 AM UTC, comment #1: 

Please try again with current head, should be fixed.

Sandro Santilli <strk>
Group Member
Wed 01 Aug 2007 10:24:10 PM UTC, original submission:  

Hi all:

I searched the bug list and I think this is still not submited.

I created some slideshows from PDF files using PDF2SWF (the PDFs were created with OpenOffice.org's Impress), and found this bug: if I use a white background (this is, I don't put a background picture, nor a color gradient, just the slide "as is"), GNASH paints the background in black, so black text and other elements are invisible. Adobe's plugin renders them fine, so I think it's not a PDF2SWF bug.

Tested with AGG and Cairo renderers (I can't use OpenGL in my machine).

I attach some example files: the original PDF and the created SWF.

Sergio Costas <rastersoft>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #13762:  masktest-hide-depth.swf added by udog (6KiB - application/x-shockwave-flash)
file #13763:  masktest-text.swf added by udog (4KiB - application/x-shockwave-flash)
file #13764:  masktest-text-mc.swf added by udog (3KiB - application/x-shockwave-flash)
file #13765:  masktest-text-mc-embed.swf added by udog (5KiB - application/x-shockwave-flash)
file #13756:  mask-hide3.swf added by udog (599B - application/x-shockwave-flash)
file #13755:  mask-hide2-structure.txt added by udog (275B - text/plain)
file #13754:  mask-hide2.swf added by udog (366B - application/x-shockwave-flash)
file #13753:  mask-hide.swf added by udog (307B - application/x-shockwave-flash)
file #13750:  masktest.swf added by udog (4KiB - application/x-shockwave-flash)
file #13751:  masktest-simple.swf added by udog (8KiB - application/x-shockwave-flash)
file #13746:  TextFieldBox.swf added by strk (236B - application/x-shockwave-flash)
file #13747:  TextFieldBox.as added by strk (241B - application/x-applix-spreadsheet)
file #13721:  simplest_test.swf added by rastersoft (216B - application/x-shockwave-flash)
file #13546:  bgtest.pdf added by rastersoft (18KiB - application/pdf)
file #13547:  bgtest.swf added by rastersoft (7KiB - 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 udog (Posted a comment)
  • -email is unavailable- added by zoulunkai (Posted a comment)
  • -email is unavailable- added by bwy (Posted a comment)
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by rastersoft (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 25 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-08-27 zoulunkai StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2007-08-23 strk StatusIn Progress Ready For Test
    2007-08-22 udog Attached File- Added masktest-hide-depth.swf, #13762
        Attached File- Added masktest-text.swf, #13763
        Attached File- Added masktest-text-mc.swf, #13764
        Attached File- Added masktest-text-mc-embed.swf, #13765
    2007-08-21 udog Attached File- Added mask-hide3.swf, #13756
    2007-08-21 udog Attached File- Added mask-hide2-structure.txt, #13755
    2007-08-21 udog Attached File- Added mask-hide2.swf, #13754
    2007-08-21 udog Attached File- Added mask-hide.swf, #13753
        StatusReady For Test In Progress
    2007-08-21 zoulunkai StatusIn Progress Ready For Test
    2007-08-21 udog Attached File- Added masktest.swf, #13750
        Attached File- Added masktest-simple.swf, #13751
    2007-08-21 zoulunkai Assigned toudog zoulunkai
    2007-08-21 strk Attached File- Added TextFieldBox.swf, #13746
        Attached File- Added TextFieldBox.as, #13747
    2007-08-20 strk Severity3 - Normal 4 - Important
    2007-08-19 rastersoft Attached File- Added simplest_test.swf, #13721
    2007-08-10 strk Severity5 - Blocker 3 - Normal
    2007-08-10 strk StatusReady For Test In Progress
        Assigned tostrk udog
        SummarySWFs without &quot;background&quot; puts a black bg instead of white SWFs without "background" puts a black bg instead of white [head]
    2007-08-10 zoulunkai StatusConfirmed Ready For Test

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code