зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1727511 - Add mozlog around WebRenderBridgeParent and RenderThread r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D123616
This commit is contained in:
Родитель
2aa1094a66
Коммит
a4dae9b314
|
@ -208,6 +208,9 @@ namespace layers {
|
|||
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
LazyLogModule gRenderThreadLog("WebRenderBridgeParent");
|
||||
#define LOG(...) MOZ_LOG(gRenderThreadLog, LogLevel::Debug, (__VA_ARGS__))
|
||||
|
||||
class ScheduleObserveLayersUpdate : public wr::NotificationHandler {
|
||||
public:
|
||||
ScheduleObserveLayersUpdate(RefPtr<CompositorBridgeParentBase> aBridge,
|
||||
|
@ -339,6 +342,11 @@ WebRenderBridgeParent::WebRenderBridgeParent(
|
|||
mDisablingNativeCompositor(false),
|
||||
mPendingScrollPayloads("WebRenderBridgeParent::mPendingScrollPayloads") {
|
||||
MOZ_ASSERT(mAsyncImageManager);
|
||||
LOG("WebRenderBridgeParent::WebRenderBridgeParent() PipelineId %" PRIx64
|
||||
" Id %" PRIx64 " root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
mAsyncImageManager->AddPipeline(mPipelineId, this);
|
||||
if (IsRootWebRenderBridgeParent()) {
|
||||
MOZ_ASSERT(!mCompositorScheduler);
|
||||
|
@ -363,9 +371,15 @@ WebRenderBridgeParent::WebRenderBridgeParent(const wr::PipelineId& aPipelineId,
|
|||
mIsFirstPaint(false),
|
||||
mSkippedComposite(false),
|
||||
mDisablingNativeCompositor(false),
|
||||
mPendingScrollPayloads("WebRenderBridgeParent::mPendingScrollPayloads") {}
|
||||
mPendingScrollPayloads("WebRenderBridgeParent::mPendingScrollPayloads") {
|
||||
LOG("WebRenderBridgeParent::WebRenderBridgeParent() PipelineId %" PRIx64 "",
|
||||
wr::AsUint64(mPipelineId));
|
||||
}
|
||||
|
||||
WebRenderBridgeParent::~WebRenderBridgeParent() {}
|
||||
WebRenderBridgeParent::~WebRenderBridgeParent() {
|
||||
LOG("WebRenderBridgeParent::WebRenderBridgeParent() PipelineId %" PRIx64 "",
|
||||
wr::AsUint64(mPipelineId));
|
||||
}
|
||||
|
||||
/* static */
|
||||
WebRenderBridgeParent* WebRenderBridgeParent::CreateDestroyed(
|
||||
|
@ -417,6 +431,11 @@ void WebRenderBridgeParent::Destroy() {
|
|||
if (mDestroyed) {
|
||||
return;
|
||||
}
|
||||
LOG("WebRenderBridgeParent::Destroy() PipelineId %" PRIx64 " Id %" PRIx64
|
||||
" root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
mDestroyed = true;
|
||||
if (mWebRenderBridgeRef) {
|
||||
// Break mutual reference
|
||||
|
@ -913,6 +932,11 @@ mozilla::ipc::IPCResult WebRenderBridgeParent::RecvUpdateResources(
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
LOG("WebRenderBridgeParent::RecvUpdateResources() PipelineId %" PRIx64
|
||||
" Id %" PRIx64 " root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
wr::TransactionBuilder txn(mApi);
|
||||
txn.SetLowPriority(!IsRootWebRenderBridgeParent());
|
||||
|
||||
|
@ -954,6 +978,11 @@ mozilla::ipc::IPCResult WebRenderBridgeParent::RecvDeleteCompositorAnimations(
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
LOG("WebRenderBridgeParent::RecvDeleteCompositorAnimations() PipelineId "
|
||||
"%" PRIx64 " Id %" PRIx64 " root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
// Once mWrEpoch has been rendered, we can delete these compositor animations
|
||||
mCompositorAnimationsToDelete.push(
|
||||
CompositorAnimationIdsForEpoch(mWrEpoch, std::move(aIds)));
|
||||
|
@ -1203,6 +1232,11 @@ mozilla::ipc::IPCResult WebRenderBridgeParent::RecvSetDisplayList(
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
LOG("WebRenderBridgeParent::RecvSetDisplayList() PipelineId %" PRIx64
|
||||
" Id %" PRIx64 " root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
if (!IsRootWebRenderBridgeParent()) {
|
||||
CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL, aTxnURL);
|
||||
}
|
||||
|
@ -1346,6 +1380,11 @@ mozilla::ipc::IPCResult WebRenderBridgeParent::RecvEmptyTransaction(
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
LOG("WebRenderBridgeParent::RecvEmptyTransaction() PipelineId %" PRIx64
|
||||
" Id %" PRIx64 " root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
if (!IsRootWebRenderBridgeParent()) {
|
||||
CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL, aTxnURL);
|
||||
}
|
||||
|
@ -1427,6 +1466,11 @@ mozilla::ipc::IPCResult WebRenderBridgeParent::RecvParentCommands(
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
LOG("WebRenderBridgeParent::RecvParentCommands() PipelineId %" PRIx64
|
||||
" Id %" PRIx64 " root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
wr::TransactionBuilder txn(mApi);
|
||||
txn.SetLowPriority(!IsRootWebRenderBridgeParent());
|
||||
if (!ProcessWebRenderParentCommands(aCommands, txn)) {
|
||||
|
@ -1664,6 +1708,11 @@ mozilla::ipc::IPCResult WebRenderBridgeParent::RecvGetSnapshot(
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
LOG("WebRenderBridgeParent::RecvGetSnapshot() PipelineId %" PRIx64
|
||||
" Id %" PRIx64 " root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
// This function should only get called in the root WRBP. If this function
|
||||
// gets called in a non-root WRBP, we will set mForceRendering in this WRBP
|
||||
// but it will have no effect because CompositeToTarget (which reads the
|
||||
|
@ -1833,6 +1882,11 @@ mozilla::ipc::IPCResult WebRenderBridgeParent::RecvClearCachedResources() {
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
LOG("WebRenderBridgeParent::RecvClearCachedResources() PipelineId %" PRIx64
|
||||
" Id %" PRIx64 " root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
// Clear resources
|
||||
wr::TransactionBuilder txn(mApi);
|
||||
txn.SetLowPriority(true);
|
||||
|
@ -1890,18 +1944,32 @@ wr::Epoch WebRenderBridgeParent::UpdateWebRender(
|
|||
// Register pipeline to updated AsyncImageManager.
|
||||
mAsyncImageManager->AddPipeline(mPipelineId, this);
|
||||
|
||||
LOG("WebRenderBridgeParent::UpdateWebRender() PipelineId %" PRIx64
|
||||
" Id %" PRIx64 " root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
return GetNextWrEpoch(); // Update webrender epoch
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult WebRenderBridgeParent::RecvInvalidateRenderedFrame() {
|
||||
// This function should only get called in the root WRBP
|
||||
MOZ_ASSERT(IsRootWebRenderBridgeParent());
|
||||
LOG("WebRenderBridgeParent::RecvInvalidateRenderedFrame() PipelineId %" PRIx64
|
||||
" Id %" PRIx64 " root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
InvalidateRenderedFrame();
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult WebRenderBridgeParent::RecvScheduleComposite() {
|
||||
LOG("WebRenderBridgeParent::RecvScheduleComposite() PipelineId %" PRIx64
|
||||
" Id %" PRIx64 " root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
// Caller of LayerManager::ScheduleComposite() expects that it trigger
|
||||
// composite. Then we do not want to skip generate frame.
|
||||
ScheduleForcedGenerateFrame();
|
||||
|
@ -1950,6 +2018,11 @@ mozilla::ipc::IPCResult WebRenderBridgeParent::RecvStopCaptureSequence() {
|
|||
}
|
||||
|
||||
mozilla::ipc::IPCResult WebRenderBridgeParent::RecvSyncWithCompositor() {
|
||||
LOG("WebRenderBridgeParent::RecvSyncWithCompositor() PipelineId %" PRIx64
|
||||
" Id %" PRIx64 " root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
FlushSceneBuilds();
|
||||
if (RefPtr<WebRenderBridgeParent> root = GetRootWebRenderBridgeParent()) {
|
||||
root->FlushFrameGeneration();
|
||||
|
@ -2112,6 +2185,11 @@ void WebRenderBridgeParent::CompositeToTarget(VsyncId aId,
|
|||
MOZ_ASSERT(aTarget == nullptr);
|
||||
MOZ_ASSERT(aRect == nullptr);
|
||||
|
||||
LOG("WebRenderBridgeParent::CompositeToTarget() PipelineId %" PRIx64
|
||||
" Id %" PRIx64 " root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
AUTO_PROFILER_TRACING_MARKER("Paint", "CompositeToTarget", GRAPHICS);
|
||||
|
||||
bool paused = true;
|
||||
|
@ -2164,6 +2242,10 @@ void WebRenderBridgeParent::MaybeGenerateFrame(VsyncId aId,
|
|||
bool aForceGenerateFrame) {
|
||||
// This function should only get called in the root WRBP
|
||||
MOZ_ASSERT(IsRootWebRenderBridgeParent());
|
||||
LOG("WebRenderBridgeParent::MaybeGenerateFrame() PipelineId %" PRIx64
|
||||
" Id %" PRIx64 " root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
if (CompositorBridgeParent* cbp = GetRootCompositorBridgeParent()) {
|
||||
// Skip WR render during paused state.
|
||||
|
@ -2481,6 +2563,10 @@ void WebRenderBridgeParent::SetClearColor(const gfx::DeviceColor& aColor) {
|
|||
|
||||
void WebRenderBridgeParent::Pause() {
|
||||
MOZ_ASSERT(IsRootWebRenderBridgeParent());
|
||||
LOG("WebRenderBridgeParent::Pause() PipelineId %" PRIx64 " Id %" PRIx64
|
||||
" root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
if (!IsRootWebRenderBridgeParent() || mDestroyed) {
|
||||
return;
|
||||
|
@ -2491,6 +2577,10 @@ void WebRenderBridgeParent::Pause() {
|
|||
|
||||
bool WebRenderBridgeParent::Resume() {
|
||||
MOZ_ASSERT(IsRootWebRenderBridgeParent());
|
||||
LOG("WebRenderBridgeParent::Resume() PipelineId %" PRIx64 " Id %" PRIx64
|
||||
" root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
if (!IsRootWebRenderBridgeParent() || mDestroyed) {
|
||||
return false;
|
||||
|
@ -2510,6 +2600,11 @@ void WebRenderBridgeParent::ClearResources() {
|
|||
return;
|
||||
}
|
||||
|
||||
LOG("WebRenderBridgeParent::ClearResources() PipelineId %" PRIx64
|
||||
" Id %" PRIx64 " root %d",
|
||||
wr::AsUint64(mPipelineId), wr::AsUint64(mApi->GetId()),
|
||||
IsRootWebRenderBridgeParent());
|
||||
|
||||
wr::Epoch wrEpoch = GetNextWrEpoch();
|
||||
mReceivedDisplayList = false;
|
||||
// Schedule generate frame to clean up Pipeline
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
namespace mozilla {
|
||||
namespace wr {
|
||||
|
||||
extern LazyLogModule gRenderThreadLog;
|
||||
#define LOG(...) MOZ_LOG(gRenderThreadLog, LogLevel::Debug, (__VA_ARGS__))
|
||||
|
||||
/* static */
|
||||
UniquePtr<DCLayerTree> DCLayerTree::Create(gl::GLContext* aGL,
|
||||
EGLConfig aEGLConfig,
|
||||
|
@ -66,9 +69,15 @@ DCLayerTree::DCLayerTree(gl::GLContext* aGL, EGLConfig aEGLConfig,
|
|||
mDebugVisualRedrawRegions(false),
|
||||
mEGLImage(EGL_NO_IMAGE),
|
||||
mColorRBO(0),
|
||||
mPendingCommit(false) {}
|
||||
mPendingCommit(false) {
|
||||
LOG("DCLayerTree::DCLayerTree()");
|
||||
}
|
||||
|
||||
DCLayerTree::~DCLayerTree() { ReleaseNativeCompositorResources(); }
|
||||
DCLayerTree::~DCLayerTree() {
|
||||
LOG("DCLayerTree::~DCLayerTree()");
|
||||
|
||||
ReleaseNativeCompositorResources();
|
||||
}
|
||||
|
||||
void DCLayerTree::ReleaseNativeCompositorResources() {
|
||||
const auto gl = GetGLContext();
|
||||
|
@ -166,6 +175,8 @@ DCSurface* DCLayerTree::GetSurface(wr::NativeSurfaceId aId) const {
|
|||
}
|
||||
|
||||
void DCLayerTree::SetDefaultSwapChain(IDXGISwapChain1* aSwapChain) {
|
||||
LOG("DCLayerTree::SetDefaultSwapChain()");
|
||||
|
||||
mRootVisual->AddVisual(mDefaultSwapChainVisual, TRUE, nullptr);
|
||||
mDefaultSwapChainVisual->SetContent(aSwapChain);
|
||||
// Default SwapChain's visual does not need linear interporation.
|
||||
|
|
|
@ -41,6 +41,9 @@
|
|||
namespace mozilla {
|
||||
namespace wr {
|
||||
|
||||
extern LazyLogModule gRenderThreadLog;
|
||||
#define LOG(...) MOZ_LOG(gRenderThreadLog, LogLevel::Debug, (__VA_ARGS__))
|
||||
|
||||
/* static */
|
||||
UniquePtr<RenderCompositor> RenderCompositorANGLE::Create(
|
||||
const RefPtr<widget::CompositorWidget>& aWidget, nsACString& aError) {
|
||||
|
@ -72,9 +75,13 @@ RenderCompositorANGLE::RenderCompositorANGLE(
|
|||
mUseNativeCompositor(true),
|
||||
mUsePartialPresent(false),
|
||||
mFullRender(false),
|
||||
mDisablingNativeCompositor(false) {}
|
||||
mDisablingNativeCompositor(false) {
|
||||
LOG("RenderCompositorANGLE::RenderCompositorANGLE()");
|
||||
}
|
||||
|
||||
RenderCompositorANGLE::~RenderCompositorANGLE() {
|
||||
LOG("RenderCompositorANGLE::~RenderCompositorANGLE()");
|
||||
|
||||
DestroyEGLSurface();
|
||||
MOZ_ASSERT(!mEGLSurface);
|
||||
}
|
||||
|
@ -941,6 +948,7 @@ void RenderCompositorANGLE::EnableNativeCompositor(bool aEnable) {
|
|||
// XXX Re-enable native compositor is not handled yet.
|
||||
MOZ_RELEASE_ASSERT(!mDisablingNativeCompositor);
|
||||
MOZ_RELEASE_ASSERT(!aEnable);
|
||||
LOG("RenderCompositorANGLE::EnableNativeCompositor() aEnable %d", aEnable);
|
||||
|
||||
if (!UseCompositor()) {
|
||||
return;
|
||||
|
|
|
@ -18,6 +18,9 @@ using namespace layers;
|
|||
|
||||
namespace wr {
|
||||
|
||||
extern LazyLogModule gRenderThreadLog;
|
||||
#define LOG(...) MOZ_LOG(gRenderThreadLog, LogLevel::Debug, (__VA_ARGS__))
|
||||
|
||||
RenderCompositorD3D11SWGL::UploadMode
|
||||
RenderCompositorD3D11SWGL::GetUploadMode() {
|
||||
int mode = StaticPrefs::gfx_webrender_software_d3d11_upload_mode();
|
||||
|
@ -65,10 +68,14 @@ RenderCompositorD3D11SWGL::RenderCompositorD3D11SWGL(
|
|||
CompositorD3D11* aCompositor,
|
||||
const RefPtr<widget::CompositorWidget>& aWidget, void* aContext)
|
||||
: RenderCompositorLayersSWGL(aCompositor, aWidget, aContext) {
|
||||
LOG("RenderCompositorD3D11SWGL::RenderCompositorD3D11SWGL()");
|
||||
|
||||
mSyncObject = GetCompositorD3D11()->GetSyncObject();
|
||||
}
|
||||
|
||||
RenderCompositorD3D11SWGL::~RenderCompositorD3D11SWGL() {}
|
||||
RenderCompositorD3D11SWGL::~RenderCompositorD3D11SWGL() {
|
||||
LOG("RenderCompositorD3D11SWGL::~RenderCompositorD3D11SWGL()");
|
||||
}
|
||||
|
||||
bool RenderCompositorD3D11SWGL::BeginFrame() {
|
||||
if (!RenderCompositorLayersSWGL::BeginFrame()) {
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
|
||||
namespace mozilla::wr {
|
||||
|
||||
extern LazyLogModule gRenderThreadLog;
|
||||
#define LOG(...) MOZ_LOG(gRenderThreadLog, LogLevel::Debug, (__VA_ARGS__))
|
||||
|
||||
/* static */
|
||||
UniquePtr<RenderCompositor> RenderCompositorEGL::Create(
|
||||
const RefPtr<widget::CompositorWidget>& aWidget, nsACString& aError) {
|
||||
|
@ -57,9 +60,12 @@ EGLSurface RenderCompositorEGL::CreateEGLSurface() {
|
|||
|
||||
RenderCompositorEGL::RenderCompositorEGL(
|
||||
const RefPtr<widget::CompositorWidget>& aWidget)
|
||||
: RenderCompositor(aWidget), mEGLSurface(EGL_NO_SURFACE) {}
|
||||
: RenderCompositor(aWidget), mEGLSurface(EGL_NO_SURFACE) {
|
||||
LOG("RenderCompositorEGL::RenderCompositorEGL()");
|
||||
}
|
||||
|
||||
RenderCompositorEGL::~RenderCompositorEGL() {
|
||||
LOG("RenderCompositorEGL::~RenderCompositorEGL()");
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
java::GeckoSurfaceTexture::DestroyUnused((int64_t)gl());
|
||||
#endif
|
||||
|
|
|
@ -22,10 +22,15 @@
|
|||
|
||||
namespace mozilla::wr {
|
||||
|
||||
extern LazyLogModule gRenderThreadLog;
|
||||
#define LOG(...) MOZ_LOG(gRenderThreadLog, LogLevel::Debug, (__VA_ARGS__))
|
||||
|
||||
RenderCompositorNative::RenderCompositorNative(
|
||||
const RefPtr<widget::CompositorWidget>& aWidget, gl::GLContext* aGL)
|
||||
: RenderCompositor(aWidget),
|
||||
mNativeLayerRoot(GetWidget()->GetNativeLayerRoot()) {
|
||||
LOG("RenderCompositorNative::RenderCompositorNative()");
|
||||
|
||||
#if defined(XP_MACOSX) || defined(MOZ_WAYLAND)
|
||||
auto pool = RenderThread::Get()->SharedSurfacePool();
|
||||
if (pool) {
|
||||
|
@ -36,6 +41,8 @@ RenderCompositorNative::RenderCompositorNative(
|
|||
}
|
||||
|
||||
RenderCompositorNative::~RenderCompositorNative() {
|
||||
LOG("RRenderCompositorNative::~RenderCompositorNative()");
|
||||
|
||||
Pause();
|
||||
mProfilerScreenshotGrabber.Destroy();
|
||||
mNativeLayerRoot->SetLayers({});
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
|
||||
namespace mozilla::wr {
|
||||
|
||||
extern LazyLogModule gRenderThreadLog;
|
||||
#define LOG(...) MOZ_LOG(gRenderThreadLog, LogLevel::Debug, (__VA_ARGS__))
|
||||
|
||||
/* static */
|
||||
UniquePtr<RenderCompositor> RenderCompositorOGL::Create(
|
||||
const RefPtr<widget::CompositorWidget>& aWidget, nsACString& aError) {
|
||||
|
@ -38,11 +41,14 @@ RenderCompositorOGL::RenderCompositorOGL(
|
|||
const RefPtr<widget::CompositorWidget>& aWidget)
|
||||
: RenderCompositor(aWidget), mGL(aGL) {
|
||||
MOZ_ASSERT(mGL);
|
||||
LOG("RenderCompositorOGL::RenderCompositorOGL()");
|
||||
|
||||
mIsEGL = aGL->GetContextType() == mozilla::gl::GLContextType::EGL;
|
||||
}
|
||||
|
||||
RenderCompositorOGL::~RenderCompositorOGL() {
|
||||
LOG("RenderCompositorOGL::~RenderCompositorOGL()");
|
||||
|
||||
if (!mGL->MakeCurrent()) {
|
||||
gfxCriticalNote
|
||||
<< "Failed to make render context current during destroying.";
|
||||
|
|
|
@ -35,6 +35,9 @@ using namespace layers;
|
|||
using namespace gfx;
|
||||
namespace wr {
|
||||
|
||||
extern LazyLogModule gRenderThreadLog;
|
||||
#define LOG(...) MOZ_LOG(gRenderThreadLog, LogLevel::Debug, (__VA_ARGS__))
|
||||
|
||||
UniquePtr<RenderCompositor> RenderCompositorOGLSWGL::Create(
|
||||
const RefPtr<widget::CompositorWidget>& aWidget, nsACString& aError) {
|
||||
if (!aWidget->GetCompositorOptions().AllowSoftwareWebRenderOGL()) {
|
||||
|
@ -94,9 +97,12 @@ UniquePtr<RenderCompositor> RenderCompositorOGLSWGL::Create(
|
|||
RenderCompositorOGLSWGL::RenderCompositorOGLSWGL(
|
||||
Compositor* aCompositor, const RefPtr<widget::CompositorWidget>& aWidget,
|
||||
void* aContext)
|
||||
: RenderCompositorLayersSWGL(aCompositor, aWidget, aContext) {}
|
||||
: RenderCompositorLayersSWGL(aCompositor, aWidget, aContext) {
|
||||
LOG("RenderCompositorOGLSWGL::RenderCompositorOGLSWGL()");
|
||||
}
|
||||
|
||||
RenderCompositorOGLSWGL::~RenderCompositorOGLSWGL() {
|
||||
LOG("RRenderCompositorOGLSWGL::~RenderCompositorOGLSWGL()");
|
||||
#ifdef OZ_WIDGET_ANDROID
|
||||
java::GeckoSurfaceTexture::DestroyUnused((int64_t)GetGLContext());
|
||||
DestroyEGLSurface();
|
||||
|
|
|
@ -18,6 +18,9 @@ using namespace gfx;
|
|||
|
||||
namespace wr {
|
||||
|
||||
extern LazyLogModule gRenderThreadLog;
|
||||
#define LOG(...) MOZ_LOG(gRenderThreadLog, LogLevel::Debug, (__VA_ARGS__))
|
||||
|
||||
/* static */
|
||||
UniquePtr<RenderCompositor> RenderCompositorSWGL::Create(
|
||||
const RefPtr<widget::CompositorWidget>& aWidget, nsACString& aError) {
|
||||
|
@ -33,9 +36,12 @@ RenderCompositorSWGL::RenderCompositorSWGL(
|
|||
const RefPtr<widget::CompositorWidget>& aWidget, void* aContext)
|
||||
: RenderCompositor(aWidget), mContext(aContext) {
|
||||
MOZ_ASSERT(mContext);
|
||||
LOG("RenderCompositorSWGL::RenderCompositorSWGL()");
|
||||
}
|
||||
|
||||
RenderCompositorSWGL::~RenderCompositorSWGL() {
|
||||
LOG("RenderCompositorSWGL::~RenderCompositorSWGL()");
|
||||
|
||||
wr_swgl_destroy_context(mContext);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,6 +59,9 @@ MOZ_DEFINE_MALLOC_SIZE_OF(WebRenderRendererMallocSizeOf)
|
|||
|
||||
namespace mozilla::wr {
|
||||
|
||||
LazyLogModule gRenderThreadLog("RenderThread");
|
||||
#define LOG(...) MOZ_LOG(gRenderThreadLog, LogLevel::Debug, (__VA_ARGS__))
|
||||
|
||||
static StaticRefPtr<RenderThread> sRenderThread;
|
||||
static mozilla::BackgroundHangMonitor* sBackgroundHangMonitor;
|
||||
|
||||
|
@ -71,9 +74,14 @@ RenderThread::RenderThread(RefPtr<nsIThread> aThread)
|
|||
mRenderTextureMapLock("RenderThread.mRenderTextureMapLock"),
|
||||
mHasShutdown(false),
|
||||
mHandlingDeviceReset(false),
|
||||
mHandlingWebRenderError(false) {}
|
||||
mHandlingWebRenderError(false) {
|
||||
LOG("RenderThread::RenderThread()");
|
||||
}
|
||||
|
||||
RenderThread::~RenderThread() { MOZ_ASSERT(mRenderTexturesDeferred.empty()); }
|
||||
RenderThread::~RenderThread() {
|
||||
MOZ_ASSERT(mRenderTexturesDeferred.empty());
|
||||
LOG("RenderThread::~RenderThread()");
|
||||
}
|
||||
|
||||
// static
|
||||
RenderThread* RenderThread::Get() { return sRenderThread; }
|
||||
|
@ -82,6 +90,7 @@ RenderThread* RenderThread::Get() { return sRenderThread; }
|
|||
void RenderThread::Start() {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(!sRenderThread);
|
||||
LOG("RenderThread::Start()");
|
||||
|
||||
RefPtr<nsIThread> thread;
|
||||
nsresult rv = NS_NewNamedThread(
|
||||
|
@ -121,6 +130,7 @@ void RenderThread::Start() {
|
|||
void RenderThread::ShutDown() {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(sRenderThread);
|
||||
LOG("RenderThread::ShutDown()");
|
||||
|
||||
{
|
||||
MutexAutoLock lock(sRenderThread->mRenderTextureMapLock);
|
||||
|
@ -224,6 +234,7 @@ RefPtr<MemoryReportPromise> RenderThread::AccumulateMemoryReport(
|
|||
void RenderThread::AddRenderer(wr::WindowId aWindowId,
|
||||
UniquePtr<RendererOGL> aRenderer) {
|
||||
MOZ_ASSERT(IsInRenderThread());
|
||||
LOG("RenderThread::AddRenderer() aWindowId %" PRIx64 "", AsUint64(aWindowId));
|
||||
|
||||
if (mHasShutdown) {
|
||||
return;
|
||||
|
@ -237,6 +248,8 @@ void RenderThread::AddRenderer(wr::WindowId aWindowId,
|
|||
|
||||
void RenderThread::RemoveRenderer(wr::WindowId aWindowId) {
|
||||
MOZ_ASSERT(IsInRenderThread());
|
||||
LOG("RenderThread::RemoveRenderer() aWindowId %" PRIx64 "",
|
||||
AsUint64(aWindowId));
|
||||
|
||||
if (mHasShutdown) {
|
||||
return;
|
||||
|
@ -480,6 +493,8 @@ void RenderThread::UpdateAndRender(
|
|||
if (renderer->IsPaused()) {
|
||||
aRender = false;
|
||||
}
|
||||
LOG("RenderThread::UpdateAndRender() aWindowId %" PRIx64 " aRender %d",
|
||||
AsUint64(aWindowId), aRender);
|
||||
|
||||
layers::CompositorThread()->Dispatch(
|
||||
NewRunnableFunction("NotifyDidStartRenderRunnable", &NotifyDidStartRender,
|
||||
|
@ -543,6 +558,7 @@ void RenderThread::UpdateAndRender(
|
|||
|
||||
void RenderThread::Pause(wr::WindowId aWindowId) {
|
||||
MOZ_ASSERT(IsInRenderThread());
|
||||
LOG("RenderThread::Pause() aWindowId %" PRIx64 "", AsUint64(aWindowId));
|
||||
|
||||
auto it = mRenderers.find(aWindowId);
|
||||
MOZ_ASSERT(it != mRenderers.end());
|
||||
|
@ -555,6 +571,7 @@ void RenderThread::Pause(wr::WindowId aWindowId) {
|
|||
|
||||
bool RenderThread::Resume(wr::WindowId aWindowId) {
|
||||
MOZ_ASSERT(IsInRenderThread());
|
||||
LOG("enderThread::Resume() aWindowId %" PRIx64 "", AsUint64(aWindowId));
|
||||
|
||||
auto it = mRenderers.find(aWindowId);
|
||||
MOZ_ASSERT(it != mRenderers.end());
|
||||
|
@ -920,6 +937,8 @@ gl::GLContext* RenderThread::SingletonGL() {
|
|||
}
|
||||
|
||||
void RenderThread::CreateSingletonGL(nsACString& aError) {
|
||||
LOG("RenderThread::CreateSingletonGL()");
|
||||
|
||||
mSingletonGL = CreateGLContext(aError);
|
||||
mSingletonGLIsForHardwareWebRender = !gfx::gfxVars::UseSoftwareWebRender();
|
||||
}
|
||||
|
@ -949,6 +968,8 @@ gl::GLContext* RenderThread::SingletonGLForCompositorOGL() {
|
|||
|
||||
void RenderThread::ClearSingletonGL() {
|
||||
MOZ_ASSERT(IsInRenderThread());
|
||||
LOG("RenderThread::ClearSingletonGL()");
|
||||
|
||||
if (mSurfacePool) {
|
||||
mSurfacePool->DestroyGLResourcesForContext(mSingletonGL);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче