зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1732227 - Remove unused layers.componentalpha.enabled pref. r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D126446
This commit is contained in:
Родитель
aaa5db6f30
Коммит
c826c6f392
|
@ -96,21 +96,6 @@ already_AddRefed<ImageContainer> LayerManager::CreateImageContainer(
|
|||
return container.forget();
|
||||
}
|
||||
|
||||
bool LayerManager::LayersComponentAlphaEnabled() {
|
||||
// If MOZ_GFX_OPTIMIZE_MOBILE is defined, we force component alpha off
|
||||
// and ignore the preference.
|
||||
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
|
||||
return false;
|
||||
#else
|
||||
return StaticPrefs::
|
||||
layers_componentalpha_enabled_AtStartup_DoNotUseDirectly();
|
||||
#endif
|
||||
}
|
||||
|
||||
bool LayerManager::AreComponentAlphaLayersEnabled() {
|
||||
return LayerManager::LayersComponentAlphaEnabled();
|
||||
}
|
||||
|
||||
/*static*/
|
||||
void LayerManager::LayerUserDataDestroy(void* data) {
|
||||
delete static_cast<LayerUserData*>(data);
|
||||
|
|
|
@ -239,19 +239,6 @@ class LayerManager : public WindowRenderer {
|
|||
const nsTArray<nsIWidget::Configuration>& aConfigurations) {}
|
||||
bool IsSnappingEffectiveTransforms() { return mSnapEffectiveTransforms; }
|
||||
|
||||
/**
|
||||
* Returns true if the underlying platform can properly support layers with
|
||||
* SurfaceMode::SURFACE_COMPONENT_ALPHA.
|
||||
*/
|
||||
static bool LayersComponentAlphaEnabled();
|
||||
|
||||
/**
|
||||
* Returns true if this LayerManager can properly support layers with
|
||||
* SurfaceMode::SURFACE_COMPONENT_ALPHA. LayerManagers that can't will use
|
||||
* transparent surfaces (and lose subpixel-AA for text).
|
||||
*/
|
||||
virtual bool AreComponentAlphaLayersEnabled();
|
||||
|
||||
/**
|
||||
* Returns true if this LayerManager always requires an intermediate surface
|
||||
* to render blend operations.
|
||||
|
|
|
@ -540,7 +540,6 @@ ContainerLayer::ContainerLayer(LayerManager* aManager, void* aImplData)
|
|||
mInheritedYScale(1.0f),
|
||||
mPresShellResolution(1.0f),
|
||||
mUseIntermediateSurface(false),
|
||||
mSupportsComponentAlphaChildren(false),
|
||||
mMayHaveReadbackChild(false),
|
||||
mChildrenChanged(false) {}
|
||||
|
||||
|
@ -993,45 +992,6 @@ void ContainerLayer::DefaultComputeEffectiveTransforms(
|
|||
ComputeEffectiveTransformForMaskLayers(aTransformToSurface);
|
||||
}
|
||||
|
||||
void ContainerLayer::DefaultComputeSupportsComponentAlphaChildren(
|
||||
bool* aNeedsSurfaceCopy) {
|
||||
if (!(GetContentFlags() & Layer::CONTENT_COMPONENT_ALPHA_DESCENDANT) ||
|
||||
!Manager()->AreComponentAlphaLayersEnabled()) {
|
||||
mSupportsComponentAlphaChildren = false;
|
||||
if (aNeedsSurfaceCopy) {
|
||||
*aNeedsSurfaceCopy = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
mSupportsComponentAlphaChildren = false;
|
||||
bool needsSurfaceCopy = false;
|
||||
CompositionOp blendMode = GetEffectiveMixBlendMode();
|
||||
if (UseIntermediateSurface()) {
|
||||
if (GetLocalVisibleRegion().GetNumRects() == 1 &&
|
||||
(GetContentFlags() & Layer::CONTENT_OPAQUE)) {
|
||||
mSupportsComponentAlphaChildren = true;
|
||||
} else {
|
||||
gfx::Matrix transform;
|
||||
if (HasOpaqueAncestorLayer(this) &&
|
||||
GetEffectiveTransform().Is2D(&transform) &&
|
||||
!gfx::ThebesMatrix(transform).HasNonIntegerTranslation() &&
|
||||
blendMode == gfx::CompositionOp::OP_OVER) {
|
||||
mSupportsComponentAlphaChildren = true;
|
||||
needsSurfaceCopy = true;
|
||||
}
|
||||
}
|
||||
} else if (blendMode == gfx::CompositionOp::OP_OVER) {
|
||||
mSupportsComponentAlphaChildren =
|
||||
(GetContentFlags() & Layer::CONTENT_OPAQUE) ||
|
||||
(GetParent() && GetParent()->SupportsComponentAlphaChildren());
|
||||
}
|
||||
|
||||
if (aNeedsSurfaceCopy) {
|
||||
*aNeedsSurfaceCopy = mSupportsComponentAlphaChildren && needsSurfaceCopy;
|
||||
}
|
||||
}
|
||||
|
||||
void ContainerLayer::ComputeEffectiveTransformsForChildren(
|
||||
const Matrix4x4& aTransformToSurface) {
|
||||
for (Layer* l = mFirstChild; l; l = l->GetNextSibling()) {
|
||||
|
@ -1039,14 +999,6 @@ void ContainerLayer::ComputeEffectiveTransformsForChildren(
|
|||
}
|
||||
}
|
||||
|
||||
/* static */
|
||||
bool ContainerLayer::HasOpaqueAncestorLayer(Layer* aLayer) {
|
||||
for (Layer* l = aLayer->GetParent(); l; l = l->GetParent()) {
|
||||
if (l->GetContentFlags() & Layer::CONTENT_OPAQUE) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Note that ContainerLayer::RemoveAllChildren contains an optimized
|
||||
// version of this code; if you make changes to ContainerLayer::DidRemoveChild
|
||||
// consider whether the matching changes need to be made to
|
||||
|
|
|
@ -151,12 +151,6 @@ class Layer {
|
|||
*/
|
||||
CONTENT_COMPONENT_ALPHA = 0x02,
|
||||
|
||||
/**
|
||||
* If this is set then one of the descendant layers of this one has
|
||||
* CONTENT_COMPONENT_ALPHA set.
|
||||
*/
|
||||
CONTENT_COMPONENT_ALPHA_DESCENDANT = 0x04,
|
||||
|
||||
/**
|
||||
* If this is set then this layer is part of a preserve-3d group, and should
|
||||
* be sorted with sibling layers that are also part of the same group.
|
||||
|
@ -1482,20 +1476,6 @@ class ContainerLayer : public Layer {
|
|||
*/
|
||||
bool HasMultipleChildren();
|
||||
|
||||
/**
|
||||
* Returns true if this container supports children with component alpha.
|
||||
* Should only be called while painting a child of this layer.
|
||||
*/
|
||||
bool SupportsComponentAlphaChildren() {
|
||||
return mSupportsComponentAlphaChildren;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if aLayer or any layer in its parent chain has the opaque
|
||||
* content flag set.
|
||||
*/
|
||||
static bool HasOpaqueAncestorLayer(Layer* aLayer);
|
||||
|
||||
void SetChildrenChanged(bool aVal) { mChildrenChanged = aVal; }
|
||||
|
||||
// If |aRect| is null, the entire layer should be considered invalid for
|
||||
|
@ -1547,17 +1527,6 @@ class ContainerLayer : public Layer {
|
|||
void DefaultComputeEffectiveTransforms(
|
||||
const gfx::Matrix4x4& aTransformToSurface);
|
||||
|
||||
/**
|
||||
* A default implementation to compute and set the value for
|
||||
* SupportsComponentAlphaChildren().
|
||||
*
|
||||
* If aNeedsSurfaceCopy is provided, then it is set to true if the caller
|
||||
* needs to copy the background up into the intermediate surface created,
|
||||
* false otherwise.
|
||||
*/
|
||||
void DefaultComputeSupportsComponentAlphaChildren(
|
||||
bool* aNeedsSurfaceCopy = nullptr);
|
||||
|
||||
/**
|
||||
* Loops over the children calling ComputeEffectiveTransforms on them.
|
||||
*/
|
||||
|
@ -1585,7 +1554,6 @@ class ContainerLayer : public Layer {
|
|||
// associated pres shell; for other layers, 1.0.
|
||||
float mPresShellResolution;
|
||||
bool mUseIntermediateSurface;
|
||||
bool mSupportsComponentAlphaChildren;
|
||||
bool mMayHaveReadbackChild;
|
||||
// This is updated by ComputeDifferences. This will be true if we need to
|
||||
// invalidate the intermediate surface.
|
||||
|
|
|
@ -6332,20 +6332,6 @@
|
|||
value: true
|
||||
mirror: always
|
||||
|
||||
- name: layers.componentalpha.enabled
|
||||
type: bool
|
||||
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
|
||||
# Nb: we ignore this pref if MOZ_GFX_OPTIMIZE_MOBILE is defined, as if this
|
||||
# pref was always false. But we go to the effort of setting it to false so
|
||||
# that telemetry's reporting of the pref value is more likely to reflect what
|
||||
# the code is doing.
|
||||
value: false
|
||||
#else
|
||||
value: true
|
||||
#endif
|
||||
mirror: once
|
||||
do_not_use_directly: true
|
||||
|
||||
- name: layers.d3d11.force-warp
|
||||
type: bool
|
||||
value: false
|
||||
|
|
|
@ -300,7 +300,6 @@ const DEFAULT_ENVIRONMENT_PREFS = new Map([
|
|||
["layers.async-pan-zoom.enabled", { what: RECORD_PREF_VALUE }],
|
||||
["layers.async-video-oop.enabled", { what: RECORD_PREF_VALUE }],
|
||||
["layers.async-video.enabled", { what: RECORD_PREF_VALUE }],
|
||||
["layers.componentalpha.enabled", { what: RECORD_PREF_VALUE }],
|
||||
["layers.d3d11.disable-warp", { what: RECORD_PREF_VALUE }],
|
||||
["layers.d3d11.force-warp", { what: RECORD_PREF_VALUE }],
|
||||
[
|
||||
|
|
Загрузка…
Ссылка в новой задаче