don't allocate backbuffer for dummy surfaces
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41426 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -116,7 +116,8 @@ int wxIDirectFBSurface::GetDepth()
|
||||
return DFB_BITS_PER_PIXEL(format);
|
||||
}
|
||||
|
||||
wxIDirectFBSurfacePtr wxIDirectFBSurface::CreateCompatible(const wxSize& sz)
|
||||
wxIDirectFBSurfacePtr
|
||||
wxIDirectFBSurface::CreateCompatible(const wxSize& sz, int flags)
|
||||
{
|
||||
wxSize size(sz);
|
||||
if ( size == wxDefaultSize )
|
||||
@@ -135,6 +136,17 @@ wxIDirectFBSurfacePtr wxIDirectFBSurface::CreateCompatible(const wxSize& sz)
|
||||
desc.width = size.x;
|
||||
desc.height = size.y;
|
||||
|
||||
// filter out caps that don't make sense for a new compatible surface:
|
||||
int caps = desc.caps;
|
||||
caps &= ~DSCAPS_PRIMARY;
|
||||
caps &= ~DSCAPS_SUBSURFACE;
|
||||
if ( flags & CreateCompatible_NoBackBuffer )
|
||||
{
|
||||
caps &= ~DSCAPS_DOUBLE;
|
||||
caps &= ~DSCAPS_TRIPLE;
|
||||
}
|
||||
desc.caps = (DFBSurfaceCapabilities)caps;
|
||||
|
||||
wxIDirectFBSurfacePtr snew(wxIDirectFB::Get()->CreateSurface(&desc));
|
||||
if ( !snew )
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user