Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Reset wrapper
  • Loading branch information
tmeshkova committed May 26, 2014
1 parent c6e9454 commit cee8876
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
28 changes: 17 additions & 11 deletions embedding/embedlite/embedthread/EmbedLiteCompositorParent.cpp
Expand Up @@ -94,21 +94,14 @@ EmbedLiteCompositorParent::Created()
}
}

bool
EmbedLiteCompositorParent::Invalidate()
void
EmbedLiteCompositorParent::UpdateTransformState()
{
LOGF();
EmbedLiteView* view = EmbedLiteApp::GetInstance()->GetViewByID(mId);
if (!view) {
LOGE("view not available.. forgot SuspendComposition call?");
return false;
}

const CompositorParent::LayerTreeState* state = CompositorParent::GetIndirectShadowTree(mCompositor->RootLayerTreeId());
NS_ENSURE_TRUE(state && state->mLayerManager, false);
NS_ENSURE_TRUE(state && state->mLayerManager, );

GLContext* context = static_cast<CompositorOGL*>(state->mLayerManager->GetCompositor())->gl();
NS_ENSURE_TRUE(context, false);
NS_ENSURE_TRUE(context, );

state->mLayerManager->SetWorldTransform(mWorldTransform);

Expand All @@ -120,6 +113,19 @@ EmbedLiteCompositorParent::Invalidate()
context->ResizeOffscreen(gfx::IntSize(mLastViewSize.width, mLastViewSize.height));
mCompositor->ScheduleRenderOnCompositorThread();
}
}

bool
EmbedLiteCompositorParent::Invalidate()
{
LOGF();
EmbedLiteView* view = EmbedLiteApp::GetInstance()->GetViewByID(mId);
if (!view) {
LOGE("view not available.. forgot SuspendComposition call?");
return false;
}

UpdateTransformState();

if (!view->GetListener()->Invalidate()) {
mCurrentCompositeTask = NewRunnableMethod(this, &EmbedLiteCompositorParent::RenderGL);
Expand Down
2 changes: 2 additions & 0 deletions embedding/embedlite/embedthread/EmbedLiteCompositorParent.h
Expand Up @@ -38,6 +38,8 @@ class EmbedLiteCompositorParent : public mozilla::layers::ICompositorListener

mozilla::layers::CompositorParent* Compositor() { return mCompositor.get(); }

void UpdateTransformState();

protected:
uint32_t mId;
gfx::Matrix mWorldTransform;
Expand Down
1 change: 1 addition & 0 deletions embedding/embedlite/embedthread/EmbedLitePuppetWidget.cpp
Expand Up @@ -209,6 +209,7 @@ EmbedLitePuppetWidget::Destroy()
mLayerManager = nullptr;
mEmbed = nullptr;
mChild = nullptr;
mCompositorWrapper = nullptr;
return NS_OK;
}

Expand Down

0 comments on commit cee8876

Please sign in to comment.