Henri Verbeet : wined3d: Pass a wined3d_context_gl structure to context_set_pixel_format().

Alexandre Julliard julliard at winehq.org
Mon May 20 15:50:48 CDT 2019


Module: wine
Branch: master
Commit: 6cd822c38abbe45c1b0e744e0845919671b3e90f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6cd822c38abbe45c1b0e744e0845919671b3e90f

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Sun May 19 18:48:46 2019 +0430

wined3d: Pass a wined3d_context_gl structure to context_set_pixel_format().

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/context.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 0908ed1..aa4d260 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1152,19 +1152,18 @@ static BOOL wined3d_context_gl_restore_pixel_format(struct wined3d_context_gl *c
     return ret;
 }
 
-static BOOL context_set_pixel_format(struct wined3d_context *context)
+static BOOL wined3d_context_gl_set_pixel_format(struct wined3d_context_gl *context_gl)
 {
-    struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
-    const struct wined3d_gl_info *gl_info = context->gl_info;
-    BOOL private = context->hdc_is_private;
-    int format = context->pixel_format;
-    HDC dc = context->hdc;
+    const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
+    BOOL private = context_gl->c.hdc_is_private;
+    int format = context_gl->c.pixel_format;
+    HDC dc = context_gl->c.hdc;
     int current;
 
-    if (private && context->hdc_has_format)
+    if (private && context_gl->c.hdc_has_format)
         return TRUE;
 
-    if (!private && WindowFromDC(dc) != context->win_handle)
+    if (!private && WindowFromDC(dc) != context_gl->c.win_handle)
         return FALSE;
 
     current = gl_info->gl_ops.wgl.p_wglGetPixelFormat(dc);
@@ -1180,8 +1179,8 @@ static BOOL context_set_pixel_format(struct wined3d_context *context)
             return FALSE;
         }
 
-        context->restore_pf = 0;
-        context->restore_pf_win = private ? NULL : WindowFromDC(dc);
+        context_gl->c.restore_pf = 0;
+        context_gl->c.restore_pf_win = private ? NULL : WindowFromDC(dc);
         goto success;
     }
 
@@ -1201,12 +1200,12 @@ static BOOL context_set_pixel_format(struct wined3d_context *context)
         }
 
         win = private ? NULL : WindowFromDC(dc);
-        if (win != context->restore_pf_win)
+        if (win != context_gl->c.restore_pf_win)
         {
             wined3d_context_gl_restore_pixel_format(context_gl);
 
-            context->restore_pf = private ? 0 : current;
-            context->restore_pf_win = win;
+            context_gl->c.restore_pf = private ? 0 : current;
+            context_gl->c.restore_pf_win = win;
         }
 
         goto success;
@@ -1222,16 +1221,17 @@ static BOOL context_set_pixel_format(struct wined3d_context *context)
 
 success:
     if (private)
-        context->hdc_has_format = TRUE;
+        context_gl->c.hdc_has_format = TRUE;
     return TRUE;
 }
 
 static BOOL context_set_gl_context(struct wined3d_context *ctx)
 {
+    struct wined3d_context_gl *context_gl = wined3d_context_gl(ctx);
     struct wined3d_swapchain *swapchain = ctx->swapchain;
     BOOL backup = FALSE;
 
-    if (!context_set_pixel_format(ctx))
+    if (!wined3d_context_gl_set_pixel_format(context_gl))
     {
         WARN("Failed to set pixel format %d on device context %p.\n",
                 ctx->pixel_format, ctx->hdc);
@@ -1265,7 +1265,7 @@ static BOOL context_set_gl_context(struct wined3d_context *ctx)
         ctx->hdc_is_private = TRUE;
         ctx->hdc_has_format = FALSE;
 
-        if (!context_set_pixel_format(ctx))
+        if (!wined3d_context_gl_set_pixel_format(context_gl))
         {
             ERR("Failed to set pixel format %d on device context %p.\n",
                     ctx->pixel_format, ctx->hdc);
@@ -2113,7 +2113,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi
 
     context_enter(context);
 
-    if (!context_set_pixel_format(context))
+    if (!wined3d_context_gl_set_pixel_format(context_gl))
     {
         ERR("Failed to set pixel format %d on device context %p.\n", context->pixel_format, context->hdc);
         context_release(context);




More information about the wine-cvs mailing list