Bug 1209446 - Make sure mFrameInProgress flag is set to true only when we actually begin drawing new frame. r=nical
authorPiotr Tworek <tworaz666@gmail.com>
Tue, 29 Sep 2015 08:18:00 +0200
changeset 265266 4f2620f7822d6929f57f90c456e24910a76ad933
parent 265265 4b4bedf4f6bb0e5956684f5890650b105573ef58
child 265267 03afd4febf0bc2cc136090ada5218bc174251020
push id15444
push userkwierso@gmail.com
push dateWed, 30 Sep 2015 20:57:17 +0000
treeherderfx-team@b00623eb7735 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1209446
milestone44.0a1
Bug 1209446 - Make sure mFrameInProgress flag is set to true only when we actually begin drawing new frame. r=nical
gfx/layers/opengl/CompositorOGL.cpp
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -614,17 +614,16 @@ CompositorOGL::BeginFrame(const nsIntReg
                           Rect *aClipRectOut,
                           Rect *aRenderBoundsOut)
 {
   PROFILER_LABEL("CompositorOGL", "BeginFrame",
     js::ProfileEntry::Category::GRAPHICS);
 
   MOZ_ASSERT(!mFrameInProgress, "frame still in progress (should have called EndFrame");
 
-  mFrameInProgress = true;
   gfx::Rect rect;
   if (mUseExternalSurfaceSize) {
     rect = gfx::Rect(0, 0, mSurfaceSize.width, mSurfaceSize.height);
   } else {
     rect = gfx::Rect(aRenderBounds.x, aRenderBounds.y, aRenderBounds.width, aRenderBounds.height);
   }
 
   if (aRenderBoundsOut) {
@@ -634,16 +633,19 @@ CompositorOGL::BeginFrame(const nsIntReg
   GLint width = rect.width;
   GLint height = rect.height;
 
   // We can't draw anything to something with no area
   // so just return
   if (width == 0 || height == 0)
     return;
 
+  // We're about to actually draw a frame.
+  mFrameInProgress = true;
+
   // 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(ForceMakeCurrent);
 
     mWidgetSize.width = width;