Closed Bug 594892 Opened 10 years ago Closed 10 years ago

call MakeCurrent after a widget is resized


(Core :: Graphics, defect)

Not set





(Reporter: vlad, Assigned: vlad)



(1 file)

We may not need to do this, but after a widget is resized we should really make a real call to MakeCurrent; some platforms need this to notice that they widget's size changed.  In a lot of our code we're currently always calling MakeCurrent; this might be a performance win to get rid of this, like we do in the win32 code.

(Also adds some misc code in the WGL context for double buffered contexts, which we don't create, but we could.)
Attachment #473652 - Flags: review?(joe)
Comment on attachment 473652 [details] [diff] [review]
call makecurrent on resize

>@@ -518,6 +507,18 @@ LayerManagerOGL::Render()
>   if (rect.width == 0 || rect.height == 0)
>     return;
>+  // If the widget size changed, we have to force a MakeCurrent
>+  // to make sure that GL sees the updated widget size.
>+  if (mWidgetSize.width != width ||
>+      mWidgetSize.height != height)
>+  {
>+    MakeCurrent(PR_TRUE);
>+    mWidgetSize.width = width;
>+    mWidgetSize.height = height;
>+  } else {
>+    MakeCurrent();
>+  }

Shouldn't we do this in SetupBackBuffer instead?
Attachment #473652 - Flags: review?(joe) → review+

We could, doesn't really matter -- if we did it in SeupBackubuffer then we'd have to call MakeCurrent twice.  We can do some cleanup of this code in a followup.
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.