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

Print this page
rev 6142 : RT-35355 [Monocle] Software rendering ports of Monocle need notification of pixel upload end


 282         // counter to be notified when a scene has been rendered. We
 283         // could reduce the class count and indirection if we had a more
 284         // direct method for notifying some performance tracker rather
 285         // than going through this round-about way.
 286         scene.frameRendered();
 287 
 288         // Work to be done after all rendering is completed. Note that
 289         // I check against "1" to indicate all rendering is done, and
 290         // only decrement the allWorkCompletedLatch after wards. This is
 291         // because as soon as I decrement the allWorkCompletedLatch to 0,
 292         // then whatever code remains in this method will run concurrently
 293         // with the FX app thread, and I'd prefer to minimize the number
 294         // of things here that could be happening in parallel.
 295         if (allWorkCompletedLatch.getCount() == 1) {
 296             // In some cases we need to tell the toolkit that
 297             // now would be a great time to vsync! 
 298             if (needsHint && !toolkit.hasNativeSystemVsync()) {
 299                 toolkit.vsyncHint();
 300             }
 301 





 302             // If pulse logging is enabled, then we must call renderEnd now
 303             // that we know that all of the scene's being rendered are finished
 304             if (PULSE_LOGGING_ENABLED) {
 305                 PULSE_LOGGER.renderEnd();
 306             }
 307         }
 308 
 309         // Count down the latch, indicating that drawing has
 310         // completed for some scene.
 311         allWorkCompletedLatch.countDown();
 312     }
 313 
 314     /**
 315      * Run a full pulse and repaint before returning.
 316      */
 317     final void liveRepaintRenderJob(final ViewScene scene) {
 318          ViewPainter viewPainter = scene.getPainter();
 319          QuantumToolkit quantum = (QuantumToolkit)QuantumToolkit.getToolkit();
 320          quantum.pulse(false);
 321          final CountDownLatch latch = new CountDownLatch(1);




 282         // counter to be notified when a scene has been rendered. We
 283         // could reduce the class count and indirection if we had a more
 284         // direct method for notifying some performance tracker rather
 285         // than going through this round-about way.
 286         scene.frameRendered();
 287 
 288         // Work to be done after all rendering is completed. Note that
 289         // I check against "1" to indicate all rendering is done, and
 290         // only decrement the allWorkCompletedLatch after wards. This is
 291         // because as soon as I decrement the allWorkCompletedLatch to 0,
 292         // then whatever code remains in this method will run concurrently
 293         // with the FX app thread, and I'd prefer to minimize the number
 294         // of things here that could be happening in parallel.
 295         if (allWorkCompletedLatch.getCount() == 1) {
 296             // In some cases we need to tell the toolkit that
 297             // now would be a great time to vsync! 
 298             if (needsHint && !toolkit.hasNativeSystemVsync()) {
 299                 toolkit.vsyncHint();
 300             }
 301 
 302             Runnable renderEndNotifier = Application.GetApplication().getRenderEndNotifier();
 303             if (renderEndNotifier != null) {
 304                 Application.invokeLater(renderEndNotifier);
 305             }
 306 
 307             // If pulse logging is enabled, then we must call renderEnd now
 308             // that we know that all of the scene's being rendered are finished
 309             if (PULSE_LOGGING_ENABLED) {
 310                 PULSE_LOGGER.renderEnd();
 311             }
 312         }
 313 
 314         // Count down the latch, indicating that drawing has
 315         // completed for some scene.
 316         allWorkCompletedLatch.countDown();
 317     }
 318 
 319     /**
 320      * Run a full pulse and repaint before returning.
 321      */
 322     final void liveRepaintRenderJob(final ViewScene scene) {
 323          ViewPainter viewPainter = scene.getPainter();
 324          QuantumToolkit quantum = (QuantumToolkit)QuantumToolkit.getToolkit();
 325          quantum.pulse(false);
 326          final CountDownLatch latch = new CountDownLatch(1);