~vanvugt/mir/test-abi-break-2

« back to all changes in this revision

Viewing changes to benchmarks/frame-uniformity/touch_measuring_client.cpp

  • Committer: Tarmac
  • Author(s): Alexandros Frantzis
  • Date: 2015-04-30 21:13:15 UTC
  • mfrom: (2526.1.1 migrate-to-surface-spec)
  • Revision ID: tarmac-20150430211315-9vsfhs2pl1dcy380
Migrate to new surface creation API.

Approved by Alberto Aguirre, PS Jenkins bot, Kevin DuBois, Alan Griffiths.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    MirPixelFormat pixel_format;
35
35
    unsigned int valid_formats;
36
36
    mir_connection_get_available_surface_formats(connection, &pixel_format, 1, &valid_formats);
37
 
    MirSurfaceParameters const surface_params = { "frame-uniformity-test",
38
 
        1024, 1024, /* TODO: Ensure fullscreen? */
39
 
        pixel_format,
40
 
        mir_buffer_usage_hardware, 
41
 
        mir_display_output_id_invalid};
 
37
 
 
38
    auto const spec = mir_connection_create_spec_for_normal_surface(
 
39
        connection, 1024, 1024, pixel_format);
 
40
    mir_surface_spec_set_name(spec, "frame-uniformity-test");
 
41
    mir_surface_spec_set_buffer_usage(spec, mir_buffer_usage_hardware);
 
42
 
 
43
    auto surface = mir_surface_create_sync(spec);
 
44
    mir_surface_spec_release(spec);
42
45
    
43
 
    auto surface = mir_connection_create_surface_sync(connection, &surface_params);
44
46
    if (!mir_surface_is_valid(surface))
45
47
    {
46
48
        std::cerr << "Surface creation failed: " << mir_surface_get_error_message(surface) << std::endl;