From 26c2269500921ffd8b724843ce797dc2919b268f Mon Sep 17 00:00:00 2001 From: Bas Schouten Date: Thu, 13 Feb 2014 02:59:12 +0100 Subject: [PATCH] Bug 806406: Remove some lingering references to gfxD2DSurface. r=jrmuizel --- widget/windows/nsWindow.cpp | 23 ---------------------- widget/windows/nsWindow.h | 8 -------- widget/windows/nsWindowGfx.cpp | 29 +--------------------------- widget/windows/winrt/FrameworkView.h | 1 - 4 files changed, 1 insertion(+), 60 deletions(-) diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index f29699fdddaf..ccde0dcca72e 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -3343,11 +3343,6 @@ nsWindow::GetLayerManager(PLayerTransactionChild* aShadowManager, gfxASurface *nsWindow::GetThebesSurface() { -#ifdef CAIRO_HAS_D2D_SURFACE - if (mD2DWindowSurface) { - return mD2DWindowSurface; - } -#endif if (mPaintDC) return (new gfxWindowsSurface(mPaintDC)); @@ -6442,13 +6437,6 @@ void nsWindow::OnDestroy() // Send a resize message to the listener bool nsWindow::OnResize(nsIntRect &aWindowRect) { -#ifdef CAIRO_HAS_D2D_SURFACE - if (mD2DWindowSurface) { - mD2DWindowSurface = nullptr; - Invalidate(); - } -#endif - bool result = mWidgetListener ? mWidgetListener->WindowResized(this, aWindowRect.width, aWindowRect.height) : false; @@ -6836,14 +6824,6 @@ nsresult nsWindow::UpdateTranslucentWindow() ::UpdateLayeredWindow(hWnd, nullptr, (POINT*)&winRect, &winSize, mMemoryDC, &srcPos, 0, &bf, ULW_ALPHA); -#ifdef CAIRO_HAS_D2D_SURFACE - if (gfxWindowsPlatform::GetPlatform()->GetRenderMode() == - gfxWindowsPlatform::RENDER_DIRECT2D) { - nsIntRect r(0, 0, 0, 0); - static_cast(mTransparentSurface.get())->ReleaseDC(&r); - } -#endif - if (!updateSuccesful) { return NS_ERROR_FAILURE; } @@ -7091,9 +7071,6 @@ BOOL CALLBACK nsWindow::ClearResourcesCallback(HWND aWnd, LPARAM aMsg) void nsWindow::ClearCachedResources() { -#ifdef CAIRO_HAS_D2D_SURFACE - mD2DWindowSurface = nullptr; -#endif if (mLayerManager && mLayerManager->GetBackendType() == LayersBackend::LAYERS_BASIC) { mLayerManager->ClearCachedResources(); diff --git a/widget/windows/nsWindow.h b/widget/windows/nsWindow.h index cc41f98d93a6..91229de428f1 100644 --- a/widget/windows/nsWindow.h +++ b/widget/windows/nsWindow.h @@ -29,10 +29,6 @@ #include "mozilla/TimeStamp.h" #include "nsMargin.h" -#ifdef CAIRO_HAS_D2D_SURFACE -#include "gfxD2DSurface.h" -#endif - #include "nsWinGesture.h" #include "WindowHook.h" @@ -548,10 +544,6 @@ protected: nsIntRect mLastPaintBounds; -#ifdef CAIRO_HAS_D2D_SURFACE - nsRefPtr mD2DWindowSurface; // Surface for this window. -#endif - // Transparency #ifdef MOZ_XUL // Use layered windows to support full 256 level alpha translucency diff --git a/widget/windows/nsWindowGfx.cpp b/widget/windows/nsWindowGfx.cpp index 8eb49da86772..4579f52d9efb 100644 --- a/widget/windows/nsWindowGfx.cpp +++ b/widget/windows/nsWindowGfx.cpp @@ -323,27 +323,6 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel) } #endif -#ifdef CAIRO_HAS_D2D_SURFACE - if (!targetSurface && - IsRenderMode(gfxWindowsPlatform::RENDER_DIRECT2D)) - { - if (!mD2DWindowSurface) { - gfxContentType content = gfxContentType::COLOR; -#if defined(MOZ_XUL) - if (mTransparencyMode != eTransparencyOpaque) { - content = gfxContentType::COLOR_ALPHA; - } -#endif - mD2DWindowSurface = new gfxD2DSurface(mWnd, content); - } - if (!mD2DWindowSurface->CairoStatus()) { - targetSurface = mD2DWindowSurface; - } else { - mD2DWindowSurface = nullptr; - } - } -#endif - nsRefPtr targetSurfaceWin; if (!targetSurface && (IsRenderMode(gfxWindowsPlatform::RENDER_GDI) || @@ -451,13 +430,7 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel) UpdateTranslucentWindow(); } else #endif -#ifdef CAIRO_HAS_D2D_SURFACE - if (result) { - if (mD2DWindowSurface) { - mD2DWindowSurface->Present(); - } - } -#endif + if (result) { if (IsRenderMode(gfxWindowsPlatform::RENDER_IMAGE_STRETCH24) || IsRenderMode(gfxWindowsPlatform::RENDER_IMAGE_STRETCH32)) diff --git a/widget/windows/winrt/FrameworkView.h b/widget/windows/winrt/FrameworkView.h index d95d8e1ad207..3d7748a9b1ce 100644 --- a/widget/windows/winrt/FrameworkView.h +++ b/widget/windows/winrt/FrameworkView.h @@ -8,7 +8,6 @@ #include "MetroWidget.h" #include "MetroInput.h" #include "gfxWindowsPlatform.h" -#include "gfxD2DSurface.h" #include "nsDataHashtable.h" #include "mozwrlbase.h"