From 357ea123d909639991d2007e9e18a1f115a8b29e Mon Sep 17 00:00:00 2001
From: Henri Verbeet <hverbeet@codeweavers.com>
Date: Thu, 23 Jul 2009 10:54:37 +0200
Subject: [PATCH] wined3d: get_drawable_size() needs a context.

---
 dlls/wined3d/device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 94000dff8aa..10b20fb389d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4942,9 +4942,10 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This,  IWineD3DSurfa
         }
     }
 
+    ActivateContext(This, (IWineD3DSurface *)target, CTXUSAGE_CLEAR);
+
     target->get_drawable_size(target, &drawable_width, &drawable_height);
 
-    ActivateContext(This, (IWineD3DSurface *) target, CTXUSAGE_CLEAR);
     ENTER_GL();
 
     /* Only set the values up once, as they are not changing */