Skip to content

Commit

Permalink
Added PCompositor parent to the App protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeshkova committed Dec 15, 2014
1 parent 2376234 commit 4ae94f8
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 8 deletions.
2 changes: 2 additions & 0 deletions embedding/embedlite/PEmbedLiteApp.ipdl
Expand Up @@ -2,12 +2,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

include protocol PCompositor;
include protocol PEmbedLiteView;

namespace mozilla {
namespace embedlite {

prio(normal upto high) intr protocol PEmbedLiteApp {
parent opens PCompositor;
manages PEmbedLiteView;
parent:
Initialized();
Expand Down
7 changes: 7 additions & 0 deletions embedding/embedlite/embedprocess/EmbedLiteAppProcessChild.cpp
Expand Up @@ -150,6 +150,13 @@ EmbedLiteAppProcessChild::AllocPEmbedLiteViewChild(const uint32_t& id, const uin
return view;
}

PCompositorChild*
EmbedLiteAppProcessChild::AllocPCompositorChild(Transport* aTransport, ProcessId aOtherProcess)
{
LOGT();
return 0;
}

} // namespace embedlite
} // namespace mozilla

2 changes: 2 additions & 0 deletions embedding/embedlite/embedprocess/EmbedLiteAppProcessChild.h
Expand Up @@ -41,6 +41,8 @@ class EmbedLiteAppProcessChild : public EmbedLiteAppBaseChild
protected:
virtual PEmbedLiteViewChild* AllocPEmbedLiteViewChild(const uint32_t&, const uint32_t& parentId, const bool& isPrivateWindow) MOZ_OVERRIDE;

virtual PCompositorChild* AllocPCompositorChild(Transport* aTransport, ProcessId aOtherProcess);

// IPDL protocol impl
virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;

Expand Down
Expand Up @@ -271,6 +271,15 @@ EmbedLiteAppProcessParent::ShutDownProcess(bool aCloseWithError)
}
}

PCompositorParent*
EmbedLiteAppProcessParent::AllocPCompositorParent(Transport* aTransport,
ProcessId aOtherProcess)
{
LOGT();
return 0;
}


} // namespace embedlite
} // namespace mozilla

3 changes: 3 additions & 0 deletions embedding/embedlite/embedprocess/EmbedLiteAppProcessParent.h
Expand Up @@ -54,6 +54,9 @@ class EmbedLiteAppProcessParent : public PEmbedLiteAppParent
virtual void
ActorDestroy(ActorDestroyReason aWhy);

virtual PCompositorParent*
AllocPCompositorParent(Transport* aTransport, ProcessId aOtherProcess);

private:
virtual ~EmbedLiteAppProcessParent();
void ShutDownProcess(bool aCloseWithError);
Expand Down
20 changes: 12 additions & 8 deletions embedding/embedlite/embedshared/EmbedLitePuppetWidget.cpp
Expand Up @@ -104,6 +104,7 @@ EmbedLitePuppetWidget::~EmbedLitePuppetWidget()
NS_IMETHODIMP
EmbedLitePuppetWidget::SetParent(nsIWidget* aParent)
{
LOGT();
mParent = aParent;
return NS_OK;
}
Expand Down Expand Up @@ -164,12 +165,11 @@ EmbedLitePuppetWidget::CreateChild(const nsIntRect& aRect,
NS_IMETHODIMP
EmbedLitePuppetWidget::Destroy()
{
LOGT();
if (mOnDestroyCalled) {
return NS_OK;
}

LOGF();

mOnDestroyCalled = true;

nsIWidget* topWidget = GetTopLevelWidget();
Expand All @@ -192,7 +192,7 @@ EmbedLitePuppetWidget::Destroy()
NS_IMETHODIMP
EmbedLitePuppetWidget::Show(bool aState)
{
LOGF("t:%p, state: %i, LM:%p", this, aState, mLayerManager.get());
LOGT("t:%p, state: %i, LM:%p", this, aState, mLayerManager.get());
NS_ASSERTION(mEnabled,
"does it make sense to Show()/Hide() a disabled widget?");

Expand Down Expand Up @@ -222,7 +222,7 @@ EmbedLitePuppetWidget::Resize(double aWidth,
bool aRepaint)
{
nsIntRect oldBounds = mBounds;
LOGF("sz[%i,%i]->[%g,%g]", oldBounds.width, oldBounds.height, aWidth, aHeight);
LOGT("sz[%i,%i]->[%g,%g]", oldBounds.width, oldBounds.height, aWidth, aHeight);
mBounds.SizeTo(nsIntSize(NSToIntRound(aWidth), NSToIntRound(aHeight)));
nsIWidget* topWidget = GetTopLevelWidget();
if (topWidget)
Expand Down Expand Up @@ -252,7 +252,7 @@ EmbedLitePuppetWidget::Resize(double aWidth,
NS_IMETHODIMP
EmbedLitePuppetWidget::SetFocus(bool aRaise)
{
LOGNI();
LOGT();
return NS_OK;
}

Expand Down Expand Up @@ -322,6 +322,7 @@ EmbedLitePuppetWidget::DispatchEvent(WidgetGUIEvent* event, nsEventStatus& aStat
NS_IMETHODIMP
EmbedLitePuppetWidget::ResetInputState()
{
LOGT();
RemoveIMEComposition();
return NS_OK;
}
Expand All @@ -331,7 +332,7 @@ NS_IMETHODIMP_(void)
EmbedLitePuppetWidget::SetInputContext(const InputContext& aContext,
const InputContextAction& aAction)
{
LOGF("IME: SetInputContext: s=0x%X, 0x%X, action=0x%X, 0x%X",
LOGT("IME: SetInputContext: s=0x%X, 0x%X, action=0x%X, 0x%X",
aContext.mIMEState.mEnabled, aContext.mIMEState.mOpen,
aAction.mCause, aAction.mFocusChange);

Expand Down Expand Up @@ -379,7 +380,7 @@ EmbedLitePuppetWidget::GetInputContext()

NS_IMETHODIMP EmbedLitePuppetWidget::OnIMEFocusChange(bool aFocus)
{
LOGF("aFocus:%i", aFocus);
LOGT("aFocus:%i", aFocus);
if (!aFocus) {
mIMEComposing = false;
mIMEComposingText.Truncate();
Expand Down Expand Up @@ -439,7 +440,7 @@ EmbedLitePuppetWidget::GetLayerManager(PLayerTransactionChild* aShadowManager,
return mLayerManager;
}

LOGF();
LOGT();

nsIWidget* topWidget = GetTopLevelWidget();
if (topWidget != this) {
Expand Down Expand Up @@ -490,12 +491,14 @@ EmbedLitePuppetWidget::GetLayerManager(PLayerTransactionChild* aShadowManager,
CompositorParent*
EmbedLitePuppetWidget::NewCompositorParent(int aSurfaceWidth, int aSurfaceHeight)
{
LOGT();
gfxPlatform::GetPlatform();
return new EmbedLiteCompositorParent(this, true, aSurfaceWidth, aSurfaceHeight, mId);
}

void EmbedLitePuppetWidget::CreateCompositor()
{
LOGT();
gfxSize glSize = mEmbed->GetGLViewSize();
CreateCompositor(glSize.width, glSize.height);
}
Expand All @@ -515,6 +518,7 @@ CheckForBasicBackends(nsTArray<LayersBackend>& aHints)

void EmbedLitePuppetWidget::CreateCompositor(int aWidth, int aHeight)
{
LOGT();
mCompositorParent = NewCompositorParent(aWidth, aHeight);
MessageChannel* parentChannel = mCompositorParent->GetIPCChannel();
nsRefPtr<ClientLayerManager> lm = new ClientLayerManager(this);
Expand Down
7 changes: 7 additions & 0 deletions embedding/embedlite/embedthread/EmbedLiteAppThreadChild.cpp
Expand Up @@ -40,6 +40,13 @@ EmbedLiteAppThreadChild::AllocPEmbedLiteViewChild(const uint32_t& id, const uint
return view;
}

PCompositorChild*
EmbedLiteAppThreadChild::AllocPCompositorChild(Transport* aTransport, ProcessId aOtherProcess)
{
LOGT();
return 0;
}

} // namespace embedlite
} // namespace mozilla

1 change: 1 addition & 0 deletions embedding/embedlite/embedthread/EmbedLiteAppThreadChild.h
Expand Up @@ -21,6 +21,7 @@ class EmbedLiteAppThreadChild : public EmbedLiteAppBaseChild
virtual ~EmbedLiteAppThreadChild();

virtual PEmbedLiteViewChild* AllocPEmbedLiteViewChild(const uint32_t&, const uint32_t& parentId, const bool& isPrivateWindow) MOZ_OVERRIDE;
virtual PCompositorChild* AllocPCompositorChild(Transport* aTransport, ProcessId aOtherProcess);

private:
DISALLOW_EVIL_CONSTRUCTORS(EmbedLiteAppThreadChild);
Expand Down
10 changes: 10 additions & 0 deletions embedding/embedlite/embedthread/EmbedLiteAppThreadParent.cpp
Expand Up @@ -8,11 +8,13 @@
#include "EmbedLiteViewThreadParent.h"
#include "EmbedLiteAppThreadParent.h"
#include "EmbedLiteApp.h"
#include "mozilla/layers/PCompositorParent.h"

#include "mozilla/unused.h"

using namespace base;
using namespace mozilla::ipc;
using namespace mozilla::layers;

namespace mozilla {
namespace embedlite {
Expand Down Expand Up @@ -105,6 +107,14 @@ EmbedLiteAppThreadParent::RecvObserve(const nsCString& topic,
return true;
}

PCompositorParent*
EmbedLiteAppThreadParent::AllocPCompositorParent(Transport* aTransport,
ProcessId aOtherProcess)
{
LOGT();
return 0;
}

} // namespace embedlite
} // namespace mozilla

8 changes: 8 additions & 0 deletions embedding/embedlite/embedthread/EmbedLiteAppThreadParent.h
Expand Up @@ -9,6 +9,11 @@
#include "mozilla/embedlite/PEmbedLiteAppParent.h"

namespace mozilla {

namespace layers {
class PCompositorParent;
} // namespace layers

namespace embedlite {

class EmbedLiteApp;
Expand Down Expand Up @@ -41,6 +46,9 @@ class EmbedLiteAppThreadParent : public PEmbedLiteAppParent
uint32_t* createdID,
bool* cancel) MOZ_OVERRIDE;

virtual PCompositorParent*
AllocPCompositorParent(Transport* aTransport, ProcessId aOtherProcess);

private:
virtual ~EmbedLiteAppThreadParent();

Expand Down

0 comments on commit 4ae94f8

Please sign in to comment.