зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1743930
- Remove unused TextureAllocationFlags flag handling r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D132648
This commit is contained in:
Родитель
deafabcff7
Коммит
639a9cd58e
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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> 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> TextureClient::CreateForRawBufferAccess(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if (aAllocFlags & ALLOC_DISALLOW_BUFFERTEXTURECLIENT) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!gfx::Factory::AllowedSurfaceSize(aSize)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<ID3D11Texture2D> mTexture;
|
||||
const TextureAllocationFlags mAllocationFlags;
|
||||
|
|
Загрузка…
Ссылка в новой задаче