diff options
author | Moonchild <moonchild@palemoon.org> | 2021-03-10 18:58:26 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-03-10 18:58:26 +0000 |
commit | 515c1193c5663e46a313acb7a39ed2f3d209f69e (patch) | |
tree | c291e0ee9c44ec2c1fa2b1a56782cd630c571469 /gfx/layers | |
parent | 108ec40998d1b571f073d1e57de5fbf368bfe17c (diff) | |
download | uxp-515c1193c5663e46a313acb7a39ed2f3d209f69e.tar.gz |
Issue #1053 - Remove mobile-specific graphics "optimizations" (=compromises)
Diffstat (limited to 'gfx/layers')
-rw-r--r-- | gfx/layers/Layers.cpp | 4 | ||||
-rw-r--r-- | gfx/layers/RotatedBuffer.cpp | 12 | ||||
-rw-r--r-- | gfx/layers/client/ClientPaintedLayer.cpp | 2 | ||||
-rw-r--r-- | gfx/layers/client/ClientTiledPaintedLayer.cpp | 2 | ||||
-rw-r--r-- | gfx/layers/client/TiledContentClient.cpp | 13 | ||||
-rw-r--r-- | gfx/layers/composite/ContentHost.cpp | 4 | ||||
-rw-r--r-- | gfx/layers/composite/TiledContentHost.cpp | 2 |
7 files changed, 0 insertions, 39 deletions
diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index 482d809a1f..991e8ed2f0 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 92252fb044..f0114bddf5 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 871f10559b..150eadebf2 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 599fb972c4..8936dad8fe 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 164e76da8c..5dad3ec65e 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 b1d92a6c9e..86d33fdb64 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 7458c74971..a80c47fb98 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, |