Skip to content

Commit

Permalink
[embedlite] Make EmbedLiteWindowListener::CompositingFinished more re…
Browse files Browse the repository at this point in the history
…liable.

The notification was dispatched from custom compositor draw scheduling
code which was only used when EmbedLiteWindowListener::Invalidate
returned false. This means the event was not dispatched for qtmozembed's
QOpenGLWebPage which does not use offscreen rendering path. Instead of
using the custom EmbedLiteCompositorParent::RenderGL function to
dispatch finish events do it from nsIWidget::PostRender.
  • Loading branch information
tworaz committed Sep 29, 2015
1 parent 2c28162 commit a250176
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 10 additions & 0 deletions embedding/embedlite/embedshared/EmbedLitePuppetWidget.cpp
Expand Up @@ -762,6 +762,16 @@ EmbedLitePuppetWidget::PreRender(LayerManagerComposite *aManager)
return true;
}

void
EmbedLitePuppetWidget::PostRender(LayerManagerComposite *aManager)
{
MOZ_ASSERT(mWindow);
EmbedLiteWindow* window = EmbedLiteApp::GetInstance()->GetWindowByID(mWindow->GetUniqueID());
if (window) {
window->GetListener()->CompositingFinished();
}
}

void
EmbedLitePuppetWidget::AddObserver(EmbedLitePuppetWidgetObserver* obs)
{
Expand Down
1 change: 1 addition & 0 deletions embedding/embedlite/embedshared/EmbedLitePuppetWidget.h
Expand Up @@ -169,6 +169,7 @@ class EmbedLitePuppetWidget : public nsBaseWidget
virtual void DrawWindowOverlay(LayerManagerComposite* aManager, nsIntRect aRect) override;

virtual bool PreRender(LayerManagerComposite* aManager) override;
virtual void PostRender(LayerManagerComposite* aManager) override;

NS_IMETHOD SetParent(nsIWidget* aNewParent) override;
virtual nsIWidget* GetParent(void) override;
Expand Down
5 changes: 0 additions & 5 deletions embedding/embedlite/embedthread/EmbedLiteCompositorParent.cpp
Expand Up @@ -195,11 +195,6 @@ bool EmbedLiteCompositorParent::RenderGL(TimeStamp aScheduleTime)
}
}

EmbedLiteWindow* win = EmbedLiteApp::GetInstance()->GetWindowByID(mWindowId);
if (win) {
win->GetListener()->CompositingFinished();
}

return false;
}

Expand Down

0 comments on commit a250176

Please sign in to comment.