From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- gfx/layers/wr/AsyncImagePipelineManager.cpp | 3 +-- gfx/layers/wr/WebRenderBridgeParent.cpp | 10 ++++++---- gfx/layers/wr/WebRenderImageHost.cpp | 13 ++++++++----- gfx/layers/wr/WebRenderScrollData.cpp | 16 ++++++++++++++++ gfx/layers/wr/WebRenderScrollData.h | 13 +++++++++++++ 5 files changed, 44 insertions(+), 11 deletions(-) (limited to 'gfx/layers/wr') diff --git a/gfx/layers/wr/AsyncImagePipelineManager.cpp b/gfx/layers/wr/AsyncImagePipelineManager.cpp index 464b8fb69f..8a49ffef69 100644 --- a/gfx/layers/wr/AsyncImagePipelineManager.cpp +++ b/gfx/layers/wr/AsyncImagePipelineManager.cpp @@ -229,8 +229,7 @@ Maybe AsyncImagePipelineManager::UpdateImageKeys( auto* wrapper = aTexture ? aTexture->AsRemoteTextureHostWrapper() : nullptr; if (wrapper && !aPipeline->mImageHost->GetAsyncRef()) { std::function function; - RemoteTextureMap::Get()->GetRemoteTexture( - wrapper, std::move(function), /* aWaitForRemoteTextureOwner */ false); + RemoteTextureMap::Get()->GetRemoteTexture(wrapper, std::move(function)); } if (!aTexture || aTexture->NumSubTextures() == 0) { diff --git a/gfx/layers/wr/WebRenderBridgeParent.cpp b/gfx/layers/wr/WebRenderBridgeParent.cpp index 789476cb6b..83139b6af6 100644 --- a/gfx/layers/wr/WebRenderBridgeParent.cpp +++ b/gfx/layers/wr/WebRenderBridgeParent.cpp @@ -141,7 +141,7 @@ void gfx_wr_set_crash_annotation(mozilla::wr::CrashAnnotation aAnnotation, return; } - CrashReporter::AnnotateCrashReport(annotation, nsDependentCString(aValue)); + CrashReporter::RecordAnnotationCString(annotation, aValue); } void gfx_wr_clear_crash_annotation(mozilla::wr::CrashAnnotation aAnnotation) { @@ -150,7 +150,7 @@ void gfx_wr_clear_crash_annotation(mozilla::wr::CrashAnnotation aAnnotation) { return; } - CrashReporter::RemoveCrashReportAnnotation(annotation); + CrashReporter::UnrecordAnnotation(annotation); } } @@ -1188,7 +1188,8 @@ mozilla::ipc::IPCResult WebRenderBridgeParent::RecvSetDisplayList( IsRootWebRenderBridgeParent()); if (!IsRootWebRenderBridgeParent()) { - CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL, aTxnURL); + CrashReporter::RecordAnnotationNSCString(CrashReporter::Annotation::URL, + aTxnURL); } CompositorBridgeParent* cbp = GetRootCompositorBridgeParent(); @@ -1330,7 +1331,8 @@ mozilla::ipc::IPCResult WebRenderBridgeParent::RecvEmptyTransaction( IsRootWebRenderBridgeParent()); if (!IsRootWebRenderBridgeParent()) { - CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL, aTxnURL); + CrashReporter::RecordAnnotationNSCString(CrashReporter::Annotation::URL, + aTxnURL); } AUTO_PROFILER_TRACING_MARKER("Paint", "EmptyTransaction", GRAPHICS); diff --git a/gfx/layers/wr/WebRenderImageHost.cpp b/gfx/layers/wr/WebRenderImageHost.cpp index e3bbd5d50f..5016bc30f8 100644 --- a/gfx/layers/wr/WebRenderImageHost.cpp +++ b/gfx/layers/wr/WebRenderImageHost.cpp @@ -198,8 +198,11 @@ void WebRenderImageHost::UseRemoteTexture() { while (!mPendingRemoteTextureWrappers.empty()) { auto* wrapper = mPendingRemoteTextureWrappers.front()->AsRemoteTextureHostWrapper(); - mWaitingReadyCallback = RemoteTextureMap::Get()->GetRemoteTexture( - wrapper, readyCallback, mWaitForRemoteTextureOwner); + if (mWaitForRemoteTextureOwner) { + RemoteTextureMap::Get()->WaitForRemoteTextureOwner(wrapper); + } + mWaitingReadyCallback = + RemoteTextureMap::Get()->GetRemoteTexture(wrapper, readyCallback); MOZ_ASSERT_IF(mWaitingReadyCallback, !wrapper->IsReadyForRendering()); if (!wrapper->IsReadyForRendering()) { break; @@ -213,9 +216,9 @@ void WebRenderImageHost::UseRemoteTexture() { mPendingRemoteTextureWrappers.pop_front(); MOZ_ASSERT(mPendingRemoteTextureWrappers.empty()); - std::function function; - RemoteTextureMap::Get()->GetRemoteTexture(wrapper, std::move(function), - mWaitForRemoteTextureOwner); + if (mWaitForRemoteTextureOwner) { + RemoteTextureMap::Get()->WaitForRemoteTextureOwner(wrapper); + } mWaitForRemoteTextureOwner = false; } diff --git a/gfx/layers/wr/WebRenderScrollData.cpp b/gfx/layers/wr/WebRenderScrollData.cpp index 538df8bdef..905b7e1de0 100644 --- a/gfx/layers/wr/WebRenderScrollData.cpp +++ b/gfx/layers/wr/WebRenderScrollData.cpp @@ -370,6 +370,22 @@ void WebRenderScrollData::ApplyUpdates(ScrollUpdatesMap&& aUpdates, mPaintSequenceNumber = aPaintSequenceNumber; } +void WebRenderScrollData::PrependUpdates( + const WebRenderScrollData& aPreviousData) { + for (auto previousMetadata : aPreviousData.mScrollMetadatas) { + const nsTArray& previousUpdates = + previousMetadata.GetScrollUpdates(); + if (previousUpdates.IsEmpty()) { + continue; + } + + if (Maybe index = + HasMetadataFor(previousMetadata.GetMetrics().GetScrollId())) { + mScrollMetadatas[*index].PrependUpdates(previousUpdates); + } + } +} + void WebRenderScrollData::DumpSubtree(std::ostream& aOut, size_t aIndex, const std::string& aIndent) const { aOut << aIndent; diff --git a/gfx/layers/wr/WebRenderScrollData.h b/gfx/layers/wr/WebRenderScrollData.h index c575d4ca21..fd82ac93fc 100644 --- a/gfx/layers/wr/WebRenderScrollData.h +++ b/gfx/layers/wr/WebRenderScrollData.h @@ -276,6 +276,13 @@ class WebRenderScrollData { void ApplyUpdates(ScrollUpdatesMap&& aUpdates, uint32_t aPaintSequenceNumber); + // Prepend the scroll position updates in the previous data to this data so + // that we can handle all scroll position updates in the proper order. + void PrependUpdates(const WebRenderScrollData& aPreviousData); + + void SetWasUpdateSkipped() { mWasUpdateSkipped = true; } + bool GetWasUpdateSkipped() const { return mWasUpdateSkipped; } + friend struct IPC::ParamTraits; friend std::ostream& operator<<(std::ostream& aOut, @@ -328,6 +335,12 @@ class WebRenderScrollData { bool mIsFirstPaint; uint32_t mPaintSequenceNumber; + + // Wether this data was skipped to updated because the parent process hasn't + // yet gotten the referent LayersId for this data. + // + // Note this variable is not copied over IPC. + bool mWasUpdateSkipped = false; }; } // namespace layers -- cgit v1.2.3