From 9c5b9aab4e335983eb6d89f180a9e60a9617315d Mon Sep 17 00:00:00 2001 From: "zmo@google.com" Date: Mon, 1 Mar 2010 22:43:44 +0000 Subject: When an o3d window does not belong to any monitor (off screen), instead of failing, use the default monitor/adapter instead. Review URL: http://codereview.chromium.org/661300 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40311 0039d316-1c4b-4281-b951-d872f2087c98 --- o3d/core/win/d3d9/renderer_d3d9.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'o3d') diff --git a/o3d/core/win/d3d9/renderer_d3d9.cc b/o3d/core/win/d3d9/renderer_d3d9.cc index 2e55ddd..fe36184 100644 --- a/o3d/core/win/d3d9/renderer_d3d9.cc +++ b/o3d/core/win/d3d9/renderer_d3d9.cc @@ -355,13 +355,7 @@ Renderer::InitStatus CreateDirect3D(Direct3DCreate9_Ptr d3d_create_function, } // Get the current monitor and adapter. - *monitor = MonitorFromWindow(window, MONITOR_DEFAULTTONULL); - if (*monitor == NULL) { - DLOG(ERROR) << "Failed to get monitor from window"; - (*d3d)->Release(); - *d3d = NULL; - return Renderer::INITIALIZATION_ERROR; - } + *monitor = MonitorFromWindow(window, MONITOR_DEFAULTTOPRIMARY); if (!GetAdapterFromMonitor(*d3d, *monitor, adapter)) { DLOG(WARNING) << "Failed to get adapter, use the default one"; *adapter = D3DADAPTER_DEFAULT; -- cgit v1.1