performance improvement, lock free render

This commit is contained in:
Eduardo Bart
2012-04-12 11:26:32 -03:00
parent 04c2e1d245
commit a46a16738c
4 changed files with 23 additions and 19 deletions

View File

@@ -793,12 +793,24 @@ void X11Window::poll()
void X11Window::swapBuffers()
{
#if 0
auto now = std::chrono::high_resolution_clock::now();
auto gpuStart = now;
static decltype(now) cpuStart;
int cpu = std::chrono::duration_cast<std::chrono::nanoseconds>(now - cpuStart).count();
#endif
#ifndef OPENGL_ES2
glFinish();
glXSwapBuffers(m_display, m_window);
#else
eglSwapBuffers(m_eglDisplay, m_eglSurface);
#endif
#if 0
now = std::chrono::high_resolution_clock::now();
int gpu = std::chrono::duration_cast<std::chrono::nanoseconds>(now - gpuStart).count();
cpuStart = now;
dump << "cpu" << cpu << "gpu" << gpu;
#endif
}
void X11Window::showMouse()