Bug 832508 - When resuming Fennec and re-recreating the surface, force a first-paint notification from the compositor. r=Cwiiis

This commit is contained in:
Kartikaya Gupta 2013-02-04 15:13:17 -05:00
parent 1a58b3e2b0
commit 61377e6e55
4 changed files with 23 additions and 0 deletions

View File

@ -75,6 +75,14 @@ public:
virtual void ShadowLayersUpdated(ShadowLayersParent* aLayerTree,
const TargetConfig& aTargetConfig,
bool isFirstPaint) MOZ_OVERRIDE;
/**
* This forces the is-first-paint flag to true. This is intended to
* be called by the widget code when it loses its viewport information
* (or for whatever reason wants to refresh the viewport information).
* The information refresh happens because the compositor will call
* SetFirstPaintViewport on the next frame of composition.
*/
void ForceIsFirstPaint() { mIsFirstPaint = true; }
void Destroy();
LayerManager* GetLayerManager() { return mLayerManager; }

View File

@ -1110,6 +1110,12 @@ AndroidBridge::SetLayerClient(JNIEnv* env, jobject jobj)
if (resetting) {
RegisterCompositor(env, true);
#ifdef MOZ_ANDROID_OMTC
// since we are re-linking the new java objects to Gecko, we need to get
// the viewport from the compositor (since the Java copy was thrown away)
// and we do that by setting the first-paint flag.
nsWindow::ForceIsFirstPaint();
#endif
}
}

View File

@ -2330,6 +2330,14 @@ nsWindow::ScheduleResumeComposition(int width, int height)
}
}
void
nsWindow::ForceIsFirstPaint()
{
if (sCompositorParent) {
sCompositorParent->ForceIsFirstPaint();
}
}
float
nsWindow::ComputeRenderIntegrity()
{

View File

@ -156,6 +156,7 @@ public:
static void ScheduleComposite();
static void SchedulePauseComposition();
static void ScheduleResumeComposition(int width, int height);
static void ForceIsFirstPaint();
static float ComputeRenderIntegrity();
virtual bool WidgetPaintsBackground();