summaryrefslogtreecommitdiffstats
path: root/src/angle/patches/0008-ANGLE-Use-pixel-sizes-in-the-XAML-swap-chain.patch
diff options
context:
space:
mode:
Diffstat (limited to 'src/angle/patches/0008-ANGLE-Use-pixel-sizes-in-the-XAML-swap-chain.patch')
-rw-r--r--src/angle/patches/0008-ANGLE-Use-pixel-sizes-in-the-XAML-swap-chain.patch278
1 files changed, 159 insertions, 119 deletions
diff --git a/src/angle/patches/0008-ANGLE-Use-pixel-sizes-in-the-XAML-swap-chain.patch b/src/angle/patches/0008-ANGLE-Use-pixel-sizes-in-the-XAML-swap-chain.patch
index cf383d7106..7f7517e554 100644
--- a/src/angle/patches/0008-ANGLE-Use-pixel-sizes-in-the-XAML-swap-chain.patch
+++ b/src/angle/patches/0008-ANGLE-Use-pixel-sizes-in-the-XAML-swap-chain.patch
@@ -1,7 +1,7 @@
-From 333bb863e5c3e04fcc513e4750208fa3742be7a1 Mon Sep 17 00:00:00 2001
-From: Andrew Knight <andrew.knight@intopalo.com>
-Date: Sat, 8 Aug 2015 21:42:03 +0300
-Subject: [PATCH 2/4] ANGLE: Use pixel sizes in the XAML swap chain
+From 7a3851e74393eb254826face20b8e9af74bbdf0b Mon Sep 17 00:00:00 2001
+From: Oliver Wolff <oliver.wolff@theqtcompany.com>
+Date: Thu, 17 Mar 2016 15:46:56 +0100
+Subject: [PATCH] ANGLE: Use pixel sizes in the XAML swap chain
This is necessary for Qt applications, as they render to GL in physical
pixels. This is consistent with the CoreWindow swap chain behavior.
@@ -15,19 +15,19 @@ This change only affects Windows Runtime targets.
Change-Id: I401ae81028a9dfdb9da37f51c60844467c476f76
---
.../libANGLE/renderer/d3d/d3d11/SwapChain11.cpp | 46 ----------------------
- .../d3d/d3d11/winrt/CoreWindowNativeWindow.cpp | 21 ----------
- .../d3d/d3d11/winrt/CoreWindowNativeWindow.h | 4 +-
- .../d3d/d3d11/winrt/InspectableNativeWindow.cpp | 21 ++++++++++
- .../d3d/d3d11/winrt/InspectableNativeWindow.h | 10 +++--
- .../d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp | 30 ++++++++------
+ .../d3d/d3d11/winrt/CoreWindowNativeWindow.cpp | 25 +-----------
+ .../d3d/d3d11/winrt/CoreWindowNativeWindow.h | 7 +---
+ .../d3d/d3d11/winrt/InspectableNativeWindow.cpp | 20 ++++++++++
+ .../d3d/d3d11/winrt/InspectableNativeWindow.h | 9 +++--
+ .../d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp | 43 ++++++++++++--------
.../d3d/d3d11/winrt/SwapChainPanelNativeWindow.h | 7 ++--
- 7 files changed, 49 insertions(+), 90 deletions(-)
+ 7 files changed, 58 insertions(+), 99 deletions(-)
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
-index dc539cf..0af2cf1 100644
+index f80f24b..785a83c 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
-@@ -154,14 +154,8 @@ EGLint SwapChain11::resetOffscreenTexture(int backbufferWidth, int backbufferHei
+@@ -226,14 +226,8 @@ EGLint SwapChain11::resetOffscreenColorBuffer(int backbufferWidth, int backbuffe
const bool useSharedResource = !mNativeWindow.getNativeWindow() && mRenderer->getShareHandleSupport();
D3D11_TEXTURE2D_DESC offscreenTextureDesc = {0};
@@ -42,9 +42,9 @@ index dc539cf..0af2cf1 100644
offscreenTextureDesc.Format = backbufferFormatInfo.texFormat;
offscreenTextureDesc.MipLevels = 1;
offscreenTextureDesc.ArraySize = 1;
-@@ -241,14 +235,8 @@ EGLint SwapChain11::resetOffscreenTexture(int backbufferWidth, int backbufferHei
- if (mDepthBufferFormat != GL_NONE)
- {
+@@ -346,14 +340,8 @@ EGLint SwapChain11::resetOffscreenDepthBuffer(int backbufferWidth, int backbuffe
+ d3d11::GetTextureFormatInfo(mDepthBufferFormat, mRenderer->getRenderer11DeviceCaps());
+
D3D11_TEXTURE2D_DESC depthStencilTextureDesc;
-#if defined(ANGLE_ENABLE_WINDOWS_STORE) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
- const int textureLength = std::max(backbufferWidth, backbufferHeight);
@@ -57,18 +57,18 @@ index dc539cf..0af2cf1 100644
depthStencilTextureDesc.Format = depthBufferFormatInfo.texFormat;
depthStencilTextureDesc.MipLevels = 1;
depthStencilTextureDesc.ArraySize = 1;
-@@ -349,7 +337,6 @@ EGLint SwapChain11::resize(EGLint backbufferWidth, EGLint backbufferHeight)
+@@ -438,7 +426,6 @@ EGLint SwapChain11::resize(EGLint backbufferWidth, EGLint backbufferHeight)
return EGL_SUCCESS;
}
-#if !defined(ANGLE_ENABLE_WINDOWS_STORE) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
// Can only call resize if we have already created our swap buffer and resources
- ASSERT(mSwapChain && mBackBufferTexture && mBackBufferRTView);
+ ASSERT(mSwapChain && mBackBufferTexture && mBackBufferRTView && mBackBufferSRView);
-@@ -392,12 +379,6 @@ EGLint SwapChain11::resize(EGLint backbufferWidth, EGLint backbufferHeight)
- }
+@@ -496,12 +483,6 @@ EGLint SwapChain11::resize(EGLint backbufferWidth, EGLint backbufferHeight)
+ mFirstSwap = true;
- return resetOffscreenTexture(backbufferWidth, backbufferHeight);
+ return resetOffscreenBuffers(backbufferWidth, backbufferHeight);
-#else
- // Do nothing on Windows Phone apart from updating the internal buffer/width height
- mWidth = backbufferWidth;
@@ -77,8 +77,8 @@ index dc539cf..0af2cf1 100644
-#endif
}
- EGLint SwapChain11::reset(int backbufferWidth, int backbufferHeight, EGLint swapInterval)
-@@ -552,27 +533,6 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
+ DXGI_FORMAT SwapChain11::getSwapChainNativeFormat() const
+@@ -725,27 +706,6 @@ EGLint SwapChain11::copyOffscreenToBackbuffer(EGLint x, EGLint y, EGLint width,
d3d11::PositionTexCoordVertex *vertices = static_cast<d3d11::PositionTexCoordVertex*>(mappedResource.pData);
@@ -106,7 +106,7 @@ index dc539cf..0af2cf1 100644
// Create a quad in homogeneous coordinates
float x1 = (x / float(mWidth)) * 2.0f - 1.0f;
float y1 = (y / float(mHeight)) * 2.0f - 1.0f;
-@@ -588,7 +548,6 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
+@@ -771,7 +731,6 @@ EGLint SwapChain11::copyOffscreenToBackbuffer(EGLint x, EGLint y, EGLint width,
d3d11::SetPositionTexCoordVertex(&vertices[1], x1, y2, u1, v2);
d3d11::SetPositionTexCoordVertex(&vertices[2], x2, y1, u2, v1);
d3d11::SetPositionTexCoordVertex(&vertices[3], x2, y2, u2, v2);
@@ -114,7 +114,7 @@ index dc539cf..0af2cf1 100644
deviceContext->Unmap(mQuadVB, 0);
-@@ -618,13 +577,8 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
+@@ -801,13 +760,8 @@ EGLint SwapChain11::copyOffscreenToBackbuffer(EGLint x, EGLint y, EGLint width,
D3D11_VIEWPORT viewport;
viewport.TopLeftX = 0;
viewport.TopLeftY = 0;
@@ -122,17 +122,26 @@ index dc539cf..0af2cf1 100644
- viewport.Width = (rotateL || rotateR) ? height : width;
- viewport.Height = (rotateL || rotateR) ? width : height;
-#else
- viewport.Width = mWidth;
- viewport.Height = mHeight;
+ viewport.Width = static_cast<FLOAT>(mWidth);
+ viewport.Height = static_cast<FLOAT>(mHeight);
-#endif
viewport.MinDepth = 0.0f;
viewport.MaxDepth = 1.0f;
deviceContext->RSSetViewports(1, &viewport);
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp
-index fa9a69c..f45a077 100644
+index b074e8c..f401db6 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp
-@@ -191,25 +191,4 @@ HRESULT GetCoreWindowSizeInPixels(const ComPtr<ABI::Windows::UI::Core::ICoreWind
+@@ -222,7 +222,7 @@ HRESULT CoreWindowNativeWindow::createSwapChain(ID3D11Device *device,
+ return result;
+ }
+
+-inline HRESULT CoreWindowNativeWindow::scaleSwapChain(const SIZE &windowSize, const RECT &clientRect)
++inline HRESULT CoreWindowNativeWindow::scaleSwapChain(const Size &windowSize, const RECT &clientRect)
+ {
+ // We don't need to do any additional work to scale CoreWindow swapchains.
+ // Using DXGI_SCALING_STRETCH to create the swapchain above does all the necessary work.
+@@ -240,27 +240,4 @@ HRESULT GetCoreWindowSizeInPixels(const ComPtr<ABI::Windows::UI::Core::ICoreWind
return result;
}
@@ -140,16 +149,18 @@ index fa9a69c..f45a077 100644
-static float GetLogicalDpi()
-{
- ComPtr<ABI::Windows::Graphics::Display::IDisplayPropertiesStatics> displayProperties;
-- float dpi = 96.0f;
-
- if (SUCCEEDED(GetActivationFactory(HStringReference(RuntimeClass_Windows_Graphics_Display_DisplayProperties).Get(), displayProperties.GetAddressOf())))
- {
+- float dpi = 96.0f;
- if (SUCCEEDED(displayProperties->get_LogicalDpi(&dpi)))
- {
- return dpi;
- }
- }
-- return dpi;
+-
+- // Return 96 dpi as a default if display properties cannot be obtained.
+- return 96.0f;
-}
-
-long ConvertDipsToPixels(float dips)
@@ -159,18 +170,28 @@ index fa9a69c..f45a077 100644
-}
}
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.h
-index 59df9d5..87cdfe6 100644
+index 4de235a..fc1cd12 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.h
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.h
-@@ -19,7 +19,6 @@ typedef ABI::Windows::Foundation::__FITypedEventHandler_2_Windows__CGraphics__CD
+@@ -19,8 +19,6 @@ typedef ABI::Windows::Foundation::__FITypedEventHandler_2_Windows__CGraphics__CD
namespace rx
{
-long ConvertDipsToPixels(float dips);
-
+-
class CoreWindowNativeWindow : public InspectableNativeWindow, public std::enable_shared_from_this<CoreWindowNativeWindow>
{
-@@ -64,8 +63,7 @@ class CoreWindowSizeChangedHandler :
+ public:
+@@ -36,7 +34,7 @@ class CoreWindowNativeWindow : public InspectableNativeWindow, public std::enabl
+ DXGISwapChain **swapChain) override;
+
+ protected:
+- HRESULT scaleSwapChain(const SIZE &windowSize, const RECT &clientRect) override;
++ HRESULT scaleSwapChain(const Size &windowSize, const RECT &clientRect) override;
+
+ bool registerForSizeChangeEvents();
+ void unregisterForSizeChangeEvents();
+@@ -74,8 +72,7 @@ class CoreWindowSizeChangedHandler :
ABI::Windows::Foundation::Size windowSize;
if (SUCCEEDED(sizeChangedEventArgs->get_Size(&windowSize)))
{
@@ -181,14 +202,13 @@ index 59df9d5..87cdfe6 100644
}
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp
-index 2bf48c5..e83f479 100644
+index c9b203e..aacfadd 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp
-@@ -288,4 +288,25 @@ HRESULT GetOptionalSizePropertyValue(const ComPtr<ABI::Windows::Foundation::Coll
-
+@@ -381,4 +381,24 @@ HRESULT GetOptionalSinglePropertyValue(const ComPtr<ABI::Windows::Foundation::Co
return result;
}
-+
+
+static float GetLogicalDpi()
+{
+ ComPtr<ABI::Windows::Graphics::Display::IDisplayPropertiesStatics> displayProperties;
@@ -211,7 +231,7 @@ index 2bf48c5..e83f479 100644
+}
}
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h
-index 575bdf8..f053407 100644
+index 70e5fe7..cdbf40e 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h
@@ -26,6 +26,8 @@ using namespace ABI::Windows::Foundation::Collections;
@@ -223,122 +243,142 @@ index 575bdf8..f053407 100644
class InspectableNativeWindow
{
public:
-@@ -45,7 +47,7 @@ class InspectableNativeWindow
- virtual HRESULT createSwapChain(ID3D11Device *device, DXGIFactory *factory, DXGI_FORMAT format, unsigned int width, unsigned int height, DXGISwapChain **swapChain) = 0;
- virtual bool registerForSizeChangeEvents() = 0;
- virtual void unregisterForSizeChangeEvents() = 0;
-- virtual HRESULT scaleSwapChain(const SIZE& newSize) { return S_OK; }
-+ virtual HRESULT scaleSwapChain(const Size& newSize) { return S_OK; }
-
- bool getClientRect(RECT *rect)
- {
-@@ -59,11 +61,11 @@ class InspectableNativeWindow
- return true;
+@@ -65,7 +67,7 @@ class InspectableNativeWindow
}
-- void setNewClientSize(const SIZE &newSize)
-+ void setNewClientSize(const Size &newSize)
+ // setNewClientSize is used by the WinRT size change handler. It isn't used by the rest of ANGLE.
+- void setNewClientSize(const SIZE &newWindowSize)
++ void setNewClientSize(const Size &newWindowSize)
{
-- if (mSupportsSwapChainResize && !mRequiresSwapChainScaling)
-+ if (mSupportsSwapChainResize)
- {
-- mNewClientRect = { 0, 0, newSize.cx, newSize.cy };
-+ mNewClientRect = { 0, 0, ConvertDipsToPixels(newSize.Width), ConvertDipsToPixels(newSize.Height) };
- mClientRectChanged = true;
- }
+ // If the client doesn't support swapchain resizing then we should have already unregistered from size change handler
+ ASSERT(mSupportsSwapChainResize);
+@@ -76,7 +78,8 @@ class InspectableNativeWindow
+ if (!mSwapChainSizeSpecified)
+ {
+ // We don't have to check if a swapchain scale was specified here; the default value is 1.0f which will have no effect.
+- mNewClientRect = { 0, 0, static_cast<long>(newWindowSize.cx * mSwapChainScale), static_cast<long>(newWindowSize.cy * mSwapChainScale) };
++ mNewClientRect = { 0, 0, ConvertDipsToPixels(newSize.Width), ConvertDipsToPixels(newSize.Height) };
+ mClientRectChanged = true;
+
+ // If a scale was specified, then now is the time to apply the scale matrix for the new swapchain size and window size
+@@ -106,7 +109,7 @@ class InspectableNativeWindow
+ }
+ protected:
+- virtual HRESULT scaleSwapChain(const SIZE &windowSize, const RECT &clientRect) = 0;
++ virtual HRESULT scaleSwapChain(const Size &windowSize, const RECT &clientRect) = 0;
+
+ bool mSupportsSwapChainResize; // Support for IDXGISwapChain::ResizeBuffers method
+ bool mSwapChainSizeSpecified; // If an EGLRenderSurfaceSizeProperty was specified
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp
-index 53899db..0b48b54 100644
+index 1ed3645..d3ed35b 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp
-@@ -66,7 +66,7 @@ bool SwapChainPanelNativeWindow::initialize(EGLNativeWindowType window, IPropert
- }
- else
+@@ -171,12 +171,15 @@ bool SwapChainPanelNativeWindow::initialize(EGLNativeWindowType window, IPropert
{
-- result = GetSwapChainPanelSize(mSwapChainPanel, &mClientRect);
-+ result = GetSwapChainPanelSize(mSwapChainPanel, &mClientRect, &mRequiresSwapChainScaling);
+ SIZE swapChainPanelSize;
+ result = GetSwapChainPanelSize(mSwapChainPanel, mSwapChainPanelDispatcher,
+- &swapChainPanelSize);
++ &swapChainPanelSize, &mSwapChainScale);
++ if (mSwapChainScale != 1.0f)
++ mSwapChainScaleSpecified = true;
+
+ if (SUCCEEDED(result))
+ {
+ // Update the client rect to account for any swapchain scale factor
+- mClientRect = { 0, 0, static_cast<long>(swapChainPanelSize.cx * mSwapChainScale), static_cast<long>(swapChainPanelSize.cy * mSwapChainScale) };
++ mClientRect = { 0, 0, static_cast<long>(ConvertDipsToPixels(swapChainPanelSize.cx * mSwapChainScale)),
++ static_cast<long>(ConvertDipsToPixels(swapChainPanelSize.cy * mSwapChainScale)) };
+ }
}
}
-
-@@ -139,7 +139,6 @@ HRESULT SwapChainPanelNativeWindow::createSwapChain(ID3D11Device *device, DXGIFa
+@@ -269,7 +272,6 @@ HRESULT SwapChainPanelNativeWindow::createSwapChain(ID3D11Device *device,
ComPtr<IDXGISwapChain1> newSwapChain;
ComPtr<ISwapChainPanelNative> swapChainPanelNative;
-- RECT currentPanelSize = {};
+- SIZE currentPanelSize = {};
HRESULT result = factory->CreateSwapChainForComposition(device, &swapChainDesc, nullptr, newSwapChain.ReleaseAndGetAddressOf());
-@@ -167,13 +166,13 @@ HRESULT SwapChainPanelNativeWindow::createSwapChain(ID3D11Device *device, DXGIFa
- // first reading the current size of the swapchain panel, then scaling
- if (SUCCEEDED(result) && mRequiresSwapChainScaling)
+@@ -304,24 +306,24 @@ HRESULT SwapChainPanelNativeWindow::createSwapChain(ID3D11Device *device,
{
-- result = GetSwapChainPanelSize(mSwapChainPanel, &currentPanelSize);
-- }
-+ ComPtr<ABI::Windows::UI::Xaml::IUIElement> uiElement;
-+ result = mSwapChainPanel.As(&uiElement);
-+ ASSERT(SUCCEEDED(result));
-
-- // Scale the swapchain to fit inside the contents of the panel.
-- if (SUCCEEDED(result) && mRequiresSwapChainScaling)
-- {
-- SIZE currentSize = { currentPanelSize.right, currentPanelSize.bottom };
-+ Size currentSize;
-+ result = uiElement->get_RenderSize(&currentSize);
-+ ASSERT(SUCCEEDED(result));
- result = scaleSwapChain(currentSize);
+ if (mSwapChainSizeSpecified || mSwapChainScaleSpecified)
+ {
+- result = GetSwapChainPanelSize(mSwapChainPanel, mSwapChainPanelDispatcher,
+- &currentPanelSize);
+-
+- // Scale the swapchain to fit inside the contents of the panel.
+- if (SUCCEEDED(result))
+- {
+- result = scaleSwapChain(currentPanelSize, mClientRect);
+- }
++ ComPtr<ABI::Windows::UI::Xaml::IUIElement> uiElement;
++ result = mSwapChainPanel.As(&uiElement);
++ ASSERT(SUCCEEDED(result));
++
++ Size currentSize;
++ result = uiElement->get_RenderSize(&currentSize);
++ ASSERT(SUCCEEDED(result));
++ result = scaleSwapChain(currentSize, mClientRect);
+ }
}
-@@ -190,9 +189,9 @@ HRESULT SwapChainPanelNativeWindow::createSwapChain(ID3D11Device *device, DXGIFa
return result;
}
--HRESULT SwapChainPanelNativeWindow::scaleSwapChain(const SIZE &newSize)
-+HRESULT SwapChainPanelNativeWindow::scaleSwapChain(const Size &newSize)
+-HRESULT SwapChainPanelNativeWindow::scaleSwapChain(const SIZE &windowSize, const RECT &clientRect)
++HRESULT SwapChainPanelNativeWindow::scaleSwapChain(const Size &windowSize, const RECT &clientRect)
{
-- ABI::Windows::Foundation::Size renderScale = { (float)newSize.cx/(float)mClientRect.right, (float)newSize.cy/(float)mClientRect.bottom };
-+ ABI::Windows::Foundation::Size renderScale = { newSize.Width / mNewClientRect.right, newSize.Height / mNewClientRect.bottom };
+- Size renderScale = {(float)windowSize.cx / (float)clientRect.right,
+- (float)windowSize.cy / (float)clientRect.bottom};
++ Size renderScale = {windowSize.Width / clientRect.right,
++ windowSize.Height / clientRect.bottom};
// Setup a scale matrix for the swap chain
DXGI_MATRIX_3X2_F scaleMatrix = {};
scaleMatrix._11 = renderScale.Width;
-@@ -208,7 +207,7 @@ HRESULT SwapChainPanelNativeWindow::scaleSwapChain(const SIZE &newSize)
- return result;
- }
-
--HRESULT GetSwapChainPanelSize(const ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> &swapChainPanel, RECT *windowSize)
-+HRESULT GetSwapChainPanelSize(const ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> &swapChainPanel, RECT *windowSize, bool *scalingActive)
+@@ -340,7 +342,7 @@ HRESULT SwapChainPanelNativeWindow::scaleSwapChain(const SIZE &windowSize, const
+ HRESULT GetSwapChainPanelSize(
+ const ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> &swapChainPanel,
+ const ComPtr<ICoreDispatcher> &dispatcher,
+- SIZE *windowSize)
++ SIZE *windowSize, float *scaleFactor)
{
- ComPtr<ABI::Windows::UI::Xaml::IUIElement> uiElement;
- ABI::Windows::Foundation::Size renderSize = { 0, 0 };
-@@ -220,7 +219,14 @@ HRESULT GetSwapChainPanelSize(const ComPtr<ABI::Windows::UI::Xaml::Controls::ISw
+ ComPtr<IUIElement> uiElement;
+ Size renderSize = {0, 0};
+@@ -357,9 +359,16 @@ HRESULT GetSwapChainPanelSize(
if (SUCCEEDED(result))
{
-- *windowSize = { 0, 0, lround(renderSize.Width), lround(renderSize.Height) };
+- *windowSize = { lround(renderSize.Width), lround(renderSize.Height) };
+ long width = ConvertDipsToPixels(renderSize.Width);
+ long height = ConvertDipsToPixels(renderSize.Height);
-+ *windowSize = { 0, 0, width, height };
++ *windowSize = { width, height };
+
-+ if (scalingActive)
++ if (scaleFactor)
+ {
-+ *scalingActive = width != renderSize.Width || height != renderSize.Height;
++ *scaleFactor = renderSize.Width / width;
+ }
}
return result;
+ }
+-}
+\ No newline at end of file
++}
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.h
-index caf327d..5debd2f 100644
+index 9cc051d..09d87ad 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.h
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.h
-@@ -22,7 +22,7 @@ class SwapChainPanelNativeWindow : public InspectableNativeWindow, public std::e
+@@ -28,7 +28,7 @@ class SwapChainPanelNativeWindow : public InspectableNativeWindow, public std::e
+ DXGISwapChain **swapChain) override;
+
+ protected:
+- HRESULT scaleSwapChain(const SIZE &windowSize, const RECT &clientRect) override;
++ HRESULT scaleSwapChain(const Size &windowSize, const RECT &clientRect) override;
+
bool registerForSizeChangeEvents();
void unregisterForSizeChangeEvents();
- HRESULT createSwapChain(ID3D11Device *device, DXGIFactory *factory, DXGI_FORMAT format, unsigned int width, unsigned int height, DXGISwapChain **swapChain);
-- HRESULT scaleSwapChain(const SIZE &newSize);
-+ HRESULT scaleSwapChain(const Size &newSize) override;
-
- private:
- ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> mSwapChainPanel;
-@@ -62,8 +62,7 @@ class SwapChainPanelSizeChangedHandler :
+@@ -72,8 +72,7 @@ class SwapChainPanelSizeChangedHandler :
HRESULT result = sizeChangedEventArgs->get_NewSize(&newSize);
if (SUCCEEDED(result))
{
@@ -348,14 +388,14 @@ index caf327d..5debd2f 100644
}
}
-@@ -74,6 +73,6 @@ class SwapChainPanelSizeChangedHandler :
- std::weak_ptr<InspectableNativeWindow> mHost;
- };
-
--HRESULT GetSwapChainPanelSize(const ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> &swapChainPanel, RECT *windowSize);
-+HRESULT GetSwapChainPanelSize(const ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> &swapChainPanel, RECT *windowSize, bool *scalingActive = nullptr);
+@@ -87,6 +86,6 @@ class SwapChainPanelSizeChangedHandler :
+ HRESULT GetSwapChainPanelSize(
+ const ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> &swapChainPanel,
+ const ComPtr<ABI::Windows::UI::Core::ICoreDispatcher> &dispatcher,
+- SIZE *windowSize);
++ SIZE *windowSize, float *scaleFactor);
}
#endif // LIBANGLE_RENDERER_D3D_D3D11_WINRT_SWAPCHAINPANELNATIVEWINDOW_H_
--
-1.9.5.msysgit.1
+2.7.0.windows.1