Skip to content

Commit

Permalink
Added temporary hack for rendering first compositor frame in offscree…
Browse files Browse the repository at this point in the history
…n mode
  • Loading branch information
tmeshkova committed May 15, 2014
1 parent a428904 commit a82cb73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions embedding/embedlite/embedthread/EmbedLiteCompositorParent.cpp
Expand Up @@ -41,6 +41,7 @@ EmbedLiteCompositorParent::EmbedLiteCompositorParent(nsIWidget* aWidget,
, mCurrentCompositeTask(nullptr)
, mWorldOpacity(1.0f)
, mLastViewSize(aSurfaceWidth, aSurfaceHeight)
, mInitialPaintCount(0)
{
AddRef();
EmbedLiteView* view = EmbedLiteApp::GetInstance()->GetViewByID(mId);
Expand Down Expand Up @@ -163,6 +164,11 @@ bool EmbedLiteCompositorParent::RenderGL()
if (!context->PublishFrame()) {
NS_ERROR("Failed to publish context frame");
}
// Temporary hack, we need two extra paints in order to get initial picture
if (mInitialPaintCount < 2) {
ScheduleRenderOnCompositorThread();
mInitialPaintCount++;
}
}

EmbedLiteView* view = EmbedLiteApp::GetInstance()->GetViewByID(mId);
Expand Down
Expand Up @@ -63,6 +63,7 @@ class EmbedLiteCompositorParent : public mozilla::layers::CompositorParent
CancelableTask *mCurrentCompositeTask;
float mWorldOpacity;
gfx::IntSize mLastViewSize;
short mInitialPaintCount;
};

} // embedlite
Expand Down

0 comments on commit a82cb73

Please sign in to comment.