make it possible to create wxWindowDC for a hidden window

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41131 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2006-09-10 15:51:03 +00:00
parent 9c72cf7619
commit 2582bcdc9d
3 changed files with 42 additions and 19 deletions

View File

@@ -87,8 +87,9 @@ void wxClientDisplayRect(int *x, int *y, int *width, int *height)
// surface manipulation helpers
//-----------------------------------------------------------------------------
wxIDirectFBSurfacePtr wxDfbCloneSurface(const wxIDirectFBSurfacePtr& s,
wxDfbCloneSurfaceMode mode)
wxIDirectFBSurfacePtr wxDfbCreateCompatibleSurface(
const wxIDirectFBSurfacePtr& s,
const wxSize& size)
{
if ( !s )
return NULL;
@@ -97,8 +98,9 @@ wxIDirectFBSurfacePtr wxDfbCloneSurface(const wxIDirectFBSurfacePtr& s,
desc.flags = (DFBSurfaceDescriptionFlags)(
DSDESC_CAPS | DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT);
s->GetCapabilities(&desc.caps);
s->GetSize(&desc.width, &desc.height);
s->GetPixelFormat(&desc.pixelformat);
desc.width = size.x;
desc.height = size.y;
wxIDirectFBSurfacePtr snew(wxIDirectFB::Get()->CreateSurface(&desc));
if ( !snew )
@@ -114,6 +116,23 @@ wxIDirectFBSurfacePtr wxDfbCloneSurface(const wxIDirectFBSurfacePtr& s,
}
}
return snew;
}
wxIDirectFBSurfacePtr wxDfbCloneSurface(const wxIDirectFBSurfacePtr& s,
wxDfbCloneSurfaceMode mode)
{
if ( !s )
return NULL;
wxSize size;
if ( !s->GetSize(&size.x, &size.y) )
return NULL;
wxIDirectFBSurfacePtr snew(wxDfbCreateCompatibleSurface(s, size));
if ( !snew )
return NULL;
if ( mode == wxDfbCloneSurface_CopyPixels )
{
if ( !snew->SetBlittingFlags(DSBLIT_NOFX) )