Bugzilla – Attachment 340 Details for
Bug 555
Embedding NEWT canvas into Applet object doesn't allow to set framerate on OSX
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch file for MacOSXCGLContext.java
MacOSXCGLContext.java.patch (text/plain), 1.74 KB, created by
ac
on 2012-03-15 20:53:32 CET
(
hide
)
Description:
Patch file for MacOSXCGLContext.java
Filename:
MIME Type:
Creator:
ac
Created:
2012-03-15 20:53:32 CET
Size:
1.74 KB
patch
obsolete
>*** MacOSXCGLContext.java.repo 2012-03-15 15:23:08.000000000 -0400 >--- MacOSXCGLContext.java 2012-03-15 15:28:42.000000000 -0400 >*************** >*** 396,401 **** >--- 396,402 ---- > class NSOpenGLImpl implements GLBackendImpl { > long nsOpenGLLayer = 0; > long nsOpenGLLayerPFmt = 0; >+ int vsyncTimeout = 16; > > public boolean isNSContext() { return true; } > >*************** >*** 555,567 **** > CGL.setNSOpenGLLayerSwapInterval(nsOpenGLLayer, interval); > } > CGL.setSwapInterval(contextHandle, interval); > return true; > } > > public boolean swapBuffers() { > if(0 != nsOpenGLLayer) { > // sync w/ CALayer renderer - wait until next frame is required (v-sync) >! CGL.waitUntilNSOpenGLLayerIsReady(nsOpenGLLayer, 16); // timeout 16ms -> 60Hz > } > if(CGL.flushBuffer(contextHandle)) { > if(0 != nsOpenGLLayer) { >--- 556,577 ---- > CGL.setNSOpenGLLayerSwapInterval(nsOpenGLLayer, interval); > } > CGL.setSwapInterval(contextHandle, interval); >+ if (interval == 0) { >+ // v-sync is disabled, so setting the timeout to a minimum >+ // of ms (which corresponds to 500fps). >+ vsyncTimeout = 2; >+ } else { >+ // v-sync is enabled. Swaping interval of 1 means a >+ // timeout of 16ms -> 60Hz, 60fps >+ vsyncTimeout = interval * 16; >+ } > return true; > } > > public boolean swapBuffers() { > if(0 != nsOpenGLLayer) { > // sync w/ CALayer renderer - wait until next frame is required (v-sync) >! CGL.waitUntilNSOpenGLLayerIsReady(nsOpenGLLayer, vsyncTimeout); > } > if(CGL.flushBuffer(contextHandle)) { > if(0 != nsOpenGLLayer) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 555
:
328
|
330
|
331
| 340 |
345