From: Emmanuele Bassi Date: Fri, 20 Feb 2009 15:39:32 +0000 (+0000) Subject: [backend] Update the viewport when updating the GL context X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f4df307ddd6e0c977c57aaba1b1e4adfa143c1b0;p=profile%2Fivi%2Fclutter.git [backend] Update the viewport when updating the GL context Bug 1442 - multistage, same-window resize events invalidate stage When ensuring that the GL context is attached to the correct ClutterStage we need to set the SYNC_MATRICES flag on the stage itself. This is needed in case the size of the new stage does not match the size of the old -- thus requiring a call to glViewport() when the paint cycle starts. --- diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c index 2c94c02..36dbfad 100644 --- a/clutter/clutter-backend.c +++ b/clutter/clutter-backend.c @@ -310,6 +310,17 @@ _clutter_backend_ensure_context (ClutterBackend *backend, * potential issue of GL calls with no context) */ current_context_stage = stage; + + /* if the new stage has a different size than the previous one + * we need to update the viewport; we do it by simply setting the + * SYNC_MATRICES flag and letting the next redraw cycle take care + * of calling glViewport() + */ + if (current_context_stage) + { + CLUTTER_SET_PRIVATE_FLAGS (current_context_stage, + CLUTTER_ACTOR_SYNC_MATRICES); + } } else CLUTTER_NOTE (MULTISTAGE, "Stage is the same");