import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 1208661 - Make ContentClient dumping play nicely with HTML dumping. r=BenWa (18b2c4a11b)
- Bug 1204895 - Add fence handling to AutoRemoveTexture on gonk r=nical (d1f21e0210)
- Bug 1208661 - Support dumping client-side layer textures without compression. r=BenWa (22ee0a45b5)
- Bug 1206915 - Avoid reordering of different parts of paint dump output. r=mattwoodrow (0c7d46bca1)
- Bug 1208661 - Do not assume that PaintRoot()'s contributions to the HTML paint dump will all be inside a <script> tag. r=BenWa (5917d13001)
- Bug 1203992 - Distinguish between SingleTiledContentClient and MultiTiledContentClient in the layer tree dump. r=nical (70955c53cc)
- Bug 1207590 - Don't use SingleTiledContentClient for layers that are larger than the maximum texture size. r=mattwoodrow (dd2a094297)
- Bug 1201541 - Use SingleTiledContentClient for non-scrollable layers on Android r=mattwoodrow (6010b5080d)
- missing of Bug 1161662 - Exclude post scale from layer.GetTransform(). r=roc (a3c92f89ae)
- Bug 1172537 - Make the warning: "Tiled PaintedLayer with no scrollable container ancestor" occur only on actual b2g phones. r=nical (d604c9e9da)
- Bug 1204597 - Use Move constructor for opaque region in FrameLayerBuilder instead of copying. r=jrmuizel (26bf99c0fb)
- Bug 1201541 - Add a pref for disabling single tile layers r=mattwoodrow (e3170f8f4c)
- Bug 1172719 - Fix SharedSurface fence handling on gonk r=jgilbert,nical (9fdf5fef4f)
- Support all blend modes in the basic compositor. (bug 1203829 part 1, r=mattwoodrow) (ac9eeca118)
- Compile shaders with newer fxc. (bug 1203829 part 2, r=mattwoodrow) (3fd4acc1ec)
- Refactor shader initialization in CompositorD3D11. (bug 1203829 part 3, r=mattwoodrow) (a5e79828ad)
- Handle screen and multiply blend modes in the D3D11 compositor. (bug 1203829 part 4, r=mattwoodrow) (b20c4af7fc)
- Bug 1173107: Add hexa() around various hr logging. r=jrmuizel a=KWierso (76d6d27ff9)
- Get the sync texture's sync handle during compositor initialization, where it can be made to fail gracefully. (bug 1207665 part 3, r=bas) (98d15069a0)
- Log initialization failures in CompositorD3D11.cpp. (bug 1211109 part 1, r=mattwoodrow) (211725e4ce)
- Don't use Direct2D if CompositorD3D11::Initialize fails. (bug 1208638, r=jrmuizel) (17a119bc1a)
- Bug 1143653 - Typo fix in a variable name. r=me (469e89d0b6)
- Remove the static compositor backend variable. (bug 1211109 part 2, r=mattwoodrow) (3b7dcb9a7c)
- Allow top-level window changes to the remembered compositor type. (bug 1211109 part 3, r=mattwoodrow) (9309cdfd0f)
- Remove ISurfaceAllocator::GetCompositorBackend. (bug 1211109 part 4, r=mattwoodrow) (2928f757c8)
- Bug 1143653 - Backout part of the initial patch because of crashes. (33637851d4)
- missing bit of 687388 (19770529ef)
- Bug 1208071 - Ensure that only valid texture actors are added to ImageBridge tarnsactions. r=sotaro (23bef4f601)
- Bug 1197534 - Send RecycleTexture messages from the ImageBridge thread. r=sotaro (7249beb404)
This commit is contained in:
2022-09-23 09:35:49 +08:00
parent e1776c67f8
commit 7f6fda62d8
72 changed files with 2018 additions and 707 deletions
+12 -9
View File
@@ -198,6 +198,11 @@ TextureClient::AsTextureClient(PTextureChild* actor)
return actor ? static_cast<TextureChild*>(actor)->mTextureClient : nullptr;
}
bool
TextureClient::IsSharedWithCompositor() const {
return mShared && mActor && mActor->IPCOpen();
}
void
TextureClient::AddFlags(TextureFlags aFlags)
{
@@ -224,7 +229,6 @@ void
TextureClient::RecycleTexture(TextureFlags aFlags)
{
MOZ_ASSERT(GetFlags() & TextureFlags::RECYCLE);
MOZ_ASSERT(!HasRecycleCallback());
mAddedToCompositableClient = false;
if (mFlags != aFlags) {
@@ -281,7 +285,7 @@ TextureClient::InitIPDLActor(CompositableForwarder* aForwarder)
return false;
}
mActor = static_cast<TextureChild*>(aForwarder->CreateTexture(desc, GetFlags()));
mActor = static_cast<TextureChild*>(aForwarder->CreateTexture(desc, aForwarder->GetCompositorBackendType(), GetFlags()));
MOZ_ASSERT(mActor);
mActor->mForwarder = aForwarder;
mActor->mTextureClient = this;
@@ -339,13 +343,13 @@ CreateBufferTextureClient(ISurfaceAllocator* aAllocator,
}
static inline gfx::BackendType
BackendTypeForBackendSelector(BackendSelector aSelector)
BackendTypeForBackendSelector(LayersBackend aLayersBackend, BackendSelector aSelector)
{
switch (aSelector) {
case BackendSelector::Canvas:
return gfxPlatform::GetPlatform()->GetPreferredCanvasBackend();
case BackendSelector::Content:
return gfxPlatform::GetPlatform()->GetContentBackend();
return gfxPlatform::GetPlatform()->GetContentBackendFor(aLayersBackend);
default:
MOZ_ASSERT_UNREACHABLE("Unknown backend selector");
return gfx::BackendType::NONE;
@@ -354,14 +358,15 @@ BackendTypeForBackendSelector(BackendSelector aSelector)
// static
already_AddRefed<TextureClient>
TextureClient::CreateForDrawing(ISurfaceAllocator* aAllocator,
TextureClient::CreateForDrawing(CompositableForwarder* aAllocator,
gfx::SurfaceFormat aFormat,
gfx::IntSize aSize,
BackendSelector aSelector,
TextureFlags aTextureFlags,
TextureAllocationFlags aAllocFlags)
{
gfx::BackendType moz2DBackend = BackendTypeForBackendSelector(aSelector);
LayersBackend parentBackend = aAllocator->GetCompositorBackendType();
gfx::BackendType moz2DBackend = BackendTypeForBackendSelector(parentBackend, aSelector);
if (!gfx::Factory::AllowedSurfaceSize(aSize)) {
return nullptr;
@@ -374,7 +379,6 @@ TextureClient::CreateForDrawing(ISurfaceAllocator* aAllocator,
#endif
#ifdef XP_WIN
LayersBackend parentBackend = aAllocator->GetCompositorBackendType();
if (parentBackend == LayersBackend::LAYERS_D3D11 &&
(moz2DBackend == gfx::BackendType::DIRECT2D ||
moz2DBackend == gfx::BackendType::DIRECT2D1_1) &&
@@ -407,7 +411,6 @@ TextureClient::CreateForDrawing(ISurfaceAllocator* aAllocator,
#endif
#ifdef MOZ_X11
LayersBackend parentBackend = aAllocator->GetCompositorBackendType();
gfxSurfaceType type =
gfxPlatform::GetPlatform()->ScreenReferenceSurface()->GetType();
@@ -652,7 +655,7 @@ TextureClient::ShouldDeallocateInDestructor() const
// but we haven't been shared yet or
// TextureFlags::DEALLOCATE_CLIENT is set, then we should
// deallocate on the client instead.
return !IsSharedWithCompositor() || (GetFlags() & TextureFlags::DEALLOCATE_CLIENT);
return !mShared || (GetFlags() & TextureFlags::DEALLOCATE_CLIENT);
}
void