~ubuntu-branches/ubuntu/vivid/mir/vivid

« back to all changes in this revision

Viewing changes to src/shared/graphics/android/mir_native_window.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Daniel van Vugt, Ubuntu daily release
  • Date: 2014-08-29 16:12:54 UTC
  • mfrom: (1.1.73)
  • Revision ID: package-import@ubuntu.com-20140829161254-wfnunk4fw3msth3c
Tags: 0.7.0+14.10.20140829-0ubuntu1
[ Daniel van Vugt ]
* New upstream release 0.7.0 (https://launchpad.net/mir/+milestone/0.7.0)
  - Enhancements:
    . Test suite: Reworked mechanism to override Mir client functions
    . Demo shell: Detect custom rendering (decorations) to make it
      compatible with overlay optimizations
    . Make sure to preserve fd resources until the end of the sending
      of the message
    . Add test cases and script for tracking changes to the new ABIs:
      libmircommon, libmirplatform
    . Symbols file for libmirplatform
    . Symbols file for libmircommon
    . Symbols file for libmirserver
    . Various improvements to the SessionMediator test
    . Various build related improvements
    . Print testcase output during package build
    . Abort test when InProcessServer startup fails
    . Link the integration and unit tests against the server objects
    . Add a document detailing the useful tests to run and the useful
      logs to collect when troubleshooting a new android chipset
    . Enable motion event resampling and prediction for a more responsive
      touch experience.
  - ABI summary: Servers need rebuilding, but clients do not
    . Mirclient ABI unchanged at 8
    . Mircommon ABI bumped to 1
    . Mirplatform ABI bumped to 2
    . Mirserver ABI bumped to 25
  - API changes
    . Deleted function - frontend::Shell::create_surface_for(). If you have
      the std::shared_ptr<frontend::Session> session, you can just do
      session->create_surface(params) instead to get a SurfaceId
  - Bug fixes:
    . Ensure we process lifecycle events before the nested server is torn
      down (LP: #1353465)
    . Fix race in InputTestingServerConfiguration (LP: #1354446)
    . Fix fd leaks in prompt session frontend code and tests (LP: #1353461)
    . Detect the additional things the demo shell draws on the renderable
      list and avoid calling the optimized post function if they are being
      drawn (LP: #1348330)
    . Client: Fix SIGTERM dispatch in our default lifecycle event handler
      (LP: #1353867)
    . DemoRenderer: Don't try to create a texture of width zero. 
      (LP: #1358210)
    . Fix CI failures (LP: #1358698)
    . Fix build failure: "variable ‘rc’ set but not used" which happens in
      release mode when NDEBUG is set (LP: #1358625)
    . Only enumerate exposed input surfaces to avoid delivering events to
      occluded surfaces (LP: #1359264)
    . Android: do not post driver cancelled buffers (LP: #1359406)
    . Client: Ensure our platform library stays loaded for as long as it is
      needed by other objects (LP: #1358191)
    . Examples: Register the DemoCompositor with the Scene to properly
      process visibility events (LP: #1359487)
    . Mir_demo_client_basic: Don't assert on user errors like failing to
      connect to a Mir server (LP: #1331958)
    . Tests: Explicitly depend on GMock target to avoid build races
      (LP: #1362646)

[ Ubuntu daily release ]
* New rebuild forced

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
}
133
133
 
134
134
mga::MirNativeWindow::MirNativeWindow(std::shared_ptr<AndroidDriverInterpreter> const& interpreter)
135
 
 : driver_interpreter(interpreter)
 
135
 : driver_interpreter(interpreter), sync_ops(std::make_shared<mga::RealSyncFileOps>())
136
136
{
137
137
    ANativeWindow::query = &query_static;
138
138
    ANativeWindow::perform = &perform_static;
168
168
int mga::MirNativeWindow::dequeueBuffer(struct ANativeWindowBuffer** buffer_to_driver, int* fence_fd)
169
169
try
170
170
{
171
 
    auto buffer = driver_interpreter->driver_requests_buffer();
 
171
    if (cancelled_buffers.size() != 0)
 
172
    {
 
173
        *buffer_to_driver = cancelled_buffers.back();
 
174
        cancelled_buffers.pop_back();
 
175
        *fence_fd = -1; //no fence associated with cancelled buffers
 
176
    }
 
177
    else
 
178
    {
 
179
        auto buffer = driver_interpreter->driver_requests_buffer();
172
180
 
173
 
    //EGL driver is responsible for closing this native handle
174
 
    *fence_fd = buffer->copy_fence();
175
 
    *buffer_to_driver = buffer->anwb();
 
181
        //EGL driver is responsible for closing this native handle
 
182
        *fence_fd = buffer->copy_fence();
 
183
        *buffer_to_driver = buffer->anwb();
 
184
    }
176
185
    return 0;
177
186
}
178
187
catch (std::exception const& e)
184
193
int mga::MirNativeWindow::dequeueBufferAndWait(struct ANativeWindowBuffer** buffer_to_driver)
185
194
try
186
195
{
187
 
    auto buffer = driver_interpreter->driver_requests_buffer();
188
 
    *buffer_to_driver = buffer->anwb();
189
 
    buffer->ensure_available_for(mga::BufferAccess::write);
 
196
    if (cancelled_buffers.size() != 0)
 
197
    {
 
198
        *buffer_to_driver = cancelled_buffers.back();
 
199
        cancelled_buffers.pop_back();
 
200
    }
 
201
    else
 
202
    {
 
203
        auto buffer = driver_interpreter->driver_requests_buffer();
 
204
        *buffer_to_driver = buffer->anwb();
 
205
        buffer->ensure_available_for(mga::BufferAccess::write);
 
206
    }
190
207
    return 0;
191
208
}
192
209
catch (std::exception const& e)
210
227
int mga::MirNativeWindow::cancelBuffer(struct ANativeWindowBuffer* buffer, int fence)
211
228
try
212
229
{
213
 
    driver_interpreter->driver_returns_buffer(buffer, fence);
 
230
    mga::SyncFence sync_fence(sync_ops, mir::Fd(fence));
 
231
    sync_fence.wait();
 
232
 
 
233
    cancelled_buffers.push_back(buffer);
214
234
    return 0;
215
235
}
216
236
catch (std::exception const& e)