diff --git a/gfx/layers/BufferTexture.cpp b/gfx/layers/BufferTexture.cpp index 31d8d8c97008..f7cb72d391c2 100644 --- a/gfx/layers/BufferTexture.cpp +++ b/gfx/layers/BufferTexture.cpp @@ -385,8 +385,7 @@ static bool InitBuffer(uint8_t* buf, size_t bufSize, gfx::SurfaceFormat aFormat, return false; } - if ((aAllocFlags & ALLOC_CLEAR_BUFFER) || - (aAllocFlags & ALLOC_CLEAR_BUFFER_BLACK)) { + if (aAllocFlags & ALLOC_CLEAR_BUFFER) { if (aFormat == gfx::SurfaceFormat::B8G8R8X8) { // Even though BGRX was requested, XRGB_UINT32 is what is meant, // so use 0xFF000000 to put alpha in the right place. @@ -397,10 +396,6 @@ static bool InitBuffer(uint8_t* buf, size_t bufSize, gfx::SurfaceFormat aFormat, } } - if (aAllocFlags & ALLOC_CLEAR_BUFFER_WHITE) { - memset(buf, 0xFF, bufSize); - } - return true; } diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index 5fc44fb7afe9..80a7280de905 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -266,8 +266,7 @@ static TextureType GetTextureType(gfx::SurfaceFormat aFormat, if ((layersBackend == LayersBackend::LAYERS_WR && !aKnowsCompositor->UsingSoftwareWebRender()) && (moz2DBackend == gfx::BackendType::DIRECT2D || - moz2DBackend == gfx::BackendType::DIRECT2D1_1 || - (!!(aAllocFlags & ALLOC_FOR_OUT_OF_BAND_CONTENT))) && + moz2DBackend == gfx::BackendType::DIRECT2D1_1) && aSize.width <= maxTextureSize && aSize.height <= maxTextureSize && !(aAllocFlags & ALLOC_UPDATE_FROM_SURFACE)) { return TextureType::D3D11; @@ -1195,8 +1194,7 @@ already_AddRefed TextureClient::CreateFromSurface( if (layersBackend == LayersBackend::LAYERS_WR && (moz2DBackend == gfx::BackendType::DIRECT2D || moz2DBackend == gfx::BackendType::DIRECT2D1_1 || - (!!(aAllocFlags & ALLOC_FOR_OUT_OF_BAND_CONTENT) && - DeviceManagerDx::Get()->GetContentDevice())) && + DeviceManagerDx::Get()->GetContentDevice()) && size.width <= maxTextureSize && size.height <= maxTextureSize) { data = D3D11TextureData::Create(aSurface, aAllocFlags); } @@ -1248,10 +1246,6 @@ already_AddRefed TextureClient::CreateForRawBufferAccess( return nullptr; } - if (aAllocFlags & ALLOC_DISALLOW_BUFFERTEXTURECLIENT) { - return nullptr; - } - if (!gfx::Factory::AllowedSurfaceSize(aSize)) { return nullptr; } diff --git a/gfx/layers/client/TextureClient.h b/gfx/layers/client/TextureClient.h index 234901a76443..ef3d028e795c 100644 --- a/gfx/layers/client/TextureClient.h +++ b/gfx/layers/client/TextureClient.h @@ -62,8 +62,6 @@ class PTextureChild; class TextureChild; class TextureData; class GPUVideoTextureData; -struct RawTextureBuffer; -class RawYCbCrTextureBuffer; class TextureClient; class ITextureClientRecycleAllocator; #ifdef GFX_DEBUG_TRACK_CLIENTS_IN_POOL diff --git a/gfx/layers/d3d11/TextureD3D11.cpp b/gfx/layers/d3d11/TextureD3D11.cpp index cbdfc2bd1276..d3a0b8e0d6e1 100644 --- a/gfx/layers/d3d11/TextureD3D11.cpp +++ b/gfx/layers/d3d11/TextureD3D11.cpp @@ -288,9 +288,7 @@ D3D11TextureData::D3D11TextureData(ID3D11Texture2D* aTexture, : mSize(aSize), mFormat(aFormat), mNeedsClear(aFlags & ALLOC_CLEAR_BUFFER), - mNeedsClearWhite(aFlags & ALLOC_CLEAR_BUFFER_WHITE), mHasSynchronization(HasKeyedMutex(aTexture)), - mIsForOutOfBandContent(aFlags & ALLOC_FOR_OUT_OF_BAND_CONTENT), mTexture(aTexture), mAllocationFlags(aFlags) { MOZ_ASSERT(aTexture); @@ -321,7 +319,7 @@ bool D3D11TextureData::Lock(OpenMode aMode) { return false; } - if (NS_IsMainThread() && !mIsForOutOfBandContent) { + if (NS_IsMainThread()) { if (!PrepareDrawTargetInLock(aMode)) { Unlock(); return false; @@ -334,8 +332,7 @@ bool D3D11TextureData::Lock(OpenMode aMode) { bool D3D11TextureData::PrepareDrawTargetInLock(OpenMode aMode) { // Make sure that successful write-lock means we will have a DrawTarget to // write into. - if (!mDrawTarget && - (aMode & OpenMode::OPEN_WRITE || mNeedsClear || mNeedsClearWhite)) { + if (!mDrawTarget && (aMode & OpenMode::OPEN_WRITE || mNeedsClear)) { mDrawTarget = BorrowDrawTarget(); if (!mDrawTarget) { return false; @@ -349,11 +346,6 @@ bool D3D11TextureData::PrepareDrawTargetInLock(OpenMode aMode) { mDrawTarget->ClearRect(Rect(0, 0, mSize.width, mSize.height)); mNeedsClear = false; } - if (mNeedsClearWhite) { - mDrawTarget->FillRect(Rect(0, 0, mSize.width, mSize.height), - ColorPattern(DeviceColor(1.0, 1.0, 1.0, 1.0))); - mNeedsClearWhite = false; - } return true; } @@ -461,7 +453,7 @@ D3D11TextureData* D3D11TextureData::Create(IntSize aSize, SurfaceFormat aFormat, } newDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED; - if (!NS_IsMainThread() || !!(aFlags & ALLOC_FOR_OUT_OF_BAND_CONTENT)) { + if (!NS_IsMainThread()) { // On the main thread we use the syncobject to handle synchronization. if (!(aFlags & ALLOC_MANUAL_SYNCHRONIZATION)) { newDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX; diff --git a/gfx/layers/d3d11/TextureD3D11.h b/gfx/layers/d3d11/TextureD3D11.h index da31251f2896..81576b017209 100644 --- a/gfx/layers/d3d11/TextureD3D11.h +++ b/gfx/layers/d3d11/TextureD3D11.h @@ -124,9 +124,7 @@ class D3D11TextureData final : public TextureData { gfx::YUVColorSpace mYUVColorSpace = gfx::YUVColorSpace::Identity; gfx::ColorRange mColorRange = gfx::ColorRange::LIMITED; bool mNeedsClear = false; - bool mNeedsClearWhite = false; const bool mHasSynchronization; - const bool mIsForOutOfBandContent; RefPtr mTexture; const TextureAllocationFlags mAllocationFlags;