~vanvugt/mir/frametime

« back to all changes in this revision

Viewing changes to examples/eglapp.c

  • Committer: Tarmac
  • Author(s): Daniel van Vugt
  • Date: 2014-09-10 12:50:53 UTC
  • mfrom: (1790.2.4 no-examples-fps)
  • Revision ID: tarmac-20140910125053-zo3xppgfftdkr1f0
Remove FPS output from examples/*. A more accurate and useful
measure of FPS is now available to all clients by:
    env MIR_CLIENT_PERF_REPORT=log anyclient.

Approved by PS Jenkins bot, Alexandros Frantzis, Alberto Aguirre.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
 
71
71
void mir_eglapp_swap_buffers(void)
72
72
{
73
 
    static time_t lasttime = 0;
74
 
    static int lastcount = 0;
75
 
    static int count = 0;
76
 
    time_t now = time(NULL);
77
 
    time_t dtime;
78
 
    int dcount;
79
73
    EGLint width, height;
80
74
 
81
75
    if (!running)
83
77
 
84
78
    eglSwapBuffers(egldisplay, eglsurface);
85
79
 
86
 
    count++;
87
 
    dcount = count - lastcount;
88
 
    dtime = now - lasttime;
89
 
    if (dtime)
90
 
    {
91
 
        printf("%d FPS\n", dcount);
92
 
        lasttime = now;
93
 
        lastcount = count;
94
 
    }
95
 
 
96
80
    /*
97
81
     * Querying the surface (actually the current buffer) dimensions here is
98
82
     * the only truly safe way to be sure that the dimensions we think we
276
260
                    cursor_name = argv[++i];
277
261
                    break;
278
262
                case 'q':
279
 
                    {
280
 
                        FILE *unused = freopen("/dev/null", "a", stdout);
281
 
                        (void)unused;
282
 
                        break;
283
 
                    }
 
263
                    /* Deprecated. Ignore. */
 
264
                    break;
284
265
                case 'h':
285
266
                default:
286
267
                    help = 1;
303
284
                       "  -m socket        Mir server socket\n"
304
285
                       "  -s WIDTHxHEIGHT  Force surface size\n"
305
286
                       "  -c name          Request cursor image by name\n"
306
 
                       "  -q               Quiet mode (no messages output)\n"
307
287
                       , argv[0]);
308
288
                return 0;
309
289
            }