Bug 1328602 - Have RendererOGL talk to CompositorBridgeParentBase instead of WebRenderBridgeParent. r=gfx?

This commit is contained in:
Nicolas Silva 2017-01-11 13:49:02 +01:00
Родитель cbabf2480f
Коммит 12bd4e1039
4 изменённых файлов: 22 добавлений и 17 удалений

Просмотреть файл

@ -7,9 +7,10 @@
#include "GLContext.h"
#include "GLContextProvider.h"
#include "mozilla/gfx/Logging.h"
#include "mozilla/layers/WebRenderBridgeParent.h"
#include "mozilla/layers/CompositorBridgeParent.h"
#include "mozilla/layers/CompositorThread.h"
#include "mozilla/widget/CompositorWidget.h"
#include "base/task.h"
namespace mozilla {
namespace layers {
@ -20,7 +21,7 @@ RendererOGL::Create(already_AddRefed<RenderThread> aThread,
already_AddRefed<widget::CompositorWidget> aWidget,
WrRenderer* aWrRenderer,
gfx::WindowId aWindowId,
WebRenderBridgeParent* aBridge)
CompositorBridgeParentBase* aBridge)
{
RefPtr<widget::CompositorWidget> widget = aWidget;
RefPtr<RenderThread> thread = aThread;
@ -58,7 +59,7 @@ RendererOGL::RendererOGL(already_AddRefed<RenderThread> aThread,
already_AddRefed<widget::CompositorWidget> aWidget,
gfx::WindowId aWindowId,
WrRenderer* aWrRenderer,
WebRenderBridgeParent* aBridge)
CompositorBridgeParentBase* aBridge)
: mThread(aThread)
, mGL(aGL)
, mWidget(aWidget)
@ -92,6 +93,12 @@ RendererOGL::Update()
wr_renderer_update(mWrRenderer);
}
static void
NotifyDidRender(CompositorBridgeParentBase* aBridge, uint64_t aTransactionId, TimeStamp aStart, TimeStamp aEnd)
{
}
bool
RendererOGL::Render(uint64_t aTransactionId)
{
@ -129,10 +136,9 @@ RendererOGL::Render(uint64_t aTransactionId)
TimeStamp end = TimeStamp::Now();
CompositorThreadHolder::Loop()->PostTask(NewRunnableMethod<uint64_t, TimeStamp, TimeStamp>(
mBridge,
&WebRenderBridgeParent::DidComposite,
aTransactionId, start, end
CompositorThreadHolder::Loop()->PostTask(NewRunnableFunction(
&NotifyDidRender,
mBridge, aTransactionId, start, end
));
return true;

Просмотреть файл

@ -27,7 +27,7 @@ class CompositorWidget;
namespace layers {
class WebRenderBridgeParent;
class CompositorBridgeParentBase;
/// Owns the WebRender renderer and GL context.
///
@ -43,7 +43,7 @@ public:
already_AddRefed<widget::CompositorWidget> aWidget,
WrRenderer* aWrRenderer,
gfx::WindowId aWindowId,
WebRenderBridgeParent* aBridge);
CompositorBridgeParentBase* aBridge);
/// Render thread only.
void Update();
@ -63,13 +63,13 @@ protected:
already_AddRefed<widget::CompositorWidget>,
gfx::WindowId aWindowId,
WrRenderer* aWrRenderer,
WebRenderBridgeParent* aBridge);
CompositorBridgeParentBase* aBridge);
RefPtr<RenderThread> mThread;
RefPtr<gl::GLContext> mGL;
RefPtr<widget::CompositorWidget> mWidget;
WrRenderer* mWrRenderer;
WebRenderBridgeParent* mBridge;
CompositorBridgeParentBase* mBridge;
gfx::WindowId mWindowId;
};

Просмотреть файл

@ -5,7 +5,6 @@
#include "WebRenderAPI.h"
#include "mozilla/layers/RendererOGL.h"
#include "mozilla/layers/WebRenderBridgeParent.h"
#include "mozilla/layers/CompositorThread.h"
#include "mozilla/widget/CompositorWidget.h"
@ -15,7 +14,7 @@ namespace layers {
class NewRenderer : public RendererEvent
{
public:
NewRenderer(WrRenderer* aWrRenderer, WebRenderBridgeParent* aBridge,
NewRenderer(WrRenderer* aWrRenderer, CompositorBridgeParentBase* aBridge,
RefPtr<widget::CompositorWidget>&& aWidget)
: mWrRenderer(aWrRenderer)
, mBridge(aBridge)
@ -46,7 +45,7 @@ public:
}
WrRenderer* mWrRenderer;
WebRenderBridgeParent* mBridge;
CompositorBridgeParentBase* mBridge;
RefPtr<widget::CompositorWidget> mCompositorWidget;
};
@ -67,7 +66,7 @@ public:
//static
already_AddRefed<WebRenderAPI>
WebRenderAPI::Create(bool aEnableProfiler,
WebRenderBridgeParent* aBridge,
CompositorBridgeParentBase* aBridge,
RefPtr<widget::CompositorWidget>&& aWidget)
{
MOZ_ASSERT(aBridge);

Просмотреть файл

@ -19,7 +19,7 @@ class CompositorWidget;
namespace layers {
class WebRenderBridgeParent;
class CompositorBridgeParentBase;
class RendererOGL;
class WebRenderAPI
@ -28,7 +28,7 @@ NS_INLINE_DECL_REFCOUNTING(WebRenderAPI);
public:
/// Compositor thread only.
static already_AddRefed<WebRenderAPI> Create(bool aEnableProfiler,
WebRenderBridgeParent* aBridge,
CompositorBridgeParentBase* aBridge,
RefPtr<widget::CompositorWidget>&& aWidget);
gfx::WindowId GetId() const { return mId; }