jdk/src/share/classes/javax/swing/JViewport.java
changeset 23280 df31f522531f
parent 22574 7f8ce0c8c20a
child 23328 4c53a6ebc779
--- a/jdk/src/share/classes/javax/swing/JViewport.java	Fri Jan 31 14:20:40 2014 +0400
+++ b/jdk/src/share/classes/javax/swing/JViewport.java	Fri Jan 31 18:49:58 2014 +0400
@@ -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
@@ -364,18 +360,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 <code>Rectangle</code>
      * within the view becomes visible.
@@ -1109,13 +1093,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());
                         g.dispose();
+                        rm.notifyRepaintPerformed(this, r.x, r.y, r.width, r.height);
                         rm.markCompletelyClean((JComponent)getParent());
                         rm.markCompletelyClean(this);
                         rm.markCompletelyClean(jview);