< prev index next >

modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/PaintCollector.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -176,10 +176,17 @@
      */
     final boolean hasDirty() {
         return hasDirty;
     }
 
+    final void setDirty(boolean value) {
+        hasDirty = value;
+        if (hasDirty) {
+            QuantumToolkit.getToolkit().requestNextPulse();
+        }
+    }
+
     /**
      * Adds a dirty scene to the PaintCollector for subsequent processing.
      * This method simply makes the PaintCollector aware of this new
      * scene and ensure it gets processed on the next call to renderAll.
      *

@@ -207,11 +214,11 @@
         // scenes that simple iteration is likely to be much faster
         if (!dirtyScenes.contains(scene)) {
             dirtyScenes.add(scene);
             // Now that we know we have added a scene to dirtyScenes,
             // we should ensure hasDirty is true.
-            hasDirty = true;
+            setDirty(true);
         }
     }
 
     /**
      * Removes a scene from the dirtyScene list. If the given scene

@@ -239,11 +246,11 @@
         }
 
         // Remove the scene
         dirtyScenes.remove(scene);
         // Update hasDirty
-        hasDirty = !dirtyScenes.isEmpty();
+        setDirty(!dirtyScenes.isEmpty());
     }
 
     /**
      * Gets the CompletionListener which must be notified when a
      * GlassScene has completed rendering.

@@ -359,11 +366,11 @@
         // synchronous or not. If they are not synchronous,
         // then we want to process them first.
         Collections.sort(dirtyScenes, DIRTY_SCENE_SORTER);
 
         // Reset the fields
-        hasDirty = false;
+        setDirty(false);
         needsHint = false;
 
         // If pulse logging is enabled, then we must call renderStart
         // BEFORE we actually call repaint on any of the dirty scenes.
         if (PULSE_LOGGING_ENABLED) {
< prev index next >