Implemented measuring context for Cairo renderer (wxMSW).

This commit is contained in:
Artur Wieczorek
2016-03-16 21:41:20 +01:00
parent d96a25be12
commit 1fa4efc47e

View File

@@ -527,6 +527,25 @@ private:
}; };
#endif // wxUSE_IMAGE #endif // wxUSE_IMAGE
#ifdef __WXMSW__
class wxCairoMeasuringContext : public wxCairoContext
{
public:
wxCairoMeasuringContext(wxGraphicsRenderer* renderer)
: wxCairoContext(renderer, m_hdc = ::GetDC(NULL))
{
}
virtual ~wxCairoMeasuringContext()
{
::ReleaseDC(NULL, m_hdc);
}
private:
HDC m_hdc;
};
#endif // __WXMSW__
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxCairoPenBrushBaseData implementation // wxCairoPenBrushBaseData implementation
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -2575,6 +2594,9 @@ wxGraphicsContext * wxCairoRenderer::CreateMeasuringContext()
{ {
#ifdef __WXGTK__ #ifdef __WXGTK__
return CreateContextFromNativeWindow(gdk_get_default_root_window()); return CreateContextFromNativeWindow(gdk_get_default_root_window());
#elif defined(__WXMSW__)
ENSURE_LOADED_OR_RETURN(NULL);
return new wxCairoMeasuringContext(this);
#else #else
return NULL; return NULL;
// TODO // TODO