diff --git a/gfx/src/thebes/nsThebesDeviceContext.cpp b/gfx/src/thebes/nsThebesDeviceContext.cpp index 79daa6f7eb32..30a35ce848ea 100644 --- a/gfx/src/thebes/nsThebesDeviceContext.cpp +++ b/gfx/src/thebes/nsThebesDeviceContext.cpp @@ -260,6 +260,7 @@ NS_IMETHODIMP nsThebesDeviceContext::CreateRenderingContext(nsIView *aView, nsIRenderingContext *&aContext) { + // This is currently only called by the caret code NS_ENSURE_ARG_POINTER(aView); NS_PRECONDITION(aView->HasWidget(), "View has no widget!"); @@ -302,8 +303,6 @@ nsThebesDeviceContext::CreateRenderingContext(nsIWidget *aWidget, nsRefPtr surface(aWidget->GetThebesSurface()); if (surface) rv = pContext->Init(this, surface); - else - rv = pContext->Init(this, aWidget); if (NS_SUCCEEDED(rv)) { aContext = pContext; NS_ADDREF(aContext); diff --git a/gfx/src/thebes/nsThebesDrawingSurface.cpp b/gfx/src/thebes/nsThebesDrawingSurface.cpp index d4edd22ebd40..4688e69a2ab9 100644 --- a/gfx/src/thebes/nsThebesDrawingSurface.cpp +++ b/gfx/src/thebes/nsThebesDrawingSurface.cpp @@ -75,16 +75,8 @@ nsThebesDrawingSurface::~nsThebesDrawingSurface() // destroy this before any other bits are destroyed, // in case they depend on them mSurface = nsnull; - -#ifdef XP_WIN - if (mWidget) - mWidget->FreeNativeData(mNativeWidget, NS_NATIVE_GRAPHIC); -#endif } -#ifdef MOZ_ENABLE_GTK2 -#endif - nsresult nsThebesDrawingSurface::Init(nsThebesDeviceContext *aDC, gfxASurface *aSurface) { @@ -141,40 +133,15 @@ nsThebesDrawingSurface::Init(nsThebesDeviceContext *aDC, PRUint32 aWidth, PRUint nsresult nsThebesDrawingSurface::Init (nsThebesDeviceContext *aDC, nsIWidget *aWidget) { - PR_LOG(gThebesGFXLog, PR_LOG_DEBUG, ("## %p nsThebesDrawingSurface::Init aDC %p aWidget %p\n", this, aDC, aWidget)); - -#ifdef MOZ_ENABLE_GTK2 - mNativeWidget = aWidget->GetNativeData(NS_NATIVE_WIDGET); -#elif XP_WIN - mWidget = aWidget; // hold a pointer to this.. not a reference.. because we have to free the dc... - mNativeWidget = aWidget->GetNativeData(NS_NATIVE_GRAPHIC); -#else -#error Write me! -#endif - - Init(aDC, mNativeWidget); - - return NS_OK; + NS_ERROR("Should never be called."); + return NS_ERROR_NOT_IMPLEMENTED; } nsresult nsThebesDrawingSurface::Init (nsThebesDeviceContext *aDC, nsNativeWidget aWidget) { - mDC = aDC; - mNativeWidget = aWidget; - mWidth = 0; - mHeight = 0; - -#ifdef MOZ_ENABLE_GTK2 NS_ERROR("Should never be called."); -#elif XP_WIN - HDC nativeDC = (HDC)aWidget; - mSurface = new gfxWindowsSurface(nativeDC); -#else -#error write me -#endif - - return NS_OK; + return NS_ERROR_NOT_IMPLEMENTED; } #ifdef MOZ_ENABLE_GTK2 diff --git a/gfx/src/thebes/nsThebesRenderingContext.cpp b/gfx/src/thebes/nsThebesRenderingContext.cpp index 9acdc305a4c4..5548a5f6c92a 100644 --- a/gfx/src/thebes/nsThebesRenderingContext.cpp +++ b/gfx/src/thebes/nsThebesRenderingContext.cpp @@ -139,22 +139,8 @@ nsThebesRenderingContext::Init(nsIDeviceContext* aContext, nsIWidget *aWidget) NS_IMETHODIMP nsThebesRenderingContext::Init(nsIDeviceContext* aContext, nsIDrawingSurface *aSurface) { - PR_LOG(gThebesGFXLog, PR_LOG_DEBUG, ("## %p nsTRC::Init ctx %p ds %p\n", this, aContext, aSurface)); - - nsThebesDrawingSurface *cds = (nsThebesDrawingSurface *) aSurface; - - mDeviceContext = aContext; - mWidget = nsnull; - - mLocalDrawingSurface = (nsThebesDrawingSurface *) cds; - mDrawingSurface = mLocalDrawingSurface; - - mThebes = new gfxContext(mLocalDrawingSurface->GetThebesSurface()); - - //mThebes->SetColor(gfxRGBA(1.0, 1.0, 1.0, 1.0)); - //mThebes->Paint(); - - return (CommonInit()); + NS_ERROR("Should never be called."); + return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP