From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- gfx/layers/client/TextureClient.cpp | 10 +++++----- gfx/layers/client/TextureRecorded.cpp | 5 +++-- gfx/layers/client/TextureRecorded.h | 3 ++- 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'gfx/layers/client') diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index bfc20b9b08..4187e48955 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -27,6 +27,7 @@ #include "mozilla/gfx/gfxVars.h" #include "mozilla/ipc/CrossProcessSemaphore.h" #include "mozilla/ipc/SharedMemory.h" // for SharedMemory, etc +#include "mozilla/layers/CanvasRenderer.h" #include "mozilla/layers/CompositableForwarder.h" #include "mozilla/layers/ISurfaceAllocator.h" #include "mozilla/layers/ImageBridgeChild.h" @@ -375,7 +376,8 @@ TextureData* TextureData::Create(TextureForwarder* aAllocator, RefPtr canvasChild = aAllocator->GetCanvasChild(); if (canvasChild) { return new RecordedTextureData(canvasChild.forget(), aSize, aFormat, - textureType); + textureType, + layers::TexTypeForWebgl(aKnowsCompositor)); } // If we must be remote, but there is no canvas child, then falling back // is not possible. @@ -746,12 +748,10 @@ void TextureClient::ReadUnlock() { } bool TextureClient::Lock(OpenMode aMode) { - MOZ_ASSERT(IsValid()); - MOZ_ASSERT(!mIsLocked); - if (!IsValid()) { + if (NS_WARN_IF(!IsValid())) { return false; } - if (mIsLocked) { + if (NS_WARN_IF(mIsLocked)) { return mOpenMode == aMode; } diff --git a/gfx/layers/client/TextureRecorded.cpp b/gfx/layers/client/TextureRecorded.cpp index 7e7ee2da99..da4ca4f8f3 100644 --- a/gfx/layers/client/TextureRecorded.cpp +++ b/gfx/layers/client/TextureRecorded.cpp @@ -23,9 +23,10 @@ static int64_t sNextRecordedTextureId = 0; RecordedTextureData::RecordedTextureData( already_AddRefed aCanvasChild, gfx::IntSize aSize, - gfx::SurfaceFormat aFormat, TextureType aTextureType) + gfx::SurfaceFormat aFormat, TextureType aTextureType, + TextureType aWebglTextureType) : mCanvasChild(aCanvasChild), mSize(aSize), mFormat(aFormat) { - mCanvasChild->EnsureRecorder(aSize, aFormat, aTextureType); + mCanvasChild->EnsureRecorder(aSize, aFormat, aTextureType, aWebglTextureType); } RecordedTextureData::~RecordedTextureData() { diff --git a/gfx/layers/client/TextureRecorded.h b/gfx/layers/client/TextureRecorded.h index d846c1fac1..56e504fb54 100644 --- a/gfx/layers/client/TextureRecorded.h +++ b/gfx/layers/client/TextureRecorded.h @@ -18,7 +18,8 @@ class RecordedTextureData final : public TextureData { public: RecordedTextureData(already_AddRefed aCanvasChild, gfx::IntSize aSize, gfx::SurfaceFormat aFormat, - TextureType aTextureType); + TextureType aTextureType, + TextureType aWebglTextureType = TextureType::Unknown); void FillInfo(TextureData::Info& aInfo) const final; -- cgit v1.2.3