summaryrefslogtreecommitdiff
path: root/gfx/layers
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-03-10 18:58:26 +0000
committerMoonchild <moonchild@palemoon.org>2021-03-10 18:58:26 +0000
commitbf9a812c8d5721f73b76f698755a2f60cf58ac0c (patch)
treec291e0ee9c44ec2c1fa2b1a56782cd630c571469 /gfx/layers
parent0e882ce31618f598ce4ab2499a4920d8bd04c1bb (diff)
downloadaura-central-bf9a812c8d5721f73b76f698755a2f60cf58ac0c.tar.gz
Issue mcp-graveyard/UXP%1053 - Remove mobile-specific graphics "optimizations" (=compromises)
Diffstat (limited to 'gfx/layers')
-rw-r--r--gfx/layers/Layers.cpp4
-rw-r--r--gfx/layers/RotatedBuffer.cpp12
-rw-r--r--gfx/layers/client/ClientPaintedLayer.cpp2
-rw-r--r--gfx/layers/client/ClientTiledPaintedLayer.cpp2
-rw-r--r--gfx/layers/client/TiledContentClient.cpp13
-rw-r--r--gfx/layers/composite/ContentHost.cpp4
-rw-r--r--gfx/layers/composite/TiledContentHost.cpp2
7 files changed, 0 insertions, 39 deletions
diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp
index 482d809a1..991e8ed2f 100644
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -1399,11 +1399,7 @@ ContainerLayer::DefaultComputeEffectiveTransforms(const Matrix4x4& aTransformToS
checkClipRect = true;
checkMaskLayers = true;
} else {
-#ifdef MOZ_GFX_OPTIMIZE_MOBILE
- if (!contTransform.PreservesAxisAlignedRectangles()) {
-#else
if (gfx::ThebesMatrix(contTransform).HasNonIntegerTranslation()) {
-#endif
checkClipRect = true;
}
/* In 2D case, only translation and/or positive scaling can be done w/o using IntermediateSurface.
diff --git a/gfx/layers/RotatedBuffer.cpp b/gfx/layers/RotatedBuffer.cpp
index 92252fb04..f0114bddf 100644
--- a/gfx/layers/RotatedBuffer.cpp
+++ b/gfx/layers/RotatedBuffer.cpp
@@ -139,21 +139,13 @@ RotatedBuffer::DrawBufferQuadrant(gfx::DrawTarget* aTarget,
transform *= oldTransform;
transform *= inverseMask;
-#ifdef MOZ_GFX_OPTIMIZE_MOBILE
- SurfacePattern source(snapshot, ExtendMode::CLAMP, transform, SamplingFilter::POINT);
-#else
SurfacePattern source(snapshot, ExtendMode::CLAMP, transform);
-#endif
aTarget->SetTransform(*aMaskTransform);
aTarget->MaskSurface(source, aMask, Point(0, 0), DrawOptions(aOpacity, aOperator));
aTarget->SetTransform(oldTransform);
} else {
-#ifdef MOZ_GFX_OPTIMIZE_MOBILE
- DrawSurfaceOptions options(SamplingFilter::POINT);
-#else
DrawSurfaceOptions options;
-#endif
aTarget->DrawSurface(snapshot, IntRectToRect(fillRect),
GetSourceRectangle(aXSide, aYSide),
options,
@@ -466,9 +458,6 @@ RotatedContentBuffer::BeginPaint(PaintedLayer* aLayer,
}
if (mode == SurfaceMode::SURFACE_COMPONENT_ALPHA) {
-#if defined(MOZ_GFX_OPTIMIZE_MOBILE)
- mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
-#else
if (!aLayer->GetParent() ||
!aLayer->GetParent()->SupportsComponentAlphaChildren() ||
!aLayer->AsShadowableLayer() ||
@@ -477,7 +466,6 @@ RotatedContentBuffer::BeginPaint(PaintedLayer* aLayer,
} else {
result.mContentType = gfxContentType::COLOR;
}
-#endif
}
if ((aFlags & PAINT_WILL_RESAMPLE) &&
diff --git a/gfx/layers/client/ClientPaintedLayer.cpp b/gfx/layers/client/ClientPaintedLayer.cpp
index 871f10559..150eadebf 100644
--- a/gfx/layers/client/ClientPaintedLayer.cpp
+++ b/gfx/layers/client/ClientPaintedLayer.cpp
@@ -39,7 +39,6 @@ ClientPaintedLayer::PaintThebes()
"Can only draw in drawing phase");
uint32_t flags = RotatedContentBuffer::PAINT_CAN_DRAW_ROTATED;
-#ifndef MOZ_IGNORE_PAINT_WILL_RESAMPLE
if (ClientManager()->CompositorMightResample()) {
flags |= RotatedContentBuffer::PAINT_WILL_RESAMPLE;
}
@@ -48,7 +47,6 @@ ClientPaintedLayer::PaintThebes()
flags |= RotatedContentBuffer::PAINT_WILL_RESAMPLE;
}
}
-#endif
PaintState state =
mContentClient->BeginPaintBuffer(this, flags);
mValidRegion.Sub(mValidRegion, state.mRegionToInvalidate);
diff --git a/gfx/layers/client/ClientTiledPaintedLayer.cpp b/gfx/layers/client/ClientTiledPaintedLayer.cpp
index 599fb972c..8936dad8f 100644
--- a/gfx/layers/client/ClientTiledPaintedLayer.cpp
+++ b/gfx/layers/client/ClientTiledPaintedLayer.cpp
@@ -462,7 +462,6 @@ ClientTiledPaintedLayer::RenderLayer()
TILING_LOG("TILING %p: Initial low-precision valid region %s\n", this, Stringify(mLowPrecisionValidRegion).c_str());
nsIntRegion neededRegion = mVisibleRegion.ToUnknownRegion();
-#ifndef MOZ_IGNORE_PAINT_WILL_RESAMPLE
// This is handled by PadDrawTargetOutFromRegion in TiledContentClient for mobile
if (MayResample()) {
// If we're resampling then bilinear filtering can read up to 1 pixel
@@ -477,7 +476,6 @@ ClientTiledPaintedLayer::RenderLayer()
padded.IntersectRect(padded, wholeTiles);
neededRegion = padded;
}
-#endif
nsIntRegion invalidRegion;
invalidRegion.Sub(neededRegion, mValidRegion);
diff --git a/gfx/layers/client/TiledContentClient.cpp b/gfx/layers/client/TiledContentClient.cpp
index 164e76da8..5dad3ec65 100644
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -308,30 +308,17 @@ ClientTiledLayerBuffer::GetContentType(SurfaceMode* aMode) const
SurfaceMode mode = mPaintedLayer.GetSurfaceMode();
if (mode == SurfaceMode::SURFACE_COMPONENT_ALPHA) {
-#if defined(MOZ_GFX_OPTIMIZE_MOBILE)
- mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
-#else
if (!mPaintedLayer.GetParent() ||
!mPaintedLayer.GetParent()->SupportsComponentAlphaChildren()) {
mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
} else {
content = gfxContentType::COLOR;
}
-#endif
} else if (mode == SurfaceMode::SURFACE_OPAQUE) {
-#if defined(MOZ_GFX_OPTIMIZE_MOBILE)
- if (IsLowPrecision()) {
- // If we're in low-res mode, drawing can sample from outside the visible
- // region. Make sure that we only sample transparency if that happens.
- mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
- content = gfxContentType::COLOR_ALPHA;
- }
-#else
if (mPaintedLayer.MayResample()) {
mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
content = gfxContentType::COLOR_ALPHA;
}
-#endif
}
if (aMode) {
diff --git a/gfx/layers/composite/ContentHost.cpp b/gfx/layers/composite/ContentHost.cpp
index b1d92a6c9..86d33fdb6 100644
--- a/gfx/layers/composite/ContentHost.cpp
+++ b/gfx/layers/composite/ContentHost.cpp
@@ -71,7 +71,6 @@ ContentHostTexture::Composite(LayerComposite* aLayer,
nsIntRegion tmpRegion;
const nsIntRegion* renderRegion;
-#ifndef MOZ_IGNORE_PAINT_WILL_RESAMPLE
if (PaintWillResample()) {
// If we're resampling, then the texture image will contain exactly the
// entire visible region's bounds, and we should draw it all in one quad
@@ -81,9 +80,6 @@ ContentHostTexture::Composite(LayerComposite* aLayer,
} else {
renderRegion = aVisibleRegion;
}
-#else
- renderRegion = aVisibleRegion;
-#endif
nsIntRegion region(*renderRegion);
nsIntPoint origin = GetOriginOffset();
diff --git a/gfx/layers/composite/TiledContentHost.cpp b/gfx/layers/composite/TiledContentHost.cpp
index 7458c7497..a80c47fb9 100644
--- a/gfx/layers/composite/TiledContentHost.cpp
+++ b/gfx/layers/composite/TiledContentHost.cpp
@@ -425,7 +425,6 @@ TiledContentHost::Composite(LayerComposite* aLayer,
nsIntRegion tmpRegion;
const nsIntRegion* renderRegion = aVisibleRegion;
-#ifndef MOZ_IGNORE_PAINT_WILL_RESAMPLE
if (PaintWillResample()) {
// If we're resampling, then the texture image will contain exactly the
// entire visible region's bounds, and we should draw it all in one quad
@@ -433,7 +432,6 @@ TiledContentHost::Composite(LayerComposite* aLayer,
tmpRegion = aVisibleRegion->GetBounds();
renderRegion = &tmpRegion;
}
-#endif
// Render the low and high precision buffers.
RenderLayerBuffer(mLowPrecisionTiledBuffer,