bugGnash - The GNU Flash player - Bugs: bug #19683, Wrong invalidated bounds when...

 
 

bug #19683: Wrong invalidated bounds when using drawing API

Submitted by:  Udo Giacomozzi <udog>
Submitted on:  Tue 24 Apr 2007 12:07:41 PM UTC  
 
Category: ActionScriptSeverity: 3 - Normal
Release: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sat 12 May 2007 07:15:00 AM UTC, comment #8:

Adding your last comment inside implementation of character::set_invalidated would make it clearer :)

Sandro Santilli <strk>
Project Member
Fri 04 May 2007 08:05:01 AM UTC, comment #7:

I confirm it works now.

Re old_invalidated: That's exactly how it is meant to be. "old_invalidated" stores the bounds of the character before it has been changed, ie. the position when set_invalidated() is being called. While drawing, both the old and the new bounds are updated. When moving a character A to B then both the position A needs to be re-rendered (to reveal the backgrond) and the position B needs to be re-rendered (to show the character in it's new position). The bounds may be identical or overlap, but SnappingRanges takes care of that.

add_invalidated_bounds() adds the bounds of the character to the passed parameter (not vice-versa). It returns the "union" of old_invalidated_bounds (which in this case is Null) and the current bounds. So the effect is to set old_invalidated_bounds to the current character position.

add_invalidated_bounds() is used again later when the GUI asks for the real invalidated bounds and in that moment old_invalidated_bounds is important.

I hope I could make this clear now :)

Udo Giacomozzi <udog>
Project Member
Thu 03 May 2007 07:10:01 PM UTC, comment #6:

committed a patch for this. I'll need to add automated test for this case (DrawingApiTest.as should be a good place for this)

Sandro Santilli <strk>
Project Member
Thu 03 May 2007 05:42:04 PM UTC, comment #5:

Actually, this seems related to the "child-invalidated" thing.
Apply this patch to your example:

- mc = this.createEmptyMovieClip("test", 5);
+ mc = _root;

and you can see thing works.
The problem here is that createEmptyMovieClip() is likely
replacing the old child.

Sandro Santilli <strk>
Project Member
Thu 03 May 2007 05:29:53 PM UTC, comment #4:

Ok, I confirm the bug.
I see that character::set_invalidated resets old_invalidated
before calling add_invalidated_bounds again to refill it.
And sprite_instance::add_invalidated_bounds occasionally
adds old_invalidated_bounds too.
Seems confusing, as old_invalidated_bounds have been reset
so can't add anything !

Sandro Santilli <strk>
Project Member
Thu 03 May 2007 08:57:05 AM UTC, comment #3:

Nope, still not drawing correctly.

Just launch that movie in the player and watch the result (make sure it is looped!). You see that the background is erased only around the thin line and the thick line is still visible in the lower right part.

This means (my strong feeling) that set_invalided() is called after the thin line got defined (lineTo() in AS) - when looping back to frame 1.

So set_invalidated() catches the bounds of the thin line (instead of thick line that is about to disappear) and only that part of the stage is redrawn.

When mc.clear() (or any other drawing function) is called it must call set_invalidated() somehow before actually changing the definition.

Udo Giacomozzi <udog>
Project Member
Fri 27 Apr 2007 01:07:50 PM UTC, comment #2:

Added automated testing to DrawingApi, all succeeds, and the previous bug was a completely different issue ('this' pointer in function and 'with' context).

The DrawingApiTestRunner.cpp file now contains test for both invalidated bounds and actual rendering.

The only issue with it is that if I don't set the invalidated bounds to WORLD before actualy calling the renderer, then I get failures with pixel checking. Worth taking a look.

Sandro Santilli <strk>
Project Member
Wed 25 Apr 2007 09:24:31 AM UTC, comment #1:

The drawing API calls set_invalidated() indeed, but I confirm the bug. A test (not automated) is now in DrawingApiTest.swf, check it out, and if you feel brave add automated testing :)

Sandro Santilli <strk>
Project Member
Tue 24 Apr 2007 12:07:41 PM UTC, original submission:

Drawing API seems not to call invalidated() before changing the dynamic shape.

Actionscript code to show this bug:

////////////////////////// frame 1 ////////////////////

mc = this.createEmptyMovieClip("test", 5);

mc.clear();
mc.lineStyle(1, 0xFF0000);

mc.moveTo(0,0);
mc.lineTo(50,50);

////////////////////////// frame 2 ////////////////////

mc.clear();
mc.lineStyle(100, 0xFF0000);

mc.moveTo(0,0);
mc.lineTo(50,50);

Udo Giacomozzi <udog>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by udog (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 12 May 2007 07:15:00 AM UTCstrkStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Thu 03 May 2007 07:10:01 PM UTCstrkStatusConfirmed=>Ready For Test
    Thu 03 May 2007 05:29:53 PM UTCstrkStatusReady For Test=>Confirmed
    Wed 02 May 2007 11:12:03 PM UTCstrkStatusConfirmed=>Ready For Test
    Wed 25 Apr 2007 09:24:31 AM UTCstrkStatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1