Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed resize probem with offscreen rendering
Conflicts:
	embedding/embedlite/embedthread/EmbedLiteCompositorParent.cpp
  • Loading branch information
tmeshkova committed May 11, 2014
1 parent 6a01557 commit da9e6c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions embedding/embedlite/embedthread/EmbedLiteCompositorParent.cpp
Expand Up @@ -40,6 +40,7 @@ EmbedLiteCompositorParent::EmbedLiteCompositorParent(nsIWidget* aWidget,
, mId(id)
, mCurrentCompositeTask(nullptr)
, mWorldOpacity(1.0f)
, mLastViewSize(aSurfaceWidth, aSurfaceHeight)
{
AddRef();
EmbedLiteView* view = EmbedLiteApp::GetInstance()->GetViewByID(mId);
Expand Down Expand Up @@ -145,6 +146,11 @@ bool EmbedLiteCompositorParent::RenderGL()
state->mLayerManager->GetRoot()->SetClipRect(&mActiveClipping);
}

if (context->IsOffscreen() && context->OffscreenSize() != mLastViewSize) {
context->ResizeOffscreen(gfx::IntSize(mLastViewSize.width, mLastViewSize.height));
ScheduleRenderOnCompositorThread();
}

{
ScopedScissorRect autoScissor(context);
GLenum oldTexUnit;
Expand Down Expand Up @@ -177,6 +183,7 @@ EmbedLiteCompositorParent::RequestHasHWAcceleratedContext()
void EmbedLiteCompositorParent::SetSurfaceSize(int width, int height)
{
NS_ENSURE_TRUE(IsGLBackend(),);
mLastViewSize.SizeTo(width, height);
CompositorParent::SetEGLSurfaceSize(width, height);
}

Expand Down
Expand Up @@ -55,14 +55,14 @@ class EmbedLiteCompositorParent : public mozilla::layers::CompositorParent

bool IsGLBackend();

RefPtr<EmbedLiteViewThreadParent> mView;
RefPtr<mozilla::layers::CompositorChild> mChildCompositor;
MessageLoop* mChildMessageLoop;
uint32_t mId;
gfx::Matrix mWorldTransform;
nsIntRect mActiveClipping;
CancelableTask *mCurrentCompositeTask;
float mWorldOpacity;
gfx::IntSize mLastViewSize;
};

} // embedlite
Expand Down

0 comments on commit da9e6c7

Please sign in to comment.