Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.awt.Componet.setIgnoreRepaint( true ) prevents repaint dispatching #1811

Closed
ghost opened this issue Jul 13, 2014 · 1 comment
Closed

Comments

@ghost
Copy link

ghost commented Jul 13, 2014

While working on developing an off-screen renderer which uses page-flipping, I encountered an unexpected behavior where calling:

Component.setIgnoreRepaint( true )

on the rendering target would prevent Ruby from dispatching calls to repaint(). To elaborate, the renderloop code repeatedly requests to repaint the rendering target (or the "surface") at no more than 60 frames per second. In order to keep track of page flipping (and performance) the surface internally tracks its current frame number.

So long as setIgnoreRepaint() was set to true, all Ruby-side invocations of the repaint() method would terminate before being processed and no frame number was incremented. This appears to have affected the initial painting of the surface as well, despite that being an AWT invocation.

When the method call to setIgnoreRepaint() was commented out or set to false, all repaint calls completed successfully, evidenced by the incrementation of the frame counter.

The current behavior appears to be in defiance of that stated in Component.setIgnoreRepaint(), reproduced below:

 public void setIgnoreRepaint(boolean ignoreRepaint)

Sets whether or not paint messages received from the operating system should be ignored. This does not affect paint events generated in software by the AWT, unless they are an immediate response to an OS-level paint message.

This is useful, for example, if running under full-screen mode and better performance is desired, or if page-flipping is used as the buffer strategy.

Identified while using jruby 1.7.13 (2.0.0p195) 2014-06-24 43f133c on Java HotSpot(TM) 64-Bit Server VM 1.8.0_05-b13 +indy [Windows 7-amd64]

@kares
Copy link
Member

kares commented Apr 9, 2016

sounds like an AWT issue - Ruby does not do anything special graphics related.
let us know if I misunderstood and JRuby is really to blame ...

@kares kares closed this as completed Apr 9, 2016
@kares kares added this to the Invalid or Duplicate milestone Apr 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant