From 7eb95710b4019a46bb4f64c4d3d52c9185847d59 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Sun, 16 Jan 2011 23:38:45 +1300 Subject: [PATCH] Bug 594253. Update mValidRegion by OR-ing with the visible region after repainting, instead of OR-ing with the redrawn region, since this leads to simpler region structures. r=cjones,a=blocking --- gfx/layers/basic/BasicLayers.cpp | 6 +++++- gfx/layers/opengl/ThebesLayerOGL.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gfx/layers/basic/BasicLayers.cpp b/gfx/layers/basic/BasicLayers.cpp index acc82ca82359..19730dd0a57b 100644 --- a/gfx/layers/basic/BasicLayers.cpp +++ b/gfx/layers/basic/BasicLayers.cpp @@ -423,7 +423,11 @@ protected: } aCallback(this, aContext, aRegionToDraw, aRegionToInvalidate, aCallbackData); - mValidRegion.Or(mValidRegion, aRegionToDraw); + // Everything that's visible has been validated. Do this instead of + // OR-ing with aRegionToDraw, since that can lead to a very complex region + // here (OR doesn't automatically simplify to the simplest possible + // representation of a region.) + mValidRegion.Or(mValidRegion, mVisibleRegion); } Buffer mBuffer; diff --git a/gfx/layers/opengl/ThebesLayerOGL.cpp b/gfx/layers/opengl/ThebesLayerOGL.cpp index de812d79114d..c4757bff8989 100644 --- a/gfx/layers/opengl/ThebesLayerOGL.cpp +++ b/gfx/layers/opengl/ThebesLayerOGL.cpp @@ -555,7 +555,11 @@ ThebesLayerOGL::RenderLayer(int aPreviousFrameBuffer, void* callbackData = mOGLManager->GetThebesLayerCallbackData(); callback(this, state.mContext, state.mRegionToDraw, state.mRegionToInvalidate, callbackData); - mValidRegion.Or(mValidRegion, state.mRegionToDraw); + // Everything that's visible has been validated. Do this instead of + // OR-ing with aRegionToDraw, since that can lead to a very complex region + // here (OR doesn't automatically simplify to the simplest possible + // representation of a region.) + mValidRegion.Or(mValidRegion, mVisibleRegion); } DEBUG_GL_ERROR_CHECK(gl());