Refactor wxGCDC to delegate acquiring/releasing HDC to wxGraphicsContext
Instead of implementing MSW-specific code to handle HDC for GDI+ context directly in wxGCDC delegate acquiring/releasing HDC to underlying wxGraphicsContext. Decoupling GDI+-specific code from wxGCDC will allow us to implement handling HDC in other graphics renderers in a clean way.
This commit is contained in:
@@ -512,6 +512,18 @@ public:
|
||||
wxDouble *descent, wxDouble *externalLeading ) const wxOVERRIDE;
|
||||
virtual void GetPartialTextExtents(const wxString& text, wxArrayDouble& widths) const wxOVERRIDE;
|
||||
|
||||
#ifdef __WXMSW__
|
||||
virtual WXHDC GetNativeHDC() wxOVERRIDE
|
||||
{
|
||||
wxFAIL_MSG("Can't get HDC from Cairo context");
|
||||
return NULL;
|
||||
};
|
||||
virtual void ReleaseNativeHDC(WXHDC WXUNUSED(hdc)) wxOVERRIDE
|
||||
{
|
||||
wxFAIL_MSG("Can't release HDC for Cairo context");
|
||||
};
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void DoDrawText( const wxString &str, wxDouble x, wxDouble y ) wxOVERRIDE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user