--- old/src/share/classes/javax/swing/JViewport.java 2014-01-31 11:50:58.000000000 +0400 +++ new/src/share/classes/javax/swing/JViewport.java 2014-01-31 11:50:57.000000000 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,8 +25,6 @@ package javax.swing; -import sun.swing.JLightweightFrame; - import java.awt.*; import java.awt.event.*; import java.awt.peer.ComponentPeer; @@ -37,10 +35,8 @@ import javax.swing.border.*; import javax.accessibility.*; - import java.io.Serializable; - /** * The "viewport" or "porthole" through which you see the underlying * information. When you scroll, what moves is the viewport. It is like @@ -363,18 +359,6 @@ super.remove(child); } - @Override - public void addNotify() { - super.addNotify(); - // JLightweightFrame does not support BLIT_SCROLL_MODE, so it should be replaced - Window rootWindow = SwingUtilities.getWindowAncestor(this); - if (rootWindow instanceof JLightweightFrame - && getScrollMode() == BLIT_SCROLL_MODE) { - setScrollMode(BACKINGSTORE_SCROLL_MODE); - } - } - - /** * Scrolls the view so that Rectangle * within the view becomes visible. @@ -1108,13 +1092,15 @@ Graphics g = JComponent.safelyGetGraphics(this); flushViewDirtyRegion(g, dirty); view.setLocation(newX, newY); - g.setClip(0,0,getWidth(), Math.min(getHeight(), - jview.getHeight())); + Rectangle r = new Rectangle( + 0, 0, getWidth(), Math.min(getHeight(), jview.getHeight())); + g.setClip(r); // Repaint the complete component if the blit succeeded // and needsRepaintAfterBlit returns true. repaintAll = (windowBlitPaint(g) && - needsRepaintAfterBlit()); + needsRepaintAfterBlit()); g.dispose(); + rm.notifyRepaintPerformed(this, r.x, r.y, r.width, r.height); rm.markCompletelyClean((JComponent)getParent()); rm.markCompletelyClean(this); rm.markCompletelyClean(jview);