< prev index next >
modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/PaintCollector.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2010, 2015, 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
--- 1,7 ----
/*
! * 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,185 ****
--- 176,192 ----
*/
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,217 ****
// 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;
}
}
/**
* Removes a scene from the dirtyScene list. If the given scene
--- 214,224 ----
// 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.
! setDirty(true);
}
}
/**
* Removes a scene from the dirtyScene list. If the given scene
*** 239,249 ****
}
// Remove the scene
dirtyScenes.remove(scene);
// Update hasDirty
! hasDirty = !dirtyScenes.isEmpty();
}
/**
* Gets the CompletionListener which must be notified when a
* GlassScene has completed rendering.
--- 246,256 ----
}
// Remove the scene
dirtyScenes.remove(scene);
// Update hasDirty
! setDirty(!dirtyScenes.isEmpty());
}
/**
* Gets the CompletionListener which must be notified when a
* GlassScene has completed rendering.
*** 359,369 ****
// 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;
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) {
--- 366,376 ----
// synchronous or not. If they are not synchronous,
// then we want to process them first.
Collections.sort(dirtyScenes, DIRTY_SCENE_SORTER);
// Reset the fields
! 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 >