Skip to content

Commit

Permalink
Rename EmbedLiteCompositorParent to EmbedLiteCompositorBridgeParent
Browse files Browse the repository at this point in the history
  • Loading branch information
rainemak committed Apr 8, 2020
1 parent 699ef11 commit ff12c91
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion embedding/embedlite/EmbedLiteApp.cpp
Expand Up @@ -27,7 +27,7 @@
#include "nsXULAppAPI.h"
#include "EmbedLiteMessagePump.h"

#include "EmbedLiteCompositorParent.h"
#include "EmbedLiteCompositorBridgeParent.h"
#include "EmbedLiteAppProcessParent.h"

namespace mozilla {
Expand Down
2 changes: 1 addition & 1 deletion embedding/embedlite/EmbedLiteApp.h
Expand Up @@ -175,7 +175,7 @@ class EmbedLiteApp

friend class EmbedLiteAppProcessParent;
friend class EmbedLiteAppThreadParent;
friend class EmbedLiteCompositorParent;
friend class EmbedLiteCompositorBridgeParent;
friend class EmbedLitePuppetWidget;
friend class EmbedLiteView;
friend class EmbedLiteWindow;
Expand Down
6 changes: 3 additions & 3 deletions embedding/embedlite/embedshared/EmbedLitePuppetWidget.cpp
Expand Up @@ -26,7 +26,7 @@
#include "ClientLayerManager.h"
#include "GLContextProvider.h"
#include "GLContext.h"
#include "EmbedLiteCompositorParent.h"
#include "EmbedLiteCompositorBridgeParent.h"
#include "mozilla/Preferences.h"

#ifdef DEBUG
Expand Down Expand Up @@ -375,7 +375,7 @@ EmbedLitePuppetWidget::Resize(double aWidth, double aHeight, bool aRepaint)
// Looks that we need CompositorSession
#if 0
if (mCompositorParent) {
static_cast<EmbedLiteCompositorParent*>(mCompositorParent.get())->
static_cast<EmbedLiteCompositorBridgeParent*>(mCompositorParent.get())->
SetSurfaceSize(mNaturalBounds.width, mNaturalBounds.height);
}
#endif
Expand Down Expand Up @@ -788,7 +788,7 @@ EmbedLitePuppetWidget::NewCompositorParent(int aSurfaceWidth, int aSurfaceHeight
// See nsBaseWidget::CreateCompositor and sha1 bb2cbc24f4cb9bee50a46ba7a520b9016d5207a5
LOGT();
mHasCompositor = true;
return new EmbedLiteCompositorParent(this, mWindow->GetUniqueID(), true,
return new EmbedLiteCompositorBridgeParent(this, mWindow->GetUniqueID(), true,
aSurfaceWidth, aSurfaceHeight);
}

Expand Down
4 changes: 2 additions & 2 deletions embedding/embedlite/embedshared/EmbedLitePuppetWidget.h
Expand Up @@ -170,15 +170,15 @@ class EmbedLitePuppetWidget : public nsBaseWidget
* Called before the LayerManager draws the layer tree.
*
* Always called from the compositing thread. Puppet Widget passes the call
* forward to the EmbedLiteCompositorParent.
* forward to the EmbedLiteCompositorBridgeParent.
*/
virtual void DrawWindowUnderlay(LayerManagerComposite* aManager, LayoutDeviceIntRect aRect) override;

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

Expand Down
4 changes: 2 additions & 2 deletions embedding/embedlite/embedshared/EmbedLiteViewBaseParent.cpp
Expand Up @@ -9,7 +9,7 @@
#include "EmbedLiteViewBaseParent.h"
#include "EmbedLiteWindowBaseParent.h"

#include "EmbedLiteCompositorParent.h"
#include "EmbedLiteCompositorBridgeParent.h"
#include "mozilla/unused.h"
#include "EmbedContentController.h"
#include "mozilla/layers/APZCTreeManager.h"
Expand Down Expand Up @@ -65,7 +65,7 @@ EmbedLiteViewBaseParent::ActorDestroy(ActorDestroyReason aWhy)
}

void
EmbedLiteViewBaseParent::SetCompositor(EmbedLiteCompositorParent* aCompositor)
EmbedLiteViewBaseParent::SetCompositor(EmbedLiteCompositorBridgeParent* aCompositor)
{
mCompositor = aCompositor;
LOGT("compositor: %p", mCompositor.get());
Expand Down
10 changes: 5 additions & 5 deletions embedding/embedlite/embedshared/EmbedLiteViewBaseParent.h
Expand Up @@ -18,7 +18,7 @@ namespace mozilla {
namespace embedlite {

class EmbedContentController;
class EmbedLiteCompositorParent;
class EmbedLiteCompositorBridgeParent;
class EmbedLiteView;

class EmbedLiteViewBaseParent : public PEmbedLiteViewParent,
Expand All @@ -31,7 +31,7 @@ class EmbedLiteViewBaseParent : public PEmbedLiteViewParent,

NS_DECL_EMBEDLITEVIEWIFACE

EmbedLiteCompositorParent* GetCompositor() { return mCompositor.get(); }; // XXX: Remove
EmbedLiteCompositorBridgeParent* GetCompositor() { return mCompositor.get(); }; // XXX: Remove

protected:
virtual ~EmbedLiteViewBaseParent();
Expand Down Expand Up @@ -127,11 +127,11 @@ class EmbedLiteViewBaseParent : public PEmbedLiteViewParent,

private:
friend class EmbedContentController;
friend class EmbedLiteCompositorParent;
friend class EmbedLiteCompositorBridgeParent;
// The sole purpose of this friendliness is to set mView which is used only as a proxy to view's Listener
friend class EmbedLiteView;

void SetCompositor(EmbedLiteCompositorParent* aCompositor); // XXX: Remove
void SetCompositor(EmbedLiteCompositorBridgeParent* aCompositor); // XXX: Remove
void UpdateScrollController();

mozilla::layers::IAPZCTreeManager *GetApzcTreeManager();
Expand All @@ -140,7 +140,7 @@ class EmbedLiteViewBaseParent : public PEmbedLiteViewParent,
EmbedLiteView* mView;
bool mViewAPIDestroyed;
EmbedLiteWindowBaseParent& mWindow;
RefPtr<EmbedLiteCompositorParent> mCompositor;
RefPtr<EmbedLiteCompositorBridgeParent> mCompositor;

float mDPI;

Expand Down
4 changes: 2 additions & 2 deletions embedding/embedlite/embedshared/EmbedLiteWindowBaseParent.cpp
Expand Up @@ -5,7 +5,7 @@

#include "EmbedLiteWindowBaseParent.h"

#include "EmbedLiteCompositorParent.h"
#include "EmbedLiteCompositorBridgeParent.h"
#include "EmbedLiteWindow.h"
#include "EmbedLog.h"

Expand Down Expand Up @@ -121,7 +121,7 @@ bool EmbedLiteWindowBaseParent::RecvDestroyed()
return true;
}

void EmbedLiteWindowBaseParent::SetCompositor(EmbedLiteCompositorParent* aCompositor)
void EmbedLiteWindowBaseParent::SetCompositor(EmbedLiteCompositorBridgeParent* aCompositor)
{
LOGT("compositor:%p, observers:%d", aCompositor, mObservers.Length());
MOZ_ASSERT(!mCompositor);
Expand Down
10 changes: 5 additions & 5 deletions embedding/embedlite/embedshared/EmbedLiteWindowBaseParent.h
Expand Up @@ -13,7 +13,7 @@ namespace mozilla {
namespace embedlite {

class EmbedLiteWindow;
class EmbedLiteCompositorParent;
class EmbedLiteCompositorBridgeParent;

class EmbedLiteWindowParentObserver
{
Expand All @@ -32,7 +32,7 @@ class EmbedLiteWindowBaseParent : public PEmbedLiteWindowParent
void AddObserver(EmbedLiteWindowParentObserver*);
void RemoveObserver(EmbedLiteWindowParentObserver*);

EmbedLiteCompositorParent* GetCompositor() const { return mCompositor.get(); }
EmbedLiteCompositorBridgeParent* GetCompositor() const { return mCompositor.get(); }

void SetSize(int width, int height);
void SetContentOrientation(const uint32_t &);
Expand All @@ -42,7 +42,7 @@ class EmbedLiteWindowBaseParent : public PEmbedLiteWindowParent
void* GetPlatformImage(int* width, int* height);

protected:
friend class EmbedLiteCompositorParent;
friend class EmbedLiteCompositorBridgeParent;
friend class EmbedLiteWindow;

virtual ~EmbedLiteWindowBaseParent() override;
Expand All @@ -52,15 +52,15 @@ class EmbedLiteWindowBaseParent : public PEmbedLiteWindowParent
virtual bool RecvDestroyed() override;

void SetEmbedAPIWindow(EmbedLiteWindow* window);
void SetCompositor(EmbedLiteCompositorParent* aCompositor);
void SetCompositor(EmbedLiteCompositorBridgeParent* aCompositor);

private:
typedef nsTArray<EmbedLiteWindowParentObserver*> ObserverArray;

uint32_t mId;
EmbedLiteWindow* mWindow;
ObserverArray mObservers;
RefPtr<EmbedLiteCompositorParent> mCompositor;
RefPtr<EmbedLiteCompositorBridgeParent> mCompositor;

gfxSize mSize;
mozilla::ScreenRotation mRotation;
Expand Down
2 changes: 1 addition & 1 deletion embedding/embedlite/embedthread/EmbedContentController.cpp
Expand Up @@ -9,7 +9,7 @@
#include "mozilla/unused.h"
#include "EmbedLiteViewBaseParent.h"
#include "mozilla/layers/CompositorBridgeParent.h"
#include "EmbedLiteCompositorParent.h"
#include "EmbedLiteCompositorBridgeParent.h"

using namespace mozilla::embedlite;
using namespace mozilla::gfx;
Expand Down
Expand Up @@ -5,7 +5,7 @@

#include "EmbedLog.h"

#include "EmbedLiteCompositorParent.h"
#include "EmbedLiteCompositorBridgeParent.h"
#include "BasicLayers.h"
#include "EmbedLiteApp.h"
#include "EmbedLiteWindow.h"
Expand Down Expand Up @@ -37,7 +37,7 @@ namespace embedlite {

static const int sDefaultPaintInterval = nsRefreshDriver::DefaultInterval();

EmbedLiteCompositorParent::EmbedLiteCompositorParent(nsIWidget* widget,
EmbedLiteCompositorBridgeParent::EmbedLiteCompositorBridgeParent(nsIWidget* widget,
uint32_t windowId,
bool aRenderToEGLSurface,
int aSurfaceWidth,
Expand All @@ -47,7 +47,7 @@ EmbedLiteCompositorParent::EmbedLiteCompositorParent(nsIWidget* widget,
, mWindowId(windowId)
, mCurrentCompositeTask(nullptr)
, mSurfaceSize(aSurfaceWidth, aSurfaceHeight)
, mRenderMutex("EmbedLiteCompositorParent render mutex")
, mRenderMutex("EmbedLiteCompositorBridgeParent render mutex")
{
EmbedLiteWindowBaseParent* parentWindow = EmbedLiteWindowBaseParent::From(mWindowId);
LOGT("this:%p, window:%p, sz[%i,%i]", this, parentWindow, aSurfaceWidth, aSurfaceHeight);
Expand All @@ -59,13 +59,13 @@ EmbedLiteCompositorParent::EmbedLiteCompositorParent(nsIWidget* widget,
{}
#endif

EmbedLiteCompositorParent::~EmbedLiteCompositorParent()
EmbedLiteCompositorBridgeParent::~EmbedLiteCompositorBridgeParent()
{
LOGT();
}

PLayerTransactionParent*
EmbedLiteCompositorParent::AllocPLayerTransactionParent(const nsTArray<LayersBackend>& aBackendHints,
EmbedLiteCompositorBridgeParent::AllocPLayerTransactionParent(const nsTArray<LayersBackend>& aBackendHints,
const uint64_t& aId,
TextureFactoryIdentifier* aTextureFactoryIdentifier,
bool* aSuccess)
Expand All @@ -88,15 +88,15 @@ EmbedLiteCompositorParent::AllocPLayerTransactionParent(const nsTArray<LayersBac
return p;
}

bool EmbedLiteCompositorParent::DeallocPLayerTransactionParent(PLayerTransactionParent *aLayers)
bool EmbedLiteCompositorBridgeParent::DeallocPLayerTransactionParent(PLayerTransactionParent *aLayers)
{
bool deallocated = CompositorBridgeParent::DeallocPLayerTransactionParent(aLayers);
LOGT();
return deallocated;
}

void
EmbedLiteCompositorParent::PrepareOffscreen()
EmbedLiteCompositorBridgeParent::PrepareOffscreen()
{

const CompositorBridgeParent::LayerTreeState* state = CompositorBridgeParent::GetIndirectShadowTree(RootLayerTreeId());
Expand Down Expand Up @@ -134,7 +134,7 @@ EmbedLiteCompositorParent::PrepareOffscreen()
}

void
EmbedLiteCompositorParent::UpdateTransformState()
EmbedLiteCompositorBridgeParent::UpdateTransformState()
{
const CompositorBridgeParent::LayerTreeState* state = CompositorBridgeParent::GetIndirectShadowTree(RootLayerTreeId());
NS_ENSURE_TRUE(state && state->mLayerManager, );
Expand All @@ -151,7 +151,7 @@ EmbedLiteCompositorParent::UpdateTransformState()
}

void
EmbedLiteCompositorParent::ScheduleTask(CancelableTask* task, int time)
EmbedLiteCompositorBridgeParent::ScheduleTask(CancelableTask* task, int time)
{
#if 0
if (Invalidate()) {
Expand All @@ -164,19 +164,19 @@ EmbedLiteCompositorParent::ScheduleTask(CancelableTask* task, int time)
}

bool
EmbedLiteCompositorParent::Invalidate()
EmbedLiteCompositorBridgeParent::Invalidate()
{
if (!mUseExternalGLContext) {
UpdateTransformState();
mCurrentCompositeTask = NewRunnableMethod(this, &EmbedLiteCompositorParent::RenderGL, TimeStamp::Now());
mCurrentCompositeTask = NewRunnableMethod(this, &EmbedLiteCompositorBridgeParent::RenderGL, TimeStamp::Now());
MessageLoop::current()->PostDelayedTask(FROM_HERE, mCurrentCompositeTask, sDefaultPaintInterval);
return true;
}

return false;
}

bool EmbedLiteCompositorParent::RenderGL(TimeStamp aScheduleTime)
bool EmbedLiteCompositorBridgeParent::RenderGL(TimeStamp aScheduleTime)
{
// mLastCompose = aScheduleTime;
if (mCurrentCompositeTask) {
Expand Down Expand Up @@ -205,7 +205,7 @@ bool EmbedLiteCompositorParent::RenderGL(TimeStamp aScheduleTime)
if (context->IsOffscreen()) {
// RenderGL is called always from Gecko compositor thread.
// GLScreenBuffer::PublishFrame does swap buffers and that
// cannot happen while reading previous frame on EmbedLiteCompositorParent::GetPlatformImage
// cannot happen while reading previous frame on EmbedLiteCompositorBridgeParent::GetPlatformImage
// (potentially from another thread).
MutexAutoLock lock(mRenderMutex);
GLScreenBuffer* screen = context->Screen();
Expand All @@ -226,7 +226,7 @@ bool EmbedLiteCompositorParent::RenderGL(TimeStamp aScheduleTime)
return false;
}

void EmbedLiteCompositorParent::SetSurfaceSize(int width, int height)
void EmbedLiteCompositorBridgeParent::SetSurfaceSize(int width, int height)
{
if (width > 0 && height > 0 && (mSurfaceSize.width != width || mSurfaceSize.height != height)) {
SetEGLSurfaceSize(width, height);
Expand All @@ -235,7 +235,7 @@ void EmbedLiteCompositorParent::SetSurfaceSize(int width, int height)
}

void*
EmbedLiteCompositorParent::GetPlatformImage(int* width, int* height)
EmbedLiteCompositorBridgeParent::GetPlatformImage(int* width, int* height)
{
MutexAutoLock lock(mRenderMutex);
const CompositorParent::LayerTreeState* state = CompositorParent::GetIndirectShadowTree(RootLayerTreeId());
Expand Down Expand Up @@ -264,13 +264,13 @@ EmbedLiteCompositorParent::GetPlatformImage(int* width, int* height)
}

void
EmbedLiteCompositorParent::SuspendRendering()
EmbedLiteCompositorBridgeParent::SuspendRendering()
{
CompositorParent::SchedulePauseOnCompositorThread();
}

void
EmbedLiteCompositorParent::ResumeRendering()
EmbedLiteCompositorBridgeParent::ResumeRendering()
{
if (mSurfaceSize.width > 0 && mSurfaceSize.height > 0) {
CompositorParent::ScheduleResumeOnCompositorThread(mSurfaceSize.width,
Expand Down
Expand Up @@ -3,8 +3,8 @@
* 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/. */

#ifndef mozilla_layers_EmbedLiteCompositorParent_h
#define mozilla_layers_EmbedLiteCompositorParent_h
#ifndef mozilla_layers_EmbedLiteCompositorBridgeParent_h
#define mozilla_layers_EmbedLiteCompositorBridgeParent_h

#define COMPOSITOR_PERFORMANCE_WARNING

Expand All @@ -22,10 +22,10 @@ class LayerManagerComposite;

namespace embedlite {

class EmbedLiteCompositorParent : public mozilla::layers::CompositorBridgeParent
class EmbedLiteCompositorBridgeParent : public mozilla::layers::CompositorBridgeParent
{
public:
EmbedLiteCompositorParent(nsIWidget* widget, uint32_t windowId,
EmbedLiteCompositorBridgeParent(nsIWidget* widget, uint32_t windowId,
bool aRenderToEGLSurface,
int aSurfaceWidth, int aSurfaceHeight);

Expand All @@ -37,7 +37,7 @@ class EmbedLiteCompositorParent : public mozilla::layers::CompositorBridgeParent
protected:
friend class EmbedLitePuppetWidget;

virtual ~EmbedLiteCompositorParent();
virtual ~EmbedLiteCompositorBridgeParent();
virtual PLayerTransactionParent*
AllocPLayerTransactionParent(const nsTArray<LayersBackend>& aBackendHints,
const uint64_t& aId,
Expand All @@ -58,10 +58,10 @@ class EmbedLiteCompositorParent : public mozilla::layers::CompositorBridgeParent
bool mUseExternalGLContext;
Mutex mRenderMutex;

DISALLOW_EVIL_CONSTRUCTORS(EmbedLiteCompositorParent);
DISALLOW_EVIL_CONSTRUCTORS(EmbedLiteCompositorBridgeParent);
};

} // embedlite
} // mozilla

#endif // mozilla_layers_EmbedLiteCompositorParent_h
#endif // mozilla_layers_EmbedLiteCompositorBridgeParent_h
2 changes: 1 addition & 1 deletion embedding/embedlite/moz.build
Expand Up @@ -79,7 +79,7 @@ UNIFIED_SOURCES += [
]

SOURCES += [
'embedthread/EmbedLiteCompositorParent.cpp',
'embedthread/EmbedLiteCompositorBridgeParent.cpp',
'embedthread/EmbedLiteViewThreadParent.cpp',
'embedthread/EmbedLiteWindowThreadParent.cpp',
]
Expand Down

0 comments on commit ff12c91

Please sign in to comment.