Skip to content

Commit

Permalink
Cleanup merge leftovers, compositor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeshkova committed Jun 1, 2014
1 parent 203c37e commit 2d3ee83
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
9 changes: 4 additions & 5 deletions embedding/embedlite/embedthread/EmbedLiteCompositorParent.cpp
Expand Up @@ -49,12 +49,10 @@ EmbedLiteCompositorParent::EmbedLiteCompositorParent(nsIWidget* aWidget,
pview->SetCompositor(this);
}

bool
EmbedLiteCompositorParent::RecvStop()
EmbedLiteCompositorParent::~EmbedLiteCompositorParent()
{
LOGT();
EmbedLiteApp::GetInstance()->ViewDestroyed(mId);
return CompositorParent::RecvStop();
}

PLayerTransactionParent*
Expand All @@ -69,12 +67,13 @@ EmbedLiteCompositorParent::AllocPLayerTransactionParent(const nsTArray<LayersBac
aTextureFactoryIdentifier,
aSuccess);

Created();
// Prepare Offscreen rendering context
PrepareOffscreen();
return p;
}

void
EmbedLiteCompositorParent::Created()
EmbedLiteCompositorParent::PrepareOffscreen()
{
EmbedLiteView* view = EmbedLiteApp::GetInstance()->GetViewByID(mId);
EmbedLiteViewListener* listener = view ? view->GetListener() : nullptr;
Expand Down
10 changes: 5 additions & 5 deletions embedding/embedlite/embedthread/EmbedLiteCompositorParent.h
Expand Up @@ -29,19 +29,19 @@ class EmbedLiteCompositorParent : public mozilla::layers::CompositorParent
void SetSurfaceSize(int width, int height);
void SetWorldTransform(gfx::Matrix);
void SetClipping(const gfxRect& aClipRect);
mozilla::layers::CompositorParent* Compositor() { return this; }

protected:
virtual ~EmbedLiteCompositorParent();
virtual PLayerTransactionParent*
AllocPLayerTransactionParent(const nsTArray<LayersBackend>& aBackendHints,
const uint64_t& aId,
TextureFactoryIdentifier* aTextureFactoryIdentifier,
bool* aSuccess) MOZ_OVERRIDE;
virtual void ScheduleTask(CancelableTask*, int);
virtual bool RecvStop() MOZ_OVERRIDE;
virtual void ScheduleTask(CancelableTask*, int) MOZ_OVERRIDE;

virtual void Created();
virtual bool Invalidate();
private:
void PrepareOffscreen();
bool Invalidate();
void UpdateTransformState();

uint32_t mId;
Expand Down
6 changes: 3 additions & 3 deletions embedding/embedlite/embedthread/EmbedLiteViewThreadParent.cpp
Expand Up @@ -103,7 +103,7 @@ EmbedLiteViewThreadParent::UpdateScrollController()
NS_ENSURE_TRUE(mView, );

if (mCompositor) {
mRootLayerTreeId = mCompositor->Compositor()->RootLayerTreeId();
mRootLayerTreeId = mCompositor->RootLayerTreeId();
mController->SetManagerByRootLayerTreeId(mRootLayerTreeId);
CompositorParent::SetControllerForLayerTree(mRootLayerTreeId, mController);
}
Expand Down Expand Up @@ -547,7 +547,7 @@ void
EmbedLiteViewThreadParent::ScheduleRender()
{
if (mCompositor) {
mCompositor->Compositor()->ScheduleRenderOnCompositorThread();
mCompositor->ScheduleRenderOnCompositorThread();
}
}

Expand Down Expand Up @@ -707,7 +707,7 @@ bool EmbedLiteViewThreadParent::GetPendingTexture(EmbedLiteRenderTarget* aContex
NS_ENSURE_TRUE(aContextWrapper && textureID && width && height, false);
NS_ENSURE_TRUE(mCompositor, false);

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

GLContext* context = static_cast<CompositorOGL*>(state->mLayerManager->GetCompositor())->gl();
Expand Down

0 comments on commit 2d3ee83

Please sign in to comment.