summaryrefslogtreecommitdiffstats
path: root/gfx/webrender_bindings/RenderThread.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /gfx/webrender_bindings/RenderThread.cpp
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/webrender_bindings/RenderThread.cpp')
-rw-r--r--gfx/webrender_bindings/RenderThread.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/gfx/webrender_bindings/RenderThread.cpp b/gfx/webrender_bindings/RenderThread.cpp
index e1a41ee225..cb496c8fc5 100644
--- a/gfx/webrender_bindings/RenderThread.cpp
+++ b/gfx/webrender_bindings/RenderThread.cpp
@@ -979,6 +979,21 @@ void RenderThread::RegisterExternalImage(
mSyncObjectNeededRenderTextures.emplace(aExternalImageId, texture);
}
mRenderTextures.emplace(aExternalImageId, texture);
+
+#ifdef DEBUG
+ int32_t maxAllowedIncrease =
+ StaticPrefs::gfx_testing_assert_render_textures_increase();
+
+ if (maxAllowedIncrease <= 0) {
+ mRenderTexturesLastTime = -1;
+ } else {
+ if (mRenderTexturesLastTime < 0) {
+ mRenderTexturesLastTime = static_cast<int32_t>(mRenderTextures.size());
+ }
+ MOZ_ASSERT((static_cast<int32_t>(mRenderTextures.size()) -
+ mRenderTexturesLastTime) < maxAllowedIncrease);
+ }
+#endif
}
void RenderThread::UnregisterExternalImage(