From eff494e681f195e783353b6ab9a535002d916d8b Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Wed, 30 Sep 2015 16:43:26 -0700 Subject: [PATCH] Backed out changeset 919a831786f1 (bug 1208638) for windows build failures --- dom/svg/nsSVGPathGeometryElement.cpp | 2 +- gfx/layers/basic/BasicCompositor.cpp | 2 +- gfx/layers/client/TextureClient.cpp | 9 +++++---- gfx/layers/d3d11/TextureD3D11.cpp | 3 +-- gfx/thebes/gfxPlatform.h | 11 +---------- gfx/thebes/gfxPlatformGtk.h | 4 ++-- gfx/thebes/gfxWindowsPlatform.cpp | 19 +++---------------- gfx/thebes/gfxWindowsPlatform.h | 2 -- 8 files changed, 14 insertions(+), 38 deletions(-) diff --git a/dom/svg/nsSVGPathGeometryElement.cpp b/dom/svg/nsSVGPathGeometryElement.cpp index 2d2e9b22d55f..76e12b0aed0d 100644 --- a/dom/svg/nsSVGPathGeometryElement.cpp +++ b/dom/svg/nsSVGPathGeometryElement.cpp @@ -81,7 +81,7 @@ nsSVGPathGeometryElement::GetOrBuildPath(const DrawTarget& aDrawTarget, { // We only cache the path if it matches the backend used for screen painting: bool cacheable = aDrawTarget.GetBackendType() == - gfxPlatform::GetPlatform()->GetDefaultContentBackend(); + gfxPlatform::GetPlatform()->GetContentBackend(); // Checking for and returning mCachedPath before checking the pref means // that the pref is only live on page reload (or app restart for SVG in diff --git a/gfx/layers/basic/BasicCompositor.cpp b/gfx/layers/basic/BasicCompositor.cpp index c1997f2b6aaf..4da1f0dcb9cb 100644 --- a/gfx/layers/basic/BasicCompositor.cpp +++ b/gfx/layers/basic/BasicCompositor.cpp @@ -74,7 +74,7 @@ BasicCompositor::BasicCompositor(nsIWidget *aWidget) SetBackend(LayersBackend::LAYERS_BASIC); mMaxTextureSize = - Factory::GetMaxSurfaceSize(gfxPlatform::GetPlatform()->GetContentBackendFor(LayersBackend::LAYERS_BASIC)); + Factory::GetMaxSurfaceSize(gfxPlatform::GetPlatform()->GetContentBackend()); } BasicCompositor::~BasicCompositor() diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index c7fd08112215..b7fdb98c4b4d 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -343,13 +343,13 @@ CreateBufferTextureClient(ISurfaceAllocator* aAllocator, } static inline gfx::BackendType -BackendTypeForBackendSelector(LayersBackend aLayersBackend, BackendSelector aSelector) +BackendTypeForBackendSelector(BackendSelector aSelector) { switch (aSelector) { case BackendSelector::Canvas: return gfxPlatform::GetPlatform()->GetPreferredCanvasBackend(); case BackendSelector::Content: - return gfxPlatform::GetPlatform()->GetContentBackendFor(aLayersBackend); + return gfxPlatform::GetPlatform()->GetContentBackend(); default: MOZ_ASSERT_UNREACHABLE("Unknown backend selector"); return gfx::BackendType::NONE; @@ -365,8 +365,7 @@ TextureClient::CreateForDrawing(ISurfaceAllocator* aAllocator, TextureFlags aTextureFlags, TextureAllocationFlags aAllocFlags) { - LayersBackend parentBackend = aAllocator->GetCompositorBackendType(); - gfx::BackendType moz2DBackend = BackendTypeForBackendSelector(parentBackend, aSelector); + gfx::BackendType moz2DBackend = BackendTypeForBackendSelector(aSelector); RefPtr texture; @@ -375,6 +374,7 @@ TextureClient::CreateForDrawing(ISurfaceAllocator* aAllocator, #endif #ifdef XP_WIN + LayersBackend parentBackend = aAllocator->GetCompositorBackendType(); if (parentBackend == LayersBackend::LAYERS_D3D11 && (moz2DBackend == gfx::BackendType::DIRECT2D || moz2DBackend == gfx::BackendType::DIRECT2D1_1) && @@ -407,6 +407,7 @@ TextureClient::CreateForDrawing(ISurfaceAllocator* aAllocator, #endif #ifdef MOZ_X11 + LayersBackend parentBackend = aAllocator->GetCompositorBackendType(); gfxSurfaceType type = gfxPlatform::GetPlatform()->ScreenReferenceSurface()->GetType(); diff --git a/gfx/layers/d3d11/TextureD3D11.cpp b/gfx/layers/d3d11/TextureD3D11.cpp index f0007474f7b4..51c8513316ec 100644 --- a/gfx/layers/d3d11/TextureD3D11.cpp +++ b/gfx/layers/d3d11/TextureD3D11.cpp @@ -579,8 +579,7 @@ TextureClientD3D11::AllocateForSurface(gfx::IntSize aSize, TextureAllocationFlag // When we're not on the main thread we're not going to be using Direct2D // to access the contents of this texture client so we will always use D3D11. - BackendType backend = windowsPlatform->GetContentBackendFor(LayersBackend::LAYERS_D3D11); - bool haveD3d11Backend = (backend == BackendType::DIRECT2D1_1) || !NS_IsMainThread(); + bool haveD3d11Backend = windowsPlatform->GetContentBackend() == BackendType::DIRECT2D1_1 || !NS_IsMainThread(); if (haveD3d11Backend) { if (!AllocateD3D11Surface(d3d11device, aSize)) { diff --git a/gfx/thebes/gfxPlatform.h b/gfx/thebes/gfxPlatform.h index 1eb4762f55e9..bc4a5b25d989 100644 --- a/gfx/thebes/gfxPlatform.h +++ b/gfx/thebes/gfxPlatform.h @@ -271,16 +271,7 @@ public: } void GetApzSupportInfo(mozilla::widget::InfoObject& aObj); - // Get the default content backend that will be used with the default - // compositor. If the compositor is known when calling this function, - // GetContentBackendFor() should be called instead. - mozilla::gfx::BackendType GetDefaultContentBackend() { - return mContentBackend; - } - - // Return the best content backend available that is compatible with the - // given layers backend. - virtual mozilla::gfx::BackendType GetContentBackendFor(mozilla::layers::LayersBackend aLayers) { + mozilla::gfx::BackendType GetContentBackend() { return mContentBackend; } diff --git a/gfx/thebes/gfxPlatformGtk.h b/gfx/thebes/gfxPlatformGtk.h index 548d7b704d73..9adac7f39bb5 100644 --- a/gfx/thebes/gfxPlatformGtk.h +++ b/gfx/thebes/gfxPlatformGtk.h @@ -99,8 +99,8 @@ public: bool UseXRender() { #if defined(MOZ_X11) - if (GetDefaultContentBackend() != mozilla::gfx::BackendType::NONE && - GetDefaultContentBackend() != mozilla::gfx::BackendType::CAIRO) + if (GetContentBackend() != mozilla::gfx::BackendType::NONE && + GetContentBackend() != mozilla::gfx::BackendType::CAIRO) return false; return sUseXRender; diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index ee80b4e6fa45..ed4113be91f4 100755 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -512,14 +512,12 @@ gfxWindowsPlatform::HandleDeviceReset() return true; } -static const BackendType SOFTWARE_BACKEND = BackendType::CAIRO; - void gfxWindowsPlatform::UpdateBackendPrefs() { - uint32_t canvasMask = BackendTypeBit(SOFTWARE_BACKEND); - uint32_t contentMask = BackendTypeBit(SOFTWARE_BACKEND); - BackendType defaultBackend = SOFTWARE_BACKEND; + uint32_t canvasMask = BackendTypeBit(BackendType::CAIRO); + uint32_t contentMask = BackendTypeBit(BackendType::CAIRO); + BackendType defaultBackend = BackendType::CAIRO; if (GetD2DStatus() == FeatureStatus::Available) { mRenderMode = RENDER_DIRECT2D; canvasMask |= BackendTypeBit(BackendType::DIRECT2D); @@ -552,17 +550,6 @@ gfxWindowsPlatform::UpdateRenderMode() } } -mozilla::gfx::BackendType -gfxWindowsPlatform::GetContentBackendFor(mozilla::layers::LayersBackend aLayers) -{ - if (aLayers == LayersBackend::LAYERS_D3D11) { - return gfxPlatform::GetDefaultContentBackend(); - } - - // If we're not accelerated with D3D11, never use D2D. - return SOFTWARE_BACKEND; -} - #ifdef CAIRO_HAS_D2D_SURFACE HRESULT gfxWindowsPlatform::CreateDevice(nsRefPtr &adapter1, diff --git a/gfx/thebes/gfxWindowsPlatform.h b/gfx/thebes/gfxWindowsPlatform.h index 240e36cbf486..f93b39d4aa6f 100644 --- a/gfx/thebes/gfxWindowsPlatform.h +++ b/gfx/thebes/gfxWindowsPlatform.h @@ -345,8 +345,6 @@ private: IDXGIAdapter1 *GetDXGIAdapter(); bool IsDeviceReset(HRESULT hr, DeviceResetReason* aReason); - mozilla::gfx::BackendType GetContentBackendFor(mozilla::layers::LayersBackend aLayers) override; - #ifdef CAIRO_HAS_DWRITE_FONT nsRefPtr mDWriteFactory; nsRefPtr mRenderingParams[TEXT_RENDERING_COUNT];