~ubuntu-branches/ubuntu/wily/qtbase-opensource-src/wily

« back to all changes in this revision

Viewing changes to src/angle/patches/0004-Fix-black-screen-after-minimizing-OpenGL-window-with.patch

  • Committer: Package Import Robot
  • Author(s): Timo Jyrinki
  • Date: 2013-02-05 12:46:17 UTC
  • Revision ID: package-import@ubuntu.com-20130205124617-c8jouts182j002fx
Tags: upstream-5.0.1+dfsg
ImportĀ upstreamĀ versionĀ 5.0.1+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 85e9ba49580e307e1213c87cdbfdc301848f497f Mon Sep 17 00:00:00 2001
 
2
From: Miikka Heikkinen <miikka.heikkinen@digia.com>
 
3
Date: Tue, 20 Nov 2012 13:23:27 +0200
 
4
Subject: [PATCH] Fix black screen after minimizing OpenGL window with ANGLE
 
5
 
 
6
CreateTexture will fail on zero dimensions, so just release old target
 
7
and reset dimensions when resetSwapChain is called with zero size area.
 
8
 
 
9
Task-number: QTBUG-27994
 
10
Change-Id: I1e500c4fd4b92f7d9ea2a49a44f3fb930b575cd1
 
11
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
 
12
---
 
13
 src/3rdparty/angle/src/libEGL/Surface.cpp |   16 ++++++++++++++++
 
14
 1 files changed, 16 insertions(+), 0 deletions(-)
 
15
 
 
16
diff --git a/src/3rdparty/angle/src/libEGL/Surface.cpp b/src/3rdparty/angle/src/libEGL/Surface.cpp
 
17
index 8e920ab..174b403 100644
 
18
--- a/src/3rdparty/angle/src/libEGL/Surface.cpp
 
19
+++ b/src/3rdparty/angle/src/libEGL/Surface.cpp
 
20
@@ -224,6 +224,22 @@ bool Surface::resetSwapChain(int backbufferWidth, int backbufferHeight)
 
21
         pShareHandle = &mShareHandle;
 
22
     }
 
23
 
 
24
+    // CreateTexture will fail on zero dimensions, so just release old target
 
25
+    if (!backbufferWidth || !backbufferHeight)
 
26
+    {
 
27
+        if (mRenderTarget)
 
28
+        {
 
29
+            mRenderTarget->Release();
 
30
+            mRenderTarget = NULL;
 
31
+        }
 
32
+
 
33
+        mWidth = backbufferWidth;
 
34
+        mHeight = backbufferHeight;
 
35
+        mPresentIntervalDirty = false;
 
36
+
 
37
+        return true;
 
38
+    }
 
39
+
 
40
     result = device->CreateTexture(backbufferWidth, backbufferHeight, 1, D3DUSAGE_RENDERTARGET,
 
41
                                    mConfig->mRenderTargetFormat, D3DPOOL_DEFAULT, &mOffscreenTexture, pShareHandle);
 
42
     if (FAILED(result))
 
43
-- 
 
44
1.7.4.msysgit.0
 
45