Skip to content

Commit

Permalink
[embedlite] Add DrawWindowOverlay implementation for embedlite
Browse files Browse the repository at this point in the history
JB#27803
  • Loading branch information
Raine Makelainen authored and rojkov committed May 19, 2015
1 parent 044ef5f commit ff4fa4f
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions embedding/embedlite/EmbedLiteView.h
Expand Up @@ -64,6 +64,9 @@ class EmbedLiteViewListener
virtual bool AcknowledgeScrollUpdate(const uint32_t& aViewID, const uint32_t& aScrollGeneration) { return false; }
virtual bool SendAsyncScrollDOMEvent(const gfxRect& aContentRect,
const gfxSize& aScrollableSize) { return false; }

// Will be always called from the compositor thread.
virtual void DrawOverlay(const nsIntRect& aRect) {}
};

class EmbedLiteApp;
Expand Down
8 changes: 8 additions & 0 deletions embedding/embedlite/embedshared/EmbedLitePuppetWidget.cpp
Expand Up @@ -583,5 +583,13 @@ EmbedLitePuppetWidget::HasGLContext()
return true;
}

void
EmbedLitePuppetWidget::DrawWindowOverlay(LayerManagerComposite *aManager, nsIntRect aRect)
{
EmbedLiteCompositorParent* parent =
static_cast<EmbedLiteCompositorParent*>(mCompositorParent.get());
parent->DrawWindowOverlay(aManager, aRect);
}

} // namespace widget
} // namespace mozilla
8 changes: 8 additions & 0 deletions embedding/embedlite/embedshared/EmbedLitePuppetWidget.h
Expand Up @@ -147,6 +147,14 @@ class EmbedLitePuppetWidget : public nsBaseWidget
virtual nsIntRect GetNaturalBounds();
virtual bool HasGLContext();

/**
* Called after the LayerManager draws the layer tree
*
* Always called from the compositing thread. Puppet Widget passes the call
* forward to the EmbedLiteCompositorParent.
*/
virtual void DrawWindowOverlay(LayerManagerComposite* aManager, nsIntRect aRect);

NS_IMETHOD SetParent(nsIWidget* aNewParent);
virtual nsIWidget *GetParent(void);

Expand Down
8 changes: 8 additions & 0 deletions embedding/embedlite/embedthread/EmbedLiteCompositorParent.cpp
Expand Up @@ -333,6 +333,14 @@ EmbedLiteCompositorParent::ResumeRendering()
static_cast<CompositorOGL*>(state->mLayerManager->GetCompositor())->Resume();
}

void EmbedLiteCompositorParent::DrawWindowOverlay(LayerManagerComposite *aManager, nsIntRect aRect)
{
EmbedLiteView* view = EmbedLiteApp::GetInstance()->GetViewByID(mId);
if (view) {
view->GetListener()->DrawOverlay(aRect);
}
}

} // namespace embedlite
} // namespace mozilla

7 changes: 7 additions & 0 deletions embedding/embedlite/embedthread/EmbedLiteCompositorParent.h
Expand Up @@ -15,6 +15,11 @@
#include "EmbedLiteViewThreadParent.h"

namespace mozilla {

namespace layers {
class LayerManagerComposite;
}

namespace embedlite {

class EmbedLiteCompositorParent : public mozilla::layers::CompositorParent
Expand All @@ -32,6 +37,8 @@ class EmbedLiteCompositorParent : public mozilla::layers::CompositorParent
virtual void SuspendRendering();
virtual void ResumeRendering();

void DrawWindowOverlay(mozilla::layers::LayerManagerComposite *aManager, nsIntRect aRect);

protected:
virtual ~EmbedLiteCompositorParent();
virtual PLayerTransactionParent*
Expand Down

0 comments on commit ff4fa4f

Please sign in to comment.