don't use priviledged calls in wxDFB to allow concurrent use of the display by >1 wxDFB apps
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -426,14 +426,10 @@ struct wxIDirectFBDisplayLayer : public wxDfbWrapper<IDirectFBDisplayLayer>
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxIDirectFBSurfacePtr GetSurface()
|
bool GetConfiguration(DFBDisplayLayerConfig *config)
|
||||||
{
|
{ return Check(m_ptr->GetConfiguration(m_ptr, config)); }
|
||||||
IDirectFBSurface *s;
|
|
||||||
if ( Check(m_ptr->GetSurface(m_ptr, &s)) )
|
wxVideoMode GetVideoMode();
|
||||||
return new wxIDirectFBSurface(s);
|
|
||||||
else
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GetCursorPosition(int *x, int *y)
|
bool GetCursorPosition(int *x, int *y)
|
||||||
{ return Check(m_ptr->GetCursorPosition(m_ptr, x, y)); }
|
{ return Check(m_ptr->GetCursorPosition(m_ptr, x, y)); }
|
||||||
|
@@ -67,16 +67,11 @@ void wxApp::CleanUp()
|
|||||||
|
|
||||||
static wxVideoMode GetCurrentVideoMode()
|
static wxVideoMode GetCurrentVideoMode()
|
||||||
{
|
{
|
||||||
wxVideoMode m;
|
wxIDirectFBDisplayLayerPtr layer(wxIDirectFB::Get()->GetDisplayLayer());
|
||||||
|
if ( !layer )
|
||||||
|
return wxVideoMode(); // invalid
|
||||||
|
|
||||||
wxIDirectFBSurfacePtr surface(wxIDirectFB::Get()->GetPrimarySurface());
|
return layer->GetVideoMode();
|
||||||
if ( !surface )
|
|
||||||
return m; // invalid
|
|
||||||
|
|
||||||
surface->GetSize(&m.w, &m.h);
|
|
||||||
m.bpp = surface->GetDepth();
|
|
||||||
|
|
||||||
return m;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxVideoMode wxApp::GetDisplayMode() const
|
wxVideoMode wxApp::GetDisplayMode() const
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
// wxScreenDC
|
// wxScreenDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#warning "FIXME: verify that wxScreenDC works in 2nd DirectFB app started"
|
#warning "FIXME: this doesn't work (neither single app nor multiapp core)
|
||||||
// FIXME: maybe use a subsurface as well?
|
// FIXME: maybe use a subsurface as well?
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxDC)
|
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxDC)
|
||||||
|
@@ -98,8 +98,10 @@ void wxIDirectFB::CleanUp()
|
|||||||
|
|
||||||
wxIDirectFBSurfacePtr wxIDirectFB::GetPrimarySurface()
|
wxIDirectFBSurfacePtr wxIDirectFB::GetPrimarySurface()
|
||||||
{
|
{
|
||||||
wxIDirectFBDisplayLayerPtr layer(GetDisplayLayer());
|
DFBSurfaceDescription desc;
|
||||||
return layer ? layer->GetSurface() : NULL;
|
desc.flags = DSDESC_CAPS;
|
||||||
|
desc.caps = DSCAPS_PRIMARY;
|
||||||
|
return CreateSurface(&desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -192,3 +194,26 @@ bool wxIDirectFBSurface::FlipToFront(const DFBRegion *region)
|
|||||||
// drawings:
|
// drawings:
|
||||||
return Flip(region, DSFLIP_BLIT);
|
return Flip(region, DSFLIP_BLIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxIDirectFBDisplayLayer
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
wxVideoMode wxIDirectFBDisplayLayer::GetVideoMode()
|
||||||
|
{
|
||||||
|
DFBDisplayLayerConfig cfg;
|
||||||
|
if ( !GetConfiguration(&cfg) )
|
||||||
|
return wxVideoMode(); // invalid
|
||||||
|
|
||||||
|
if ( !((cfg.flags & DLCONF_WIDTH) &&
|
||||||
|
(cfg.flags & DLCONF_HEIGHT) &&
|
||||||
|
(cfg.flags & DLCONF_PIXELFORMAT)) )
|
||||||
|
return wxVideoMode(); // invalid
|
||||||
|
|
||||||
|
return wxVideoMode
|
||||||
|
(
|
||||||
|
cfg.width,
|
||||||
|
cfg.height,
|
||||||
|
DFB_BITS_PER_PIXEL(cfg.pixelformat)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user