Skip to content

Commit

Permalink
[embedlite] Add RequestGLContext back to EmbedLitePuppetWidget
Browse files Browse the repository at this point in the history
This gives higher layer in the stack a possibility to customize gl context creation.
  • Loading branch information
Raine Makelainen authored and rojkov committed May 19, 2015
1 parent ff4fa4f commit b36d353
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion embedding/embedlite/embedshared/EmbedLitePuppetWidget.cpp
Expand Up @@ -580,7 +580,9 @@ EmbedLitePuppetWidget::GetNaturalBounds()
bool
EmbedLitePuppetWidget::HasGLContext()
{
return true;
EmbedLiteCompositorParent* parent =
static_cast<EmbedLiteCompositorParent*>(mCompositorParent.get());
return parent->RequestGLContext();
}

void
Expand Down
6 changes: 6 additions & 0 deletions embedding/embedlite/embedthread/EmbedLiteCompositorParent.cpp
Expand Up @@ -333,6 +333,12 @@ EmbedLiteCompositorParent::ResumeRendering()
static_cast<CompositorOGL*>(state->mLayerManager->GetCompositor())->Resume();
}

bool EmbedLiteCompositorParent::RequestGLContext()
{
EmbedLiteView* view = EmbedLiteApp::GetInstance()->GetViewByID(mId);
return view ? view->GetListener()->RequestCurrentGLContext() : false;
}

void EmbedLiteCompositorParent::DrawWindowOverlay(LayerManagerComposite *aManager, nsIntRect aRect)
{
EmbedLiteView* view = EmbedLiteApp::GetInstance()->GetViewByID(mId);
Expand Down
2 changes: 2 additions & 0 deletions embedding/embedlite/embedthread/EmbedLiteCompositorParent.h
Expand Up @@ -37,6 +37,8 @@ class EmbedLiteCompositorParent : public mozilla::layers::CompositorParent
virtual void SuspendRendering();
virtual void ResumeRendering();

virtual bool RequestGLContext();

void DrawWindowOverlay(mozilla::layers::LayerManagerComposite *aManager, nsIntRect aRect);

protected:
Expand Down

0 comments on commit b36d353

Please sign in to comment.