summaryrefslogtreecommitdiffstats
path: root/content/browser/gpu
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-03 23:33:19 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-03 23:33:19 +0000
commitdbc762fe0ab07ad747ef42a60854dfd831bca38b (patch)
tree0ab0f5ed221b0cec9237683193c79b25628eb9a5 /content/browser/gpu
parentd6ca9a3a0c76deb0723789d2844e028cf7fa419d (diff)
downloadchromium_src-dbc762fe0ab07ad747ef42a60854dfd831bca38b.zip
chromium_src-dbc762fe0ab07ad747ef42a60854dfd831bca38b.tar.gz
chromium_src-dbc762fe0ab07ad747ef42a60854dfd831bca38b.tar.bz2
Ensure that the GPU compositing window does not have zero area on windows.
This is because D3D fails to create a swap chain for a zero area window. BUG=84809 Review URL: http://codereview.chromium.org/7054061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87896 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu')
-rw-r--r--content/browser/gpu/gpu_process_host_ui_shim.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc
index a356f3b..0abee9f 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -4,6 +4,8 @@
#include "content/browser/gpu/gpu_process_host_ui_shim.h"
+#include <algorithm>
+
#include "base/id_map.h"
#include "base/process_util.h"
#include "base/debug/trace_event.h"
@@ -194,11 +196,13 @@ void GpuProcessHostUIShim::OnResizeView(int32 renderer_id,
XSync(display, False);
}
#elif defined(OS_WIN)
+ // Ensure window does not have zero area because D3D cannot create a zero
+ // area swap chain.
SetWindowPos(handle,
NULL,
0, 0,
- size.width(),
- size.height(),
+ std::max(1, size.width()),
+ std::max(1, size.height()),
SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER |
SWP_NOACTIVATE | SWP_DEFERERASE);
#endif