Skip to content

Commit

Permalink
[embedlite] Update last compose time in compositor. JB#28854
Browse files Browse the repository at this point in the history
  • Loading branch information
rojkov committed May 18, 2015
1 parent e4db14a commit becb522
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions embedding/embedlite/embedthread/EmbedLiteCompositorParent.cpp
Expand Up @@ -150,7 +150,10 @@ EmbedLiteCompositorParent::Invalidate()
UpdateTransformState();

if (view->GetListener() && !view->GetListener()->Invalidate()) {
mCurrentCompositeTask = NewRunnableMethod(this, &EmbedLiteCompositorParent::RenderGL);
// Replace CompositorParent::CompositeCallback with EmbedLiteCompositorParent::RenderGL
// in mCurrentCompositeTask (NB: actually EmbedLiteCompositorParent::mCurrentCompositorParent
// overshadows CompositorParent::mCurrentCompositorTask. Beware!).
mCurrentCompositeTask = NewRunnableMethod(this, &EmbedLiteCompositorParent::RenderGL, TimeStamp::Now());
MessageLoop::current()->PostDelayedTask(FROM_HERE, mCurrentCompositeTask, sDefaultPaintInterval);
return true;
}
Expand All @@ -174,8 +177,9 @@ bool EmbedLiteCompositorParent::RenderToContext(gfx::DrawTarget* aTarget)
return true;
}

bool EmbedLiteCompositorParent::RenderGL()
bool EmbedLiteCompositorParent::RenderGL(TimeStamp aScheduleTime)
{
mLastCompose = aScheduleTime;
if (mCurrentCompositeTask) {
mCurrentCompositeTask->Cancel();
mCurrentCompositeTask = nullptr;
Expand Down
Expand Up @@ -43,7 +43,7 @@ class EmbedLiteCompositorParent : public mozilla::layers::CompositorParent
private:
bool Invalidate();
void UpdateTransformState();
bool RenderGL();
bool RenderGL(TimeStamp aScheduleTime);

uint32_t mId;
CancelableTask* mCurrentCompositeTask;
Expand Down

0 comments on commit becb522

Please sign in to comment.