~kdub/mir/fix-1663062-0.26.1

« back to all changes in this revision

Viewing changes to src/server/graphics/nested/mir_client_host_connection.cpp

  • Committer: Kevin DuBois
  • Date: 2017-02-09 17:41:12 UTC
  • Revision ID: kevin.dubois@canonical.com-20170209174112-aiuhmf7qdo8smgb3
disallow using ShmBuffers as passthrough targets, as the nested server cannot map them properly as textures yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
854
854
    return std::make_unique<SurfaceSpec>(mir_connection);
855
855
}
856
856
 
857
 
bool mgn::MirClientHostConnection::supports_passthrough()
 
857
bool mgn::MirClientHostConnection::supports_passthrough(mg::BufferUsage usage)
858
858
{
859
 
    auto buffer = create_buffer(geom::Size{1, 1} , mir_pixel_format_abgr_8888);
860
 
    auto hints = buffer->egl_image_creation_hints();
861
 
    if (std::get<1>(hints) == nullptr && std::get<2>(hints) == nullptr)
862
 
        return false;
863
 
    return true;
 
859
    //FIXME: ShmBuffers currently don't upload properly. The logic here uses
 
860
    //       passthrough where supported (ANativeWindowBuffer and gbm_bo)
 
861
    //       (LP: #1663062 for more details)
 
862
    return (mir_extension_android_buffer_v1(mir_connection) || 
 
863
           ((mir_extension_gbm_buffer_v1(mir_connection) && usage == mg::BufferUsage::hardware)));
864
864
}
865
865
 
866
866
namespace