~ci-train-bot/mir/mir-ubuntu-zesty-2609

« back to all changes in this revision

Viewing changes to examples/eglplasma.c

  • Committer: Bileto Bot
  • Date: 2016-08-15 16:28:40 UTC
  • mfrom: (1160.2357.136 0.24)
  • Revision ID: ci-train-bot@canonical.com-20160815162840-98t95gfrcymlrwpc
* New upstream release 0.24.0 (https://launchpad.net/mir/+milestone/0.24.0)
  - ABI summary:
    . mirclient ABI unchanged at 9
    . mirserver ABI bumped to 41
    . mircommon ABI unchanged at 6
    . mirplatform ABI bumped to 12
    . mirprotobuf ABI unchanged at 3
    . mirplatformgraphics ABI bumped to 10
    . mirclientplatform ABI unchanged at 5
    . mirinputplatform ABI unchanged at 5
  - Enhancements:
    . Added a new tool 'mirvanity' which can use a high speed video camera
      to measure client-to-screen latency.
    . Added (build-time) support for desktop full OpenGL servers (disabled
      by default in favor of GLESv2).
    . Introduced new buffer semantics (NBS) and enabled it by default.
    . Avoided using libmirserver in mir_demo_standalone_render_overlays,
      making bringup traces less cluttered.
    . Removed TilingWindowManager from example servers.
    . Added two new mir_*_performance_test tools that are run as part of
      'mir_performance_tests'.
    . Added pointer confinement to the client API.
    . Added new platform supporting software EGLStreams.
    . Added an input platform that the nested server can use.
    . Allow configuration of the application_not_responding_detector
    . Handle server-side keymapping using XKBMapper.
    . Remove the offscreen display.
    . Add callback option to notify shells that the server is about to stop.
    . Add logging for ANativeWindow events on Android.
  - Bugs fixed:
    . usage of std:call_once in mirclient causes TLS collisions with some
      android devices (LP: #1599867)
    . AltGr not working on external keyboards (LP: #1565236)
    . [regression] unity8 fails to start when built with 0.24 series (lp:mir)
      (LP: #1597717)
    . CI failure in MirSurfaceVisibilityEvent.exposed_received_when_surface_
      raised_over_occluding_surface [called twice - over-saturated and active]
      (LP: #1556045)
    . package-built mir_demo_server does not start on device (LP: #1577357)
    . During surface creation, first stream in spec becomes default stream.
      (LP: #1577967)
    . mouse is getting stuck on a phantom edge (LP: #1580774)
    . [testsfail] in MirSurfaceVisibilityEvent.exposed_received_when_surface_
      raised_over_occluding_surface [never called] (LP: #1581385)
    . [enhancement] Add support for full OpenGL compositing (LP: #1420581)
    . [testsfail] ServerSignal.terminate_handler_is_called_for_SIGINT|SIGTERM
      (LP: #1570353)
    . [testsfail] ClientLatency.triple_buffered_client_has_less_than_two_
      frames_latency (LP: #1576690)
    . [testsfail] NestedServer.when_monitor_plugged_in_client_is_notified_of_
      new_display_configuration (LP: #1576760)
    . mir server crashed in what(): drmModeMoveCursor failed (returned -13)
      (LP: #1579630)
    . mirtest-dev is hard to use as the objects used are compiled with LTO
      (LP: #1583536)
    . [testsfail] ClientLogging.reports_performance [Value of: lag]
      (LP: #1583970)
    . [ FAILED ] ClientLogging.reports_performance (Value of: nbuffers)
      (LP: #1584603)
    . [ FAILED ] ClientLogging.reports_performance (Value of: render)
      (LP: #1584605)
    . ClientCredsTestFixture.session_authorizer_receives_pid_of_connecting_
      clients failure (LP: #1587604)
    . Mir on X11 ignores mir::graphics::GLConfig depth & stencil buffer size
      (LP: #1589632)
    . Need to support pointer confinement (LP: #1590099)
    . [tests] given_nested_server_set_base_display_configuration_when_
      monitor_plugged_in_configuration_is_reset fails (LP: #1591354)
    . CI failure in DemoInProcessServerWithStubClientPlatform.surface_
      creation_does_not_leak_fds (LP: #1598802)
    . Screen is squashed/distorted when rotated in Mir-on-X11 (LP: #1577262)
    . --display-report=log shows some invalid uninitialized EGL attribute
      values (LP: #1582066)
    . mir_demo_client_eglplasma falls back to software rendering on i915
      (Intel Atoms), which explains why it's so slow (LP: #1583532)
    . [regression] x11 platform only draws to a small part of the x11 window
      (LP: #1598267)
    . mir ftbfs in yakkety builders (LP: #1600343)
    . Autolanding keeps failing: mock_egl.h:89:7: error: type 'struct
      MockEGL' violates one definition rule [-Werror=odr] (LP: #1603303)
    . [regression] The Super/Windows key doesn't work any more (LP: #1602966)
    . mir_acceptance_tests.bin: double free or corruption (fasttop)
      (LP: #1603114)
    . ftbfs in linking libmir-test-assist.a in xenial+overlay and
      yakkety+overlay (LP: #1601810)
    . [testsfail] failure in NestedInput.on_input_device_state_nested_*
      (LP: #1602646)  
    . mirtest-dev provides an incorrect .pc file (LP: #1603080)
    . mir_test_framework::server_platform_path(), 
      mir_test_framework::server_platform() don't support use in a downstream
      test built against mir-test-assist (LP: #1603091)
    . Servers based on Mir need a hook to execute code when the server is
      closing (LP: #1593655)
    . Android graphics platform doesn't get packaged for arm64 (LP: #157866)
    . memory leaks in unit tests on android (LP: #1253486)
    . Physical "screen" size reported by the X11 backend is same as pixel
      count, fixing dpi to 25.4 (LP: #1596051)
    . Mir build and test failures with gcc-6 and LTO (LP: #1610215)
    . [regression] Trust prompt not shown when starting camera (LP: #1612256)
* No-change rebuild for boost soname change.
    . unity8/libmirclient gives up and terminates prematurely with
      "std::exception::what: disconnected: no new buffers" via
      ExchangeSemantics::submit() (LP: #1506358)

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
 
62
62
    const char fshadersrc[] =
63
63
        "precision mediump float;                                \n"
64
 
        "uniform float theta;                                    \n"
 
64
        "uniform vec4 theta;                                     \n"
65
65
        "varying vec2 texcoord;                                  \n"
66
66
        "uniform vec3 low_color, high_color;                     \n"
67
67
        "                                                        \n"
68
 
        "vec3 gradient(float x)                                  \n"
69
 
        "{                                                       \n"
70
 
        "    vec3 col;                                           \n"
71
 
        "    const vec3 white = vec3(1.0, 1.0, 1.0);             \n"
72
 
        "    if (x < 0.333)                                      \n"
73
 
        "        col = x * low_color / 0.333;                    \n"
74
 
        "    else if (x < 0.666)                                 \n"
75
 
        "        col = (x - 0.333) * (high_color - low_color) /  \n"
76
 
        "              0.333 + low_color;                        \n"
77
 
        "    else                                                \n"
78
 
        "        col = (x - 0.666) * (white - high_color) /      \n"
79
 
        "              0.333 + high_color;                       \n"
80
 
        "    return col;                                         \n"
81
 
        "}                                                       \n"
82
 
        "                                                        \n"
83
68
        "void main()                                             \n"
84
69
        "{                                                       \n"
85
70
        "    const float pi2 = 6.283185308;                      \n"
86
 
        "    float u = texcoord.x * pi2;                         \n"
87
 
        "    float v = texcoord.y * pi2;                         \n"
88
 
        "    float us = (cos(1.1 * u + 7.0 * theta) +            \n"
89
 
        "                cos(2.3 * v * cos(1.0 * theta)) +       \n"
90
 
        "                cos(0.3 * u * cos(3.0 * theta))         \n"
91
 
        "               ) / 3.0;                                 \n"
92
 
        "    float vs = (cos(2.3 * v + 8.0 * theta) +            \n"
93
 
        "                cos(1.3 * u * cos(3.0 * theta)) +       \n"
94
 
        "                cos(1.7 * v * cos(2.0 * theta))         \n"
95
 
        "               ) / 3.0;                                 \n"
96
 
        "    float x = (us * vs + 1.0) / 2.0;                    \n"
97
 
        "    gl_FragColor = vec4(gradient(x), 1.0);              \n"
 
71
        "    float x = texcoord.x * pi2;                         \n"
 
72
        "    float y = texcoord.y * pi2;                         \n"
 
73
        "    float a = cos(1.0 * (x + theta.x));                 \n"
 
74
        "    float b = cos(2.0 * (y + theta.y + a));             \n"
 
75
        "    float c = cos(2.0 * (2.0*x + theta.z + b));         \n"
 
76
        "    float d = cos(1.0 * (3.0*y + theta.w + c));         \n"
 
77
        "    float v = (a+b+c+d + 4.0) / 8.0;                    \n"
 
78
        "    vec3 color = v * (high_color - low_color) +         \n"
 
79
        "                 low_color;                             \n"
 
80
        "    gl_FragColor = vec4(color, 1.0);                    \n"
98
81
        "}                                                       \n";
99
82
 
100
83
    const GLfloat vertices[] =
108
91
    GLuint vshader, fshader, prog;
109
92
    GLint linked, low_color, high_color, vpos, theta;
110
93
    unsigned int width = 0, height = 0;
111
 
    GLfloat angle = 0.0f;
 
94
    GLfloat angle[4] = {3.1f, 4.1f, 5.9f, 2.6f};
112
95
 
113
96
    if (!mir_eglapp_init(argc, argv, &width, &height))
114
97
        return 1;
149
132
 
150
133
    while (mir_eglapp_running())
151
134
    {
152
 
        glUniform1f(theta, angle);
153
 
        angle += 0.005f;
154
 
        if (angle > pi2)
155
 
            angle -= pi2;
 
135
        glUniform4fv(theta, 1, angle);
 
136
        angle[0] += 0.00345f;
 
137
        angle[1] += 0.01947f;
 
138
        angle[2] += 0.03758f;
 
139
        angle[3] += 0.01711f;
 
140
        for (int a = 0; a < 4; ++a)
 
141
            if (angle[a] > pi2) angle[a] -= pi2;
156
142
        glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
157
143
        mir_eglapp_swap_buffers();
158
144
    }