]> git.saurik.com Git - wxWidgets.git/commitdiff
clean up wxCairoRenderer initialization mess
authorPaul Cornett <paulcor@bullseye.com>
Sun, 2 Dec 2012 05:11:25 +0000 (05:11 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Sun, 2 Dec 2012 05:11:25 +0000 (05:11 +0000)
Remove unused Unload(), wxCairoCleanUp(), m_loaded and gCairoRenderer, and redundant Load()
and EnsureIsLoaded(). Just call wxCairoInit() directly, and for GTK do nothing at all.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73098 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/cairo.cpp
src/generic/graphicc.cpp

index 9bbb8f25d9548c4f5b83a11bb5c7fc6ecdad21cf..572b0bb840f3418453f3241e79aae22746437ea7 100644 (file)
@@ -384,11 +384,6 @@ bool wxCairoInit()
     return wxCairo::Initialize();
 }
 
-void wxCairoCleanUp()
-{
-    wxCairo::CleanUp();
-}
-
 extern "C"
 {
 
index 0cb35ac2ed175a5e991d255c9acd69933c2a74f7..aa038f1cb2756be603fe857521f149c4e76f7a9b 100644 (file)
@@ -28,7 +28,6 @@
 #include <cairo.h>
 
 bool wxCairoInit();
-void wxCairoCleanUp();
 
 #ifndef WX_PRECOMP
     #include "wx/bitmap.h"
@@ -2397,13 +2396,6 @@ public :
     // create a subimage from a native image representation
     virtual wxGraphicsBitmap CreateSubBitmap( const wxGraphicsBitmap &bitmap, wxDouble x, wxDouble y, wxDouble w, wxDouble h  );
 
-protected :
-    bool EnsureIsLoaded();
-    void Load();
-    void Unload();
-    friend class wxCairoModule;
-private :
-    int m_loaded;
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxCairoRenderer)
 } ;
 
@@ -2414,34 +2406,14 @@ private :
 IMPLEMENT_DYNAMIC_CLASS(wxCairoRenderer,wxGraphicsRenderer)
 
 static wxCairoRenderer gs_cairoGraphicsRenderer;
-// temporary hack to allow creating a cairo context on any platform
-extern wxGraphicsRenderer* gCairoRenderer;
-wxGraphicsRenderer* gCairoRenderer = &gs_cairoGraphicsRenderer;
 
-bool wxCairoRenderer::EnsureIsLoaded()
-{
-#ifndef __WXGTK__
-    Load();
-    return wxCairoInit();
+#ifdef __WXGTK__
+    #define ENSURE_LOADED_OR_RETURN(returnOnFail)
 #else
-    return true;
+    #define ENSURE_LOADED_OR_RETURN(returnOnFail)  \
+        if (!wxCairoInit())                        \
+            return returnOnFail
 #endif
-}
-
-void wxCairoRenderer::Load()
-{
-    wxCairoInit();
-}
-
-void wxCairoRenderer::Unload()
-{
-    wxCairoCleanUp();
-}
-
-// call EnsureIsLoaded() and return returnOnFail value if it fails
-#define ENSURE_LOADED_OR_RETURN(returnOnFail)  \
-    if ( !EnsureIsLoaded() )                   \
-        return (returnOnFail)
 
 wxGraphicsContext * wxCairoRenderer::CreateContext( const wxWindowDC& dc)
 {