~morphis/mir/fix-screencast-orientation

« back to all changes in this revision

Viewing changes to src/client/mir_surface_api.cpp

  • Committer: Simon Fels
  • Date: 2016-04-20 06:56:22 UTC
  • mfrom: (1266.1.6 mir)
  • Revision ID: simon.fels@canonical.com-20160420065622-fa4i1zkav6tqhs54
Merge lp:mir/ubuntu

[ Alberto Aguirre ]
* New upstream release 0.21.0 (https://launchpad.net/mir/+milestone/0.21.0)
  - ABI summary:
    . mirclient ABI unchanged at 9
    . mirserver ABI unchanged at 38
    . mircommon ABI unchanged at 5
    . mirplatform ABI unchanged at 11
    . mirprotobuf ABI unchanged at 3
    . mirplatformgraphics ABI unchaged at 8
    . mirclientplatform ABI bumped to 5
    . mirinputplatform ABI unchanged at 5
  - Enhancements:
    . New display enumeration API
    . Added Android diagnostic tests to assist during porting to
      new devices
    . Added mir_demo_client_camera: a Video4Linux2 client
  - Bugs fixed:
    . Sometimes devices don't suspend - display turns back on
      immediately (LP: #1549701)
    . Mir crashed with exception 'failed to add sync point to command
      buffer' (LP: #1554635)
    . Mouse cursor is unusably slow in Unity 8 with a 1000Hz mouse
      (LP: #1539009)
    . Packaged mir_unit_tests binary is not suitable for general use
      (LP: #1547015)
    . [regression] Mir stops receiving input after a pause/resume
      cycle (LP: #1548989)
    . NBS (--nbuffers=0) causes software clients to crash with
      std::exception::what: Failed to mmap buffer 13, "Permission denied")
      (LP: #1550432)
    . Fullscreen clients freeze when using NBS with multiple monitors
      (LP: #1551536)
    . [ FAILED ] DisplayConfigurationTest.output_position_is_independent_of_
      orientation (LP: #1552065)
    . The server-side use of MIR_SOCKET is confusing (LP: #1290345)
    . [regression] FTBFS with -DMIR_LINK_TIME_OPTIMIZATION=on
      -Duse_debflags=on (LP: #1350343)
    . Mir On X (mesa-x11) keeps receiving mouse movement events even
      when not focused (LP: #1528110)
    . x11 platform: mouse cursor moves strange (LP: #1546324)
    . Cross compiling to wily/vivid doesn't work (LP: #1549152)
    . Rendering stutters when a new client establishes a connection
      (LP: #1549359)
    . 'mir_demo_server --test-client' crashes (SIGSEGV) when client
      dies (LP: #1555620)
    . [testfail] CI failure: TestClientInput.client_input_config_request_
      receives_all_attached_devices (LP: #1555708)
    . [regression] Mir FTBFS when MIR_ENABLE_TESTS=no (LP: #1556080)
    . Mir-on-X11 doesn't exit (until it gets an event) (LP: #1556210)
    . InputPlatformProbe.x11_platform_found_and_used_when_display_connection_
      works breaks with old input drivers present (LP: #1543049)
    . [regression] MIR_CLIENT_PERF_REPORT is missing window/surface
      names (LP: #1546933)
    . Installed binaries fail to run with mir_demo_server --test-client XXXX
      (LP: #1556160)
    . mir_demo_server --test-client [mir_demo_client_scroll|
      mir_demo_client_flicker] fails (LP: #1556205)
    . The contents of debian/mir-demos.examples are out of date and useless
      (LP: #1557446)
[ CI Train Bot ]
* No-change rebuild.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include "mir_toolkit/mir_surface.h"
22
22
#include "mir_toolkit/mir_wait.h"
 
23
#include "mir_toolkit/mir_presentation_chain.h"
23
24
#include "mir/require.h"
24
25
 
25
26
#include "mir_connection.h"
26
27
#include "mir_surface.h"
 
28
#include "presentation_chain.h"
27
29
#include "error_connections.h"
28
30
#include "mir/uncaught.h"
29
31
 
554
556
{
555
557
    mir::require(spec);
556
558
 
557
 
    std::vector<MirBufferStreamInfo> copy;
 
559
    std::vector<ContentInfo> copy;
558
560
    for (auto i = 0u; i < size; i++)
559
561
    {
560
562
        mir::require(mir_buffer_stream_is_valid(streams[i].stream));
561
 
        copy.emplace_back(streams[i]);
 
563
        copy.emplace_back(ContentInfo{
 
564
            mir::geometry::Displacement{streams[i].displacement_x, streams[i].displacement_y},
 
565
            reinterpret_cast<mcl::ClientBufferStream*>(streams[i].stream)->rpc_id().as_value(),
 
566
            {}});
562
567
    }
563
568
    spec->streams = copy;
564
569
}
567
572
    MIR_LOG_UNCAUGHT_EXCEPTION(ex);
568
573
}
569
574
 
 
575
void mir_surface_spec_add_presentation_chain(
 
576
    MirSurfaceSpec* spec,
 
577
    int width, int height,
 
578
    int displacement_x, int displacement_y,
 
579
    MirPresentationChain* client_chain)
 
580
try
 
581
{
 
582
    mir::require(spec && client_chain);
 
583
    auto chain = reinterpret_cast<mcl::PresentationChain*>(client_chain);
 
584
 
 
585
    ContentInfo info{
 
586
        {displacement_x, displacement_y}, chain->rpc_id(), mir::geometry::Size{width, height}};
 
587
    if (spec->streams.is_set())
 
588
        spec->streams.value().push_back(info);
 
589
    else
 
590
        spec->streams = std::vector<ContentInfo>{info}; 
 
591
}
 
592
catch (std::exception const& ex)
 
593
{
 
594
    MIR_LOG_UNCAUGHT_EXCEPTION(ex);
 
595
}
 
596
 
 
597
void mir_surface_spec_add_buffer_stream(
 
598
    MirSurfaceSpec* spec,
 
599
    int displacement_x, int displacement_y,
 
600
    MirBufferStream* stream)
 
601
try
 
602
{
 
603
    mir::require(spec && stream);
 
604
    auto bs = reinterpret_cast<mcl::ClientBufferStream*>(stream);
 
605
    ContentInfo info{{displacement_x, displacement_y}, bs->rpc_id().as_value(), {}};
 
606
 
 
607
    if (spec->streams.is_set())
 
608
        spec->streams.value().push_back(info);
 
609
    else
 
610
        spec->streams = std::vector<ContentInfo>{info}; 
 
611
}
 
612
catch (std::exception const& ex)
 
613
{
 
614
    MIR_LOG_UNCAUGHT_EXCEPTION(ex);
 
615
}
 
616
 
570
617
void mir_surface_spec_set_input_shape(MirSurfaceSpec *spec, MirRectangle const* rectangles,
571
618
                                      size_t n_rects)
572
619
try