From 2b2120bb857ea49b6eb2720c943fc6e186fafb16 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Tue, 17 Sep 2013 19:21:30 -0400 Subject: [PATCH] Bug 831086 - Prefer Metro gfx handling when resizing buffers. r=bas --- gfx/layers/d3d10/LayerManagerD3D10.cpp | 14 ++++++-------- gfx/layers/d3d11/CompositorD3D11.cpp | 12 +++++------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/gfx/layers/d3d10/LayerManagerD3D10.cpp b/gfx/layers/d3d10/LayerManagerD3D10.cpp index 5810c8fd0597..18b3e7f81005 100644 --- a/gfx/layers/d3d10/LayerManagerD3D10.cpp +++ b/gfx/layers/d3d10/LayerManagerD3D10.cpp @@ -25,9 +25,9 @@ #include "../d3d9/Nv3DVUtils.h" #include "gfxCrashReporterUtils.h" +#include "nsWindowsHelpers.h" #ifdef MOZ_METRO #include "DXGI1_2.h" -#include "nsWindowsHelpers.h" #endif using namespace std; @@ -640,17 +640,15 @@ LayerManagerD3D10::VerifyBufferSize() } mRTView = nullptr; - if (gfxWindowsPlatform::IsOptimus()) { - mSwapChain->ResizeBuffers(1, rect.width, rect.height, - DXGI_FORMAT_B8G8R8A8_UNORM, - 0); -#ifdef MOZ_METRO - } else if (IsRunningInWindowsMetro()) { + if (IsRunningInWindowsMetro()) { mSwapChain->ResizeBuffers(2, rect.width, rect.height, DXGI_FORMAT_B8G8R8A8_UNORM, 0); mDisableSequenceForNextFrame = true; -#endif + } else if (gfxWindowsPlatform::IsOptimus()) { + mSwapChain->ResizeBuffers(1, rect.width, rect.height, + DXGI_FORMAT_B8G8R8A8_UNORM, + 0); } else { mSwapChain->ResizeBuffers(1, rect.width, rect.height, DXGI_FORMAT_B8G8R8A8_UNORM, diff --git a/gfx/layers/d3d11/CompositorD3D11.cpp b/gfx/layers/d3d11/CompositorD3D11.cpp index 59061839ed45..53f4c9a23a02 100644 --- a/gfx/layers/d3d11/CompositorD3D11.cpp +++ b/gfx/layers/d3d11/CompositorD3D11.cpp @@ -750,17 +750,15 @@ CompositorD3D11::VerifyBufferSize() mDefaultRT = nullptr; - if (gfxWindowsPlatform::IsOptimus()) { - mSwapChain->ResizeBuffers(1, mSize.width, mSize.height, - DXGI_FORMAT_B8G8R8A8_UNORM, - 0); -#ifdef MOZ_METRO - } else if (IsRunningInWindowsMetro()) { + if (IsRunningInWindowsMetro()) { mSwapChain->ResizeBuffers(2, mSize.width, mSize.height, DXGI_FORMAT_B8G8R8A8_UNORM, 0); mDisableSequenceForNextFrame = true; -#endif + } else if (gfxWindowsPlatform::IsOptimus()) { + mSwapChain->ResizeBuffers(1, mSize.width, mSize.height, + DXGI_FORMAT_B8G8R8A8_UNORM, + 0); } else { mSwapChain->ResizeBuffers(1, mSize.width, mSize.height, DXGI_FORMAT_B8G8R8A8_UNORM,