Closed Bug 558350 Opened 15 years ago Closed 15 years ago

[OOPP] CoreGraphics stops receiving InvalidateRect when the object is on a subpixel

Categories

(Core Graveyard :: Plug-ins, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: BenWa, Assigned: BenWa)

References

Details

When the browser window is above a certain size (above 720 lines) it appears that the Flash stops sending invalidatingRect. Resizing the screen down causes these events to start firing again.
Assignee: nobody → bgirard
So I traced back the problem to nsDisplayPlugin::mVisibleRect. When redrawing the plug-in I get: Plugin Rect (272, 50, 640, 385) Dirty Rect (271, 95, 1, 270) We get an empty intersection so the plug-in does keeps waiting for the NPCocoaEventDraw and stops refreshing. Also the X coordinate in the dirty rect is off by 1 for nearly every call. It is likely that this bug is causing the white vertical lines when repainting.
I think bug 556052 is the bug about the off-by-one rect.
The cause of the problem is: http://mxr.mozilla.org/mozilla-central/source/gfx/public/nsRect.h#341 When the window is larger we are dealing with larger values of X. The conversion from AppUnitsPerPixel must be a bit lower then the true value thus for large values of X the error become significant. Thus when we take the floor : NSToIntFloor(NSAppUnitsToFloatPixels(x, float(aAppUnitsPerPixel))); we end up clipping one pixel lower. nsRect::ToOutsidePixels is used to calculate the dirty rect but since the value x value is off by -1, the x+width is also off by -1 causing bug 556052. This bug here is caused when we try to draw a rect of width 1, since x+width is off by -1 it is completely outside the range we want to draw. When we take the intersection of the content rect and dirty rect we get a redraw region of width 0. Sending a NPCocoaEventDraw with width 0 causes the plug-in to stop firing InvalidateRect, presumably waiting for a correct NPCocoaEventDraw.
Depends on: 556052
Summary: [OOPP] CoreGraphics stops receiving InvalidateRect when the window size is large → [OOPP] CoreGraphics stops receiving InvalidateRect when the object is on a subpixel
The fix for bug 556052 landed yesterday. This bug no longer occurs on the nightly.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
I've ran into this problem again so in case someone else is seeing this, is it likely that the user is running an older version of the Flash Beta.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.