2017-01-06 21:10:15 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set sw=2 sts=2 ts=8 et tw=99 : */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* 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_RENDEREROGL_H
|
|
|
|
#define MOZILLA_LAYERS_RENDEREROGL_H
|
|
|
|
|
2017-01-17 03:21:52 +03:00
|
|
|
#include "mozilla/webrender/RenderThread.h"
|
|
|
|
#include "mozilla/webrender/WebRenderTypes.h"
|
2017-01-06 21:10:15 +03:00
|
|
|
#include "mozilla/gfx/webrender.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace gfx {
|
|
|
|
class DrawTarget;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace gl {
|
|
|
|
class GLContext;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace widget {
|
|
|
|
class CompositorWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace layers {
|
|
|
|
|
2017-01-11 15:49:02 +03:00
|
|
|
class CompositorBridgeParentBase;
|
2017-01-06 21:10:15 +03:00
|
|
|
|
2017-01-06 21:10:20 +03:00
|
|
|
/// Owns the WebRender renderer and GL context.
|
|
|
|
///
|
|
|
|
/// There is one renderer per window, all owned by the render thread.
|
|
|
|
/// This class is a similar abstraction to CompositorOGL except that it is used
|
|
|
|
/// on the render thread instead of the compositor thread.
|
2017-01-06 21:10:15 +03:00
|
|
|
class RendererOGL
|
|
|
|
{
|
|
|
|
public:
|
2017-01-06 21:10:20 +03:00
|
|
|
/// Render thread only.
|
2017-01-06 21:10:15 +03:00
|
|
|
void Update();
|
|
|
|
|
2017-01-06 21:10:20 +03:00
|
|
|
/// Render thread only.
|
2017-01-06 21:10:15 +03:00
|
|
|
bool Render(uint64_t aTransactionId);
|
|
|
|
|
2017-01-06 21:10:20 +03:00
|
|
|
/// Render thread only.
|
2017-01-06 21:10:15 +03:00
|
|
|
bool RenderToTarget(gfx::DrawTarget& aTarget);
|
|
|
|
|
2017-01-16 17:22:47 +03:00
|
|
|
/// Render thread only.
|
|
|
|
void SetProfilerEnabled(bool aEnabled);
|
|
|
|
|
2017-01-06 21:10:20 +03:00
|
|
|
/// Render thread only.
|
2017-01-06 21:10:15 +03:00
|
|
|
~RendererOGL();
|
|
|
|
|
2017-01-11 15:51:27 +03:00
|
|
|
/// Render thread only.
|
|
|
|
RendererOGL(RefPtr<RenderThread>&& aThread,
|
|
|
|
RefPtr<gl::GLContext>&& aGL,
|
|
|
|
RefPtr<widget::CompositorWidget>&&,
|
2017-01-06 21:10:20 +03:00
|
|
|
gfx::WindowId aWindowId,
|
2017-01-06 21:10:15 +03:00
|
|
|
WrRenderer* aWrRenderer,
|
2017-01-11 15:49:02 +03:00
|
|
|
CompositorBridgeParentBase* aBridge);
|
2017-01-11 15:51:27 +03:00
|
|
|
protected:
|
2017-01-06 21:10:15 +03:00
|
|
|
|
|
|
|
RefPtr<RenderThread> mThread;
|
|
|
|
RefPtr<gl::GLContext> mGL;
|
|
|
|
RefPtr<widget::CompositorWidget> mWidget;
|
|
|
|
WrRenderer* mWrRenderer;
|
2017-01-11 15:49:02 +03:00
|
|
|
CompositorBridgeParentBase* mBridge;
|
2017-01-06 21:10:20 +03:00
|
|
|
gfx::WindowId mWindowId;
|
2017-01-06 21:10:15 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|