ANGLE D3D11: Always execute QueryInterface

ASSERT removes the condition when building for release mode. However,
QueryInterface must be called in any case. Adopt to using ASSERT(false)
like in other occurrences in angle.

This is a follow-up patch to 331bc16afd

Change-Id: I4413bab06b5a529fcbd09bbc20828fcdcf4e4fc6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
This commit is contained in:
Maurice Kalinowski 2013-12-03 14:52:18 +01:00 committed by The Qt Project
parent 4f2471b8cc
commit ae8948a0a9
2 changed files with 63 additions and 2 deletions

View File

@ -118,7 +118,12 @@ bool Surface::resetSwapChain()
#else
ABI::Windows::Foundation::Rect windowRect;
ABI::Windows::UI::Core::ICoreWindow *window;
ASSERT(SUCCEEDED(mWindow->QueryInterface(IID_PPV_ARGS(&window))));
HRESULT result = mWindow->QueryInterface(IID_PPV_ARGS(&window));
if (FAILED(result))
{
ASSERT(false);
return false;
}
window->get_Bounds(&windowRect);
width = windowRect.Width;
height = windowRect.Height;
@ -342,7 +347,12 @@ bool Surface::checkForOutOfDateSwapChain()
#else
ABI::Windows::Foundation::Rect windowRect;
ABI::Windows::UI::Core::ICoreWindow *window;
ASSERT(SUCCEEDED(mWindow->QueryInterface(IID_PPV_ARGS(&window))));
HRESULT result = mWindow->QueryInterface(IID_PPV_ARGS(&window));
if (FAILED(result))
{
ASSERT(false);
return false;
}
window->get_Bounds(&windowRect);
int clientWidth = windowRect.Width;
int clientHeight = windowRect.Height;

View File

@ -0,0 +1,51 @@
From 4d1906f0b81f2b61adf9640ae6cef9d503c33209 Mon Sep 17 00:00:00 2001
From: Maurice Kalinowski <maurice.kalinowski@digia.com>
Date: Tue, 3 Dec 2013 14:52:18 +0100
Subject: [PATCH] ANGLE D3D11: Always execute QueryInterface
ASSERT removes the condition when building for release mode. However,
QueryInterface must be called in any case. Adopt to using ASSERT(false)
like in other occurrences in angle.
This is a follow-up patch to 331bc16afd23414493b842819e0b747e8f364243
Change-Id: I4413bab06b5a529fcbd09bbc20828fcdcf4e4fc6
---
src/3rdparty/angle/src/libEGL/Surface.cpp | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/3rdparty/angle/src/libEGL/Surface.cpp b/src/3rdparty/angle/src/libEGL/Surface.cpp
index ee8d480..99d0c1d 100644
--- a/src/3rdparty/angle/src/libEGL/Surface.cpp
+++ b/src/3rdparty/angle/src/libEGL/Surface.cpp
@@ -118,7 +118,12 @@ bool Surface::resetSwapChain()
#else
ABI::Windows::Foundation::Rect windowRect;
ABI::Windows::UI::Core::ICoreWindow *window;
- ASSERT(SUCCEEDED(mWindow->QueryInterface(IID_PPV_ARGS(&window))));
+ HRESULT result = mWindow->QueryInterface(IID_PPV_ARGS(&window));
+ if (FAILED(result))
+ {
+ ASSERT(false);
+ return false;
+ }
window->get_Bounds(&windowRect);
width = windowRect.Width;
height = windowRect.Height;
@@ -342,7 +347,12 @@ bool Surface::checkForOutOfDateSwapChain()
#else
ABI::Windows::Foundation::Rect windowRect;
ABI::Windows::UI::Core::ICoreWindow *window;
- ASSERT(SUCCEEDED(mWindow->QueryInterface(IID_PPV_ARGS(&window))));
+ HRESULT result = mWindow->QueryInterface(IID_PPV_ARGS(&window));
+ if (FAILED(result))
+ {
+ ASSERT(false);
+ return false;
+ }
window->get_Bounds(&windowRect);
int clientWidth = windowRect.Width;
int clientHeight = windowRect.Height;
--
1.7.11.msysgit.0