<AWT Dev> [8] Review request for 7142091: [macosx] RFE: Refactoring of peer initialization/disposing
Artem Ananiev
artem.ananiev at oracle.com
Mon Jun 18 08:13:46 PDT 2012
Hi, Sergey,
some minor comments (may be unrelated to the fix):
1. LWComponentPeer.setVisible() can be made final. Do expect any
subclass to override it instead of setVisibleImpl()?
2. invokeLater() in LWWindowPeer.setVisibleImpl(): I realize this is
really painful issue, but I'd vote for removing this workaround. It
would result in faster startup (although, the window will be solid gray
for some time), and make LWAWT code similar to what we have on other
platforms.
Then next step will to minimize the delay between showing the window and
painting its content.
3. LWWindowPeer.replaceSurfaceData(): what are benefits of
setBackground() + clearRect() over setColor() + fillRect()? Although we
always expect the Graphics object to be Graphics2D instance, this
unconditional cast doesn't look great.
Thanks,
Artem
On 5/31/2012 5:43 PM, Sergey Bylokhov wrote:
> Hi Everyone,
> Please review the fix.
>
> Notes from the bug and comments:
> 1. setVisible() should be called at the end of the peers initialization.
> We can move super.initialize() to the end of the peers initializations.
> Initialize() was split to initialize() and initializeImpl(). In the
> initialize() we call initializeImpl and then we call to setVisible().
> initializeImpl overridden in subclasses.
>
> 2. Invokelater in the initialization/disposing is a tricky.
> Left it as is. Probably later it will be changed. Comments was updated.
>
> 3. replaceSurfacedata() should be moved outside of
> LWWindowPeer.setVisible()
> Done. Also duplicate code was extracted to setVisible() method which
> call setVisibleImpl().
>
> 4. Backbuffer in replaceSurfacedata() should be initialized by clearRect
> instead of fillrect(composite is important).
> Done. related to composite.
>
> 5. During lwwindowpeer initialization we call two similar methods
> nativeSetNSWindowAlpha() and setAlphaValue().
> nativeSetNSWindowAlpha() removed from CPlatformWindow.java.
>
>
> Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7142091
> Webrev can be found at: http://cr.openjdk.java.net/~serb/7142091/webrev.00/
>
More information about the awt-dev
mailing list