Bug 1406231 - remove the TextLayer class, and all remaining traces of it. r?mattwoodrow draft
authorAlexis Beingessner <a.beingessner@gmail.com>
Thu, 07 Dec 2017 17:13:05 -0500
changeset 715489 5e9ee7bdc25ec15785dbd4ad1d70b292fc4ba48d
parent 715488 d382313f3e5b26e4863cabf38c18876171f4fb4d
child 744802 b0b8f224295d2839cc20c3b945f6f6cde945f39b
push id94169
push userbmo:a.beingessner@gmail.com
push dateThu, 04 Jan 2018 00:11:26 +0000
reviewersmattwoodrow
bugs1406231
milestone59.0a1
Bug 1406231 - remove the TextLayer class, and all remaining traces of it. r?mattwoodrow MozReview-Commit-ID: 5fmKfkO6hnO
gfx/layers/LayerTreeInvalidation.cpp
gfx/layers/Layers.cpp
gfx/layers/Layers.h
gfx/layers/basic/BasicLayers.h
gfx/layers/basic/BasicTextLayer.cpp
gfx/layers/client/ClientLayerManager.h
gfx/layers/client/ClientTextLayer.cpp
gfx/layers/composite/LayerManagerComposite.cpp
gfx/layers/composite/LayerManagerComposite.h
gfx/layers/ipc/LayerTransactionParent.cpp
gfx/layers/ipc/LayersMessages.ipdlh
gfx/layers/ipc/ShadowLayers.cpp
gfx/layers/ipc/ShadowLayers.h
gfx/layers/mlgpu/LayerManagerMLGPU.cpp
gfx/layers/mlgpu/LayerManagerMLGPU.h
gfx/layers/moz.build
gfx/layers/protobuf/LayerScopePacket.pb.cc
gfx/layers/protobuf/LayerScopePacket.pb.h
gfx/layers/protobuf/LayerScopePacket.proto
gfx/layers/wr/ScrollingLayersHelper.h
gfx/layers/wr/WebRenderLayerManager.h
gfx/tests/gtest/TestLayers.cpp
gfx/thebes/gfxPrefs.h
layout/generic/TextOverflow.cpp
layout/generic/nsTextFrame.cpp
modules/libpref/init/all.js
--- a/gfx/layers/LayerTreeInvalidation.cpp
+++ b/gfx/layers/LayerTreeInvalidation.cpp
@@ -646,59 +646,16 @@ public:
   }
 
   BorderColors mColors;
   LayerRect mRect;
   BorderCorners mCorners;
   BorderWidths mWidths;
 };
 
-struct TextLayerProperties : public LayerPropertiesBase
-{
-  explicit TextLayerProperties(TextLayer *aLayer)
-    : LayerPropertiesBase(aLayer)
-    , mBounds(aLayer->GetBounds())
-    , mGlyphs(aLayer->GetGlyphs())
-    , mFont(aLayer->GetScaledFont())
-  { }
-
-protected:
-  TextLayerProperties(const TextLayerProperties& a) = delete;
-  TextLayerProperties& operator=(const TextLayerProperties& a) = delete;
-
-public:
-  bool ComputeChangeInternal(const char* aPrefix,
-                             nsIntRegion& aOutRegion,
-                             NotifySubDocInvalidationFunc aCallback) override
-  {
-    TextLayer* text = static_cast<TextLayer*>(mLayer.get());
-
-    if (!text->GetLocalVisibleRegion().ToUnknownRegion().IsEqual(mVisibleRegion)) {
-      IntRect result = NewTransformedBoundsForLeaf();
-      result = result.Union(OldTransformedBoundsForLeaf());
-      aOutRegion = result;
-      return true;
-    }
-
-    if (!mBounds.IsEqualEdges(text->GetBounds()) ||
-        mGlyphs != text->GetGlyphs() ||
-        mFont != text->GetScaledFont()) {
-      LTI_DUMP(NewTransformedBoundsForLeaf(), "bounds");
-      aOutRegion = NewTransformedBoundsForLeaf();
-      return true;
-    }
-
-    return true;
-  }
-
-  gfx::IntRect mBounds;
-  nsTArray<GlyphArray> mGlyphs;
-  gfx::ScaledFont* mFont;
-};
-
 static ImageHost* GetImageHost(Layer* aLayer)
 {
   HostLayer* compositor = aLayer->AsHostLayer();
   if (compositor) {
     return static_cast<ImageHost*>(compositor->GetCompositableHost());
   }
   return nullptr;
 }
@@ -825,18 +782,16 @@ CloneLayerTreePropertiesInternal(Layer* 
     case Layer::TYPE_COLOR:
       return MakeUnique<ColorLayerProperties>(static_cast<ColorLayer*>(aRoot));
     case Layer::TYPE_IMAGE:
       return MakeUnique<ImageLayerProperties>(static_cast<ImageLayer*>(aRoot), aIsMask);
     case Layer::TYPE_CANVAS:
       return MakeUnique<CanvasLayerProperties>(static_cast<CanvasLayer*>(aRoot));
     case Layer::TYPE_BORDER:
       return MakeUnique<BorderLayerProperties>(static_cast<BorderLayer*>(aRoot));
-    case Layer::TYPE_TEXT:
-      return MakeUnique<TextLayerProperties>(static_cast<TextLayer*>(aRoot));
     case Layer::TYPE_DISPLAYITEM:
     case Layer::TYPE_READBACK:
     case Layer::TYPE_SHADOW:
     case Layer::TYPE_PAINTED:
       return MakeUnique<LayerPropertiesBase>(aRoot);
   }
 
   MOZ_ASSERT_UNREACHABLE("Unexpected root layer type");
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -2115,33 +2115,16 @@ ColorLayer::DumpPacket(layerscope::Layer
   // Get this layer data
   using namespace layerscope;
   LayersPacket::Layer* layer = aPacket->mutable_layer(aPacket->layer_size()-1);
   layer->set_type(LayersPacket::Layer::ColorLayer);
   layer->set_color(mColor.ToABGR());
 }
 
 void
-TextLayer::PrintInfo(std::stringstream& aStream, const char* aPrefix)
-{
-  Layer::PrintInfo(aStream, aPrefix);
-  AppendToString(aStream, mBounds, " [bounds=", "]");
-}
-
-void
-TextLayer::DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent)
-{
-  Layer::DumpPacket(aPacket, aParent);
-  // Get this layer data
-  using namespace layerscope;
-  LayersPacket::Layer* layer = aPacket->mutable_layer(aPacket->layer_size()-1);
-  layer->set_type(LayersPacket::Layer::TextLayer);
-}
-
-void
 BorderLayer::PrintInfo(std::stringstream& aStream, const char* aPrefix)
 {
   Layer::PrintInfo(aStream, aPrefix);
 }
 
 void
 BorderLayer::DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent)
 {
@@ -2480,25 +2463,10 @@ SetAntialiasingFlags(Layer* aLayer, Draw
 }
 
 IntRect
 ToOutsideIntRect(const gfxRect &aRect)
 {
   return IntRect::RoundOut(aRect.X(), aRect.Y(), aRect.Width(), aRect.Height());
 }
 
-TextLayer::TextLayer(LayerManager* aManager, void* aImplData)
-  : Layer(aManager, aImplData)
-{}
-
-TextLayer::~TextLayer()
-{}
-
-void
-TextLayer::SetGlyphs(nsTArray<GlyphArray>&& aGlyphs)
-{
-  MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) Glyphs", this));
-  mGlyphs = Move(aGlyphs);
-  Mutated();
-}
-
 } // namespace layers
 } // namespace mozilla
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -87,17 +87,16 @@ class Layer;
 class LayerMetricsWrapper;
 class PaintedLayer;
 class ContainerLayer;
 class ImageLayer;
 class DisplayItemLayer;
 class ColorLayer;
 class CompositorAnimations;
 class CompositorBridgeChild;
-class TextLayer;
 class CanvasLayer;
 class BorderLayer;
 class ReadbackLayer;
 class ReadbackProcessor;
 class RefLayer;
 class HostLayer;
 class FocusTarget;
 class KnowsCompositor;
@@ -431,21 +430,16 @@ public:
   virtual already_AddRefed<ImageLayer> CreateImageLayer() = 0;
   /**
    * CONSTRUCTION PHASE ONLY
    * Create a ColorLayer for this manager's layer tree.
    */
   virtual already_AddRefed<ColorLayer> CreateColorLayer() = 0;
   /**
    * CONSTRUCTION PHASE ONLY
-   * Create a TextLayer for this manager's layer tree.
-   */
-  virtual already_AddRefed<TextLayer> CreateTextLayer() = 0;
-  /**
-   * CONSTRUCTION PHASE ONLY
    * Create a BorderLayer for this manager's layer tree.
    */
   virtual already_AddRefed<BorderLayer> CreateBorderLayer() = 0;
   /**
    * CONSTRUCTION PHASE ONLY
    * Create a CanvasLayer for this manager's layer tree.
    */
   virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() = 0;
@@ -825,17 +819,16 @@ class Layer {
 public:
   // Keep these in alphabetical order
   enum LayerType {
     TYPE_CANVAS,
     TYPE_COLOR,
     TYPE_CONTAINER,
     TYPE_DISPLAYITEM,
     TYPE_IMAGE,
-    TYPE_TEXT,
     TYPE_BORDER,
     TYPE_READBACK,
     TYPE_REF,
     TYPE_SHADOW,
     TYPE_PAINTED
   };
 
   /**
@@ -1559,22 +1552,16 @@ public:
 
    /**
     * Dynamic cast to a Color. Returns null if this is not a
     * ColorLayer.
     */
   virtual ColorLayer* AsColorLayer() { return nullptr; }
 
   /**
-    * Dynamic cast to a TextLayer. Returns null if this is not a
-    * TextLayer.
-    */
-  virtual TextLayer* AsTextLayer() { return nullptr; }
-
-  /**
     * Dynamic cast to a Border. Returns null if this is not a
     * ColorLayer.
     */
   virtual BorderLayer* AsBorderLayer() { return nullptr; }
 
   /**
     * Dynamic cast to a Canvas. Returns null if this is not a
     * ColorLayer.
@@ -2519,73 +2506,16 @@ protected:
 
   virtual void DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent) override;
 
   gfx::IntRect mBounds;
   gfx::Color mColor;
 };
 
 /**
- * A Layer which renders Glyphs.
- */
-class TextLayer : public Layer {
-public:
-  virtual TextLayer* AsTextLayer() override { return this; }
-
-  /**
-   * CONSTRUCTION PHASE ONLY
-   */
-  void SetBounds(const gfx::IntRect& aBounds)
-  {
-    if (!mBounds.IsEqualEdges(aBounds)) {
-      mBounds = aBounds;
-      Mutated();
-    }
-  }
-
-  const gfx::IntRect& GetBounds()
-  {
-    return mBounds;
-  }
-
-  void SetScaledFont(gfx::ScaledFont* aScaledFont) {
-    if (aScaledFont != mFont) {
-      mFont = aScaledFont;
-      Mutated();
-    }
-  }
-
-  const nsTArray<GlyphArray>& GetGlyphs() { return mGlyphs; }
-
-  gfx::ScaledFont* GetScaledFont() { return mFont; }
-
-  MOZ_LAYER_DECL_NAME("TextLayer", TYPE_TEXT)
-
-  virtual void ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransformToSurface) override
-  {
-    gfx::Matrix4x4 idealTransform = GetLocalTransform() * aTransformToSurface;
-    mEffectiveTransform = SnapTransformTranslation(idealTransform, nullptr);
-    ComputeEffectiveTransformForMaskLayers(aTransformToSurface);
-  }
-
-  virtual void SetGlyphs(nsTArray<GlyphArray>&& aGlyphs);
-protected:
-  TextLayer(LayerManager* aManager, void* aImplData);
-  ~TextLayer();
-
-  virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
-
-  virtual void DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent) override;
-
-  gfx::IntRect mBounds;
-  nsTArray<GlyphArray> mGlyphs;
-  RefPtr<gfx::ScaledFont> mFont;
-};
-
-/**
  * A Layer which renders a rounded rect.
  */
 class BorderLayer : public Layer {
 public:
   virtual BorderLayer* AsBorderLayer() override { return this; }
 
   /**
    * CONSTRUCTION PHASE ONLY
--- a/gfx/layers/basic/BasicLayers.h
+++ b/gfx/layers/basic/BasicLayers.h
@@ -112,17 +112,16 @@ public:
 
   virtual void SetRoot(Layer* aLayer) override;
 
   virtual already_AddRefed<PaintedLayer> CreatePaintedLayer() override;
   virtual already_AddRefed<ContainerLayer> CreateContainerLayer() override;
   virtual already_AddRefed<ImageLayer> CreateImageLayer() override;
   virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() override;
   virtual already_AddRefed<ColorLayer> CreateColorLayer() override;
-  virtual already_AddRefed<TextLayer> CreateTextLayer() override;
   virtual already_AddRefed<BorderLayer> CreateBorderLayer() override;
   virtual already_AddRefed<ReadbackLayer> CreateReadbackLayer() override;
   virtual already_AddRefed<DisplayItemLayer> CreateDisplayItemLayer() override;
   virtual ImageFactory *GetImageFactory();
 
   virtual LayersBackend GetBackendType() override { return LayersBackend::LAYERS_BASIC; }
   virtual void GetBackendName(nsAString& name) override { name.AssignLiteral("Basic"); }
 
deleted file mode 100644
--- a/gfx/layers/basic/BasicTextLayer.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "BasicLayersImpl.h"            // for FillRectWithMask, etc
-#include "Layers.h"                     // for ColorLayer, etc
-#include "BasicImplData.h"              // for BasicImplData
-#include "BasicLayers.h"                // for BasicLayerManager
-#include "gfxContext.h"                 // for gfxContext, etc
-#include "gfxRect.h"                    // for gfxRect
-#include "gfx2DGlue.h"
-#include "mozilla/mozalloc.h"           // for operator new
-#include "nsCOMPtr.h"                   // for already_AddRefed
-#include "nsDebug.h"                    // for NS_ASSERTION
-#include "nsISupportsImpl.h"            // for Layer::AddRef, etc
-#include "nsRect.h"                     // for mozilla::gfx::IntRect
-#include "nsRegion.h"                   // for nsIntRegion
-#include "mozilla/gfx/PathHelpers.h"
-#include "mozilla/layers/LayersMessages.h" // for GlyphArray
-
-using namespace mozilla::gfx;
-
-namespace mozilla {
-namespace layers {
-
-class BasicTextLayer : public TextLayer, public BasicImplData {
-public:
-  explicit BasicTextLayer(BasicLayerManager* aLayerManager) :
-    TextLayer(aLayerManager, static_cast<BasicImplData*>(this))
-  {
-    MOZ_COUNT_CTOR(BasicTextLayer);
-  }
-
-protected:
-  virtual ~BasicTextLayer()
-  {
-    MOZ_COUNT_DTOR(BasicTextLayer);
-  }
-
-public:
-  virtual void SetVisibleRegion(const LayerIntRegion& aRegion) override
-  {
-    NS_ASSERTION(BasicManager()->InConstruction(),
-                 "Can only set properties in construction phase");
-    TextLayer::SetVisibleRegion(aRegion);
-  }
-
-  virtual void Paint(DrawTarget* aDT,
-                     const gfx::Point& aDeviceOffset,
-                     Layer* aMaskLayer) override
-  {
-    if (IsHidden() || !mFont) {
-      return;
-    }
-
-    Rect snapped(mBounds.X(), mBounds.Y(), mBounds.Width(), mBounds.Height());
-    MaybeSnapToDevicePixels(snapped, *aDT, true);
-
-    // We don't currently support subpixel-AA in TextLayers since we
-    // don't check if there's an opaque background color behind them.
-    // We should fix this before using them in production.
-    aDT->SetPermitSubpixelAA(false);
-
-    for (GlyphArray& g : mGlyphs) {
-      GlyphBuffer buffer = { g.glyphs().Elements(), (uint32_t)g.glyphs().Length() };
-      aDT->FillGlyphs(mFont, buffer, ColorPattern(g.color().value()));
-    }
-  }
-
-protected:
-  BasicLayerManager* BasicManager()
-  {
-    return static_cast<BasicLayerManager*>(mManager);
-  }
-};
-
-already_AddRefed<TextLayer>
-BasicLayerManager::CreateTextLayer()
-{
-  NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
-  RefPtr<TextLayer> layer = new BasicTextLayer(this);
-  return layer.forget();
-}
-
-} // namespace layers
-} // namespace mozilla
--- a/gfx/layers/client/ClientLayerManager.h
+++ b/gfx/layers/client/ClientLayerManager.h
@@ -101,17 +101,16 @@ public:
 
   virtual already_AddRefed<PaintedLayer> CreatePaintedLayer() override;
   virtual already_AddRefed<PaintedLayer> CreatePaintedLayerWithHint(PaintedLayerCreationHint aHint) override;
   virtual already_AddRefed<ContainerLayer> CreateContainerLayer() override;
   virtual already_AddRefed<ImageLayer> CreateImageLayer() override;
   virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() override;
   virtual already_AddRefed<ReadbackLayer> CreateReadbackLayer() override;
   virtual already_AddRefed<ColorLayer> CreateColorLayer() override;
-  virtual already_AddRefed<TextLayer> CreateTextLayer() override;
   virtual already_AddRefed<BorderLayer> CreateBorderLayer() override;
   virtual already_AddRefed<RefLayer> CreateRefLayer() override;
 
   virtual void UpdateTextureFactoryIdentifier(const TextureFactoryIdentifier& aNewIdentifier) override;
   virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() override
   {
     return AsShadowForwarder()->GetTextureFactoryIdentifier();
   }
deleted file mode 100644
--- a/gfx/layers/client/ClientTextLayer.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "ClientLayerManager.h"         // for ClientLayerManager, etc
-#include "Layers.h"                     // for ColorLayer, etc
-#include "mozilla/layers/LayersMessages.h"  // for ColorLayerAttributes, etc
-#include "mozilla/mozalloc.h"           // for operator new
-#include "nsCOMPtr.h"                   // for already_AddRefed
-#include "nsDebug.h"                    // for NS_ASSERTION
-#include "nsISupportsImpl.h"            // for Layer::AddRef, etc
-#include "nsRegion.h"                   // for nsIntRegion
-
-namespace mozilla {
-namespace layers {
-
-using namespace mozilla::gfx;
-
-class ClientTextLayer : public TextLayer,
-                        public ClientLayer {
-public:
-  explicit ClientTextLayer(ClientLayerManager* aLayerManager) :
-    TextLayer(aLayerManager, static_cast<ClientLayer*>(this)),
-    mSwapped(false)
-  {
-    MOZ_COUNT_CTOR(ClientTextLayer);
-  }
-
-protected:
-  virtual ~ClientTextLayer()
-  {
-    MOZ_COUNT_DTOR(ClientTextLayer);
-  }
-
-public:
-  virtual void SetVisibleRegion(const LayerIntRegion& aRegion)
-  {
-    NS_ASSERTION(ClientManager()->InConstruction(),
-                 "Can only set properties in construction phase");
-    TextLayer::SetVisibleRegion(aRegion);
-  }
-
-  virtual void RenderLayer()
-  {
-    RenderMaskLayers(this);
-  }
-
-  virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
-  {
-    NS_ASSERTION(!mSwapped, "Trying to access glyph array after it's been swapped!");
-    aAttrs = TextLayerAttributes(GetBounds(), nsTArray<GlyphArray>(), uintptr_t(mFont.get()));
-    aAttrs.get_TextLayerAttributes().glyphs().SwapElements(mGlyphs);
-    mSwapped = true;
-  }
-
-  virtual void SetGlyphs(nsTArray<GlyphArray>&& aGlyphs)
-  {
-    TextLayer::SetGlyphs(Move(aGlyphs));
-    mSwapped = false;
-  }
-
-  virtual Layer* AsLayer() { return this; }
-  virtual ShadowableLayer* AsShadowableLayer() { return this; }
-
-protected:
-  ClientLayerManager* ClientManager()
-  {
-    return static_cast<ClientLayerManager*>(mManager);
-  }
-
-  bool mSwapped;
-};
-
-already_AddRefed<TextLayer>
-ClientLayerManager::CreateTextLayer()
-{
-  NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
-  RefPtr<ClientTextLayer> layer =
-    new ClientTextLayer(this);
-  CREATE_SHADOW(Text);
-  return layer.forget();
-}
-
-} // namespace layers
-} // namespace mozilla
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -1231,60 +1231,16 @@ LayerManagerComposite::HandlePixelsTarge
   GLContext* gl = compositor->gl();
   MOZ_ASSERT(gl);
   gl->fReadPixels(0, 0, bufferWidth, bufferHeight, LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE, mem.get<uint8_t>());
   Unused << mScreenPixelsTarget->SendScreenPixels(mem, ScreenIntSize(bufferWidth, bufferHeight));
   mScreenPixelsTarget = nullptr;
 }
 #endif
 
-class TextLayerComposite : public TextLayer,
-                           public LayerComposite
-{
-public:
-  explicit TextLayerComposite(LayerManagerComposite *aManager)
-    : TextLayer(aManager, nullptr)
-    , LayerComposite(aManager)
-  {
-    MOZ_COUNT_CTOR(TextLayerComposite);
-    mImplData = static_cast<LayerComposite*>(this);
-  }
-
-protected:
-  ~TextLayerComposite()
-  {
-    MOZ_COUNT_DTOR(TextLayerComposite);
-    Destroy();
-  }
-
-public:
-  // LayerComposite Implementation
-  virtual Layer* GetLayer() override { return this; }
-
-  virtual void SetLayerManager(HostLayerManager* aManager) override
-  {
-    LayerComposite::SetLayerManager(aManager);
-    mManager = aManager;
-  }
-
-  virtual void Destroy() override { mDestroyed = true; }
-
-  virtual void RenderLayer(const gfx::IntRect& aClipRect,
-                           const Maybe<gfx::Polygon>& aGeometry) override {}
-  virtual void CleanupResources() override {};
-
-  virtual void GenEffectChain(EffectChain& aEffect) override {}
-
-  CompositableHost* GetCompositableHost() override { return nullptr; }
-
-  virtual HostLayer* AsHostLayer() override { return this; }
-
-  virtual const char* Name() const override { return "TextLayerComposite"; }
-};
-
 class BorderLayerComposite : public BorderLayer,
                              public LayerComposite
 {
 public:
   explicit BorderLayerComposite(LayerManagerComposite *aManager)
     : BorderLayer(aManager, nullptr)
     , LayerComposite(aManager)
   {
@@ -1379,26 +1335,16 @@ LayerManagerComposite::CreateRefLayer()
 {
   if (LayerManagerComposite::mDestroyed) {
     NS_WARNING("Call on destroyed layer manager");
     return nullptr;
   }
   return RefPtr<RefLayer>(new RefLayerComposite(this)).forget();
 }
 
-already_AddRefed<TextLayer>
-LayerManagerComposite::CreateTextLayer()
-{
-  if (LayerManagerComposite::mDestroyed) {
-    NS_WARNING("Call on destroyed layer manager");
-    return nullptr;
-  }
-  return RefPtr<TextLayer>(new TextLayerComposite(this)).forget();
-}
-
 already_AddRefed<BorderLayer>
 LayerManagerComposite::CreateBorderLayer()
 {
   if (LayerManagerComposite::mDestroyed) {
     NS_WARNING("Call on destroyed layer manager");
     return nullptr;
   }
   return RefPtr<BorderLayer>(new BorderLayerComposite(this)).forget();
--- a/gfx/layers/composite/LayerManagerComposite.h
+++ b/gfx/layers/composite/LayerManagerComposite.h
@@ -303,17 +303,16 @@ public:
   virtual bool CanUseCanvasLayerForSize(const gfx::IntSize &aSize) override;
 
   virtual void ClearCachedResources(Layer* aSubtree = nullptr) override;
 
   virtual already_AddRefed<PaintedLayer> CreatePaintedLayer() override;
   virtual already_AddRefed<ContainerLayer> CreateContainerLayer() override;
   virtual already_AddRefed<ImageLayer> CreateImageLayer() override;
   virtual already_AddRefed<ColorLayer> CreateColorLayer() override;
-  virtual already_AddRefed<TextLayer> CreateTextLayer() override;
   virtual already_AddRefed<BorderLayer> CreateBorderLayer() override;
   virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() override;
   virtual already_AddRefed<RefLayer> CreateRefLayer() override;
 
   virtual bool AreComponentAlphaLayersEnabled() override;
 
   virtual already_AddRefed<DrawTarget>
     CreateOptimalMaskDrawTarget(const IntSize &aSize) override;
--- a/gfx/layers/ipc/LayerTransactionParent.cpp
+++ b/gfx/layers/ipc/LayerTransactionParent.cpp
@@ -241,27 +241,16 @@ LayerTransactionParent::RecvUpdate(const
       RefPtr<ColorLayer> layer = mLayerManager->CreateColorLayer();
       if (!BindLayer(layer, edit.get_OpCreateColorLayer())) {
         return IPC_FAIL_NO_REASON(this);
       }
 
       UpdateHitTestingTree(layer, "CreateColorLayer");
       break;
     }
-    case Edit::TOpCreateTextLayer: {
-      MOZ_LAYERS_LOG(("[ParentSide] CreateTextLayer"));
-
-      RefPtr<TextLayer> layer = mLayerManager->CreateTextLayer();
-      if (!BindLayer(layer, edit.get_OpCreateTextLayer())) {
-        return IPC_FAIL_NO_REASON(this);
-      }
-
-      UpdateHitTestingTree(layer, "CreateTextLayer");
-      break;
-    }
     case Edit::TOpCreateBorderLayer: {
       MOZ_LAYERS_LOG(("[ParentSide] CreateBorderLayer"));
 
       RefPtr<BorderLayer> layer = mLayerManager->CreateBorderLayer();
       if (!BindLayer(layer, edit.get_OpCreateBorderLayer())) {
         return IPC_FAIL_NO_REASON(this);
       }
 
@@ -617,29 +606,16 @@ LayerTransactionParent::SetLayerAttribut
     ColorLayer* colorLayer = layer->AsColorLayer();
     if (!colorLayer) {
       return false;
     }
     colorLayer->SetColor(specific.get_ColorLayerAttributes().color().value());
     colorLayer->SetBounds(specific.get_ColorLayerAttributes().bounds());
     break;
   }
-  case Specific::TTextLayerAttributes: {
-    MOZ_LAYERS_LOG(("[ParentSide]   text layer"));
-
-    TextLayer* textLayer = layer->AsTextLayer();
-    if (!textLayer) {
-      return false;
-    }
-    const auto& tla = specific.get_TextLayerAttributes();
-    textLayer->SetBounds(tla.bounds());
-    textLayer->SetGlyphs(Move(const_cast<nsTArray<GlyphArray>&>(tla.glyphs())));
-    textLayer->SetScaledFont(reinterpret_cast<gfx::ScaledFont*>(tla.scaledFont()));
-    break;
-  }
   case Specific::TBorderLayerAttributes: {
     MOZ_LAYERS_LOG(("[ParentSide]   border layer"));
 
     BorderLayer* borderLayer = layer->AsBorderLayer();
     if (!borderLayer) {
       return false;
     }
     borderLayer->SetRect(specific.get_BorderLayerAttributes().rect());
--- a/gfx/layers/ipc/LayersMessages.ipdlh
+++ b/gfx/layers/ipc/LayersMessages.ipdlh
@@ -66,17 +66,16 @@ struct TargetConfig {
   nsIntRegion clearRegion;
 };
 
 // Create a shadow layer for |layer|
 struct OpCreatePaintedLayer    { LayerHandle layer; };
 struct OpCreateContainerLayer  { LayerHandle layer; };
 struct OpCreateImageLayer      { LayerHandle layer; };
 struct OpCreateColorLayer      { LayerHandle layer; };
-struct OpCreateTextLayer       { LayerHandle layer; };
 struct OpCreateBorderLayer       { LayerHandle layer; };
 struct OpCreateCanvasLayer     { LayerHandle layer; };
 struct OpCreateRefLayer        { LayerHandle layer; };
 
 struct OpAttachCompositable {
   LayerHandle layer;
   CompositableHandle compositable;
 };
@@ -290,19 +289,16 @@ struct ContainerLayerAttributes {
 };
 
 struct GlyphArray
 {
   LayerColor color;
   Glyph[] glyphs;
 };
 
-// XXX - Bas - Hack warning! This is using a raw pointer to a ScaledFont*
-// and won't work with e10s.
-struct TextLayerAttributes      { IntRect bounds; GlyphArray[] glyphs; uintptr_t scaledFont; };
 struct ColorLayerAttributes     { LayerColor color; IntRect bounds; };
 struct CanvasLayerAttributes    { SamplingFilter samplingFilter; IntRect bounds; };
 struct RefLayerAttributes {
   uint64_t id;
   EventRegionsOverride eventRegionsOverride;
 };
 struct ImageLayerAttributes     { SamplingFilter samplingFilter; IntSize scaleToSize; ScaleMode scaleMode; };
 struct BorderLayerAttributes {
@@ -313,17 +309,16 @@ struct BorderLayerAttributes {
 };
 
 union SpecificLayerAttributes {
   null_t;
   PaintedLayerAttributes;
   ContainerLayerAttributes;
   ColorLayerAttributes;
   CanvasLayerAttributes;
-  TextLayerAttributes;
   RefLayerAttributes;
   ImageLayerAttributes;
   BorderLayerAttributes;
 };
 
 struct LayerAttributes {
   CommonLayerAttributes common;
   SpecificLayerAttributes specific;
@@ -492,17 +487,16 @@ struct CompositableOperation {
 // A unit of a changeset; a set of these comprise a changeset
 // If adding a new edit type that requires the hit testing tree to be updated,
 // set the updateHitTestingTree flag to true in RecvUpdate()
 union Edit {
   OpCreatePaintedLayer;
   OpCreateContainerLayer;
   OpCreateImageLayer;
   OpCreateColorLayer;
-  OpCreateTextLayer;
   OpCreateBorderLayer;
   OpCreateCanvasLayer;
   OpCreateRefLayer;
 
   OpSetDiagnosticTypes;
   OpWindowOverlayChanged;
 
   OpSetRoot;
--- a/gfx/layers/ipc/ShadowLayers.cpp
+++ b/gfx/layers/ipc/ShadowLayers.cpp
@@ -334,21 +334,16 @@ ShadowLayerForwarder::CreatedImageLayer(
   CreatedLayer<OpCreateImageLayer>(mTxn, aImage);
 }
 void
 ShadowLayerForwarder::CreatedColorLayer(ShadowableLayer* aColor)
 {
   CreatedLayer<OpCreateColorLayer>(mTxn, aColor);
 }
 void
-ShadowLayerForwarder::CreatedTextLayer(ShadowableLayer* aColor)
-{
-  CreatedLayer<OpCreateTextLayer>(mTxn, aColor);
-}
-void
 ShadowLayerForwarder::CreatedBorderLayer(ShadowableLayer* aBorder)
 {
   CreatedLayer<OpCreateBorderLayer>(mTxn, aBorder);
 }
 void
 ShadowLayerForwarder::CreatedCanvasLayer(ShadowableLayer* aCanvas)
 {
   CreatedLayer<OpCreateCanvasLayer>(mTxn, aCanvas);
--- a/gfx/layers/ipc/ShadowLayers.h
+++ b/gfx/layers/ipc/ShadowLayers.h
@@ -172,17 +172,16 @@ public:
    * the compositing process.
    */
   void CreatedPaintedLayer(ShadowableLayer* aThebes);
   void CreatedContainerLayer(ShadowableLayer* aContainer);
   void CreatedImageLayer(ShadowableLayer* aImage);
   void CreatedColorLayer(ShadowableLayer* aColor);
   void CreatedCanvasLayer(ShadowableLayer* aCanvas);
   void CreatedRefLayer(ShadowableLayer* aRef);
-  void CreatedTextLayer(ShadowableLayer* aRef);
   void CreatedBorderLayer(ShadowableLayer* aRef);
 
   /**
    * At least one attribute of |aMutant| has changed, and |aMutant|
    * needs to sync to its shadow layer.  This initial implementation
    * forwards all attributes when any of the appropriate attribute
    * set is mutated.
    */
--- a/gfx/layers/mlgpu/LayerManagerMLGPU.cpp
+++ b/gfx/layers/mlgpu/LayerManagerMLGPU.cpp
@@ -159,23 +159,16 @@ LayerManagerMLGPU::CreateImageLayer()
 
 already_AddRefed<BorderLayer>
 LayerManagerMLGPU::CreateBorderLayer()
 {
   MOZ_ASSERT_UNREACHABLE("Not yet implemented");
   return nullptr;
 }
 
-already_AddRefed<TextLayer>
-LayerManagerMLGPU::CreateTextLayer()
-{
-  MOZ_ASSERT_UNREACHABLE("Not yet implemented");
-  return nullptr;
-}
-
 already_AddRefed<CanvasLayer>
 LayerManagerMLGPU::CreateCanvasLayer()
 {
   return MakeAndAddRef<CanvasLayerMLGPU>(this);
 }
 
 TextureFactoryIdentifier
 LayerManagerMLGPU::GetTextureFactoryIdentifier()
--- a/gfx/layers/mlgpu/LayerManagerMLGPU.h
+++ b/gfx/layers/mlgpu/LayerManagerMLGPU.h
@@ -39,17 +39,16 @@ public:
   // LayerManager methods
   bool BeginTransaction() override;
   void BeginTransactionWithDrawTarget(gfx::DrawTarget* aTarget, const gfx::IntRect& aRect) override;
   void SetRoot(Layer* aLayer) override;
   already_AddRefed<PaintedLayer> CreatePaintedLayer() override;
   already_AddRefed<ContainerLayer> CreateContainerLayer() override;
   already_AddRefed<ImageLayer> CreateImageLayer() override;
   already_AddRefed<ColorLayer> CreateColorLayer() override;
-  already_AddRefed<TextLayer> CreateTextLayer() override;
   already_AddRefed<CanvasLayer> CreateCanvasLayer() override;
   already_AddRefed<RefLayer> CreateRefLayer() override;
   already_AddRefed<BorderLayer> CreateBorderLayer() override;
 
   bool AreComponentAlphaLayersEnabled() override;
   bool BlendingRequiresIntermediateSurface() override;
 
   // HostLayerManager methods
--- a/gfx/layers/moz.build
+++ b/gfx/layers/moz.build
@@ -337,32 +337,30 @@ UNIFIED_SOURCES += [
     'basic/BasicColorLayer.cpp',
     'basic/BasicCompositor.cpp',
     'basic/BasicContainerLayer.cpp',
     'basic/BasicDisplayItemLayer.cpp',
     'basic/BasicImages.cpp',
     'basic/BasicLayerManager.cpp',
     'basic/BasicLayersImpl.cpp',
     'basic/BasicPaintedLayer.cpp',
-    'basic/BasicTextLayer.cpp',
     'basic/TextureHostBasic.cpp',
     'BSPTree.cpp',
     'BufferTexture.cpp',
     'BufferUnrotate.cpp',
     'CanvasRenderer.cpp',
     'client/CanvasClient.cpp',
     'client/ClientBorderLayer.cpp',
     'client/ClientCanvasLayer.cpp',
     'client/ClientCanvasRenderer.cpp',
     'client/ClientColorLayer.cpp',
     'client/ClientContainerLayer.cpp',
     'client/ClientImageLayer.cpp',
     'client/ClientLayerManager.cpp',
     'client/ClientPaintedLayer.cpp',
-    'client/ClientTextLayer.cpp',
     'client/ClientTiledPaintedLayer.cpp',
     'client/CompositableClient.cpp',
     'client/ContentClient.cpp',
     'client/GPUVideoTextureClient.cpp',
     'client/ImageClient.cpp',
     'client/SingleTiledContentClient.cpp',
     'client/TextureClient.cpp',
     'client/TextureClientPool.cpp',
--- a/gfx/layers/protobuf/LayerScopePacket.pb.cc
+++ b/gfx/layers/protobuf/LayerScopePacket.pb.cc
@@ -297,17 +297,16 @@ bool LayersPacket_Layer_LayerType_IsVali
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
 const LayersPacket_Layer_LayerType LayersPacket_Layer::UnknownLayer;
 const LayersPacket_Layer_LayerType LayersPacket_Layer::LayerManager;
 const LayersPacket_Layer_LayerType LayersPacket_Layer::ContainerLayer;
 const LayersPacket_Layer_LayerType LayersPacket_Layer::PaintedLayer;
 const LayersPacket_Layer_LayerType LayersPacket_Layer::CanvasLayer;
 const LayersPacket_Layer_LayerType LayersPacket_Layer::ImageLayer;
 const LayersPacket_Layer_LayerType LayersPacket_Layer::ColorLayer;
-const LayersPacket_Layer_LayerType LayersPacket_Layer::TextLayer;
 const LayersPacket_Layer_LayerType LayersPacket_Layer::RefLayer;
 const LayersPacket_Layer_LayerType LayersPacket_Layer::ReadbackLayer;
 const LayersPacket_Layer_LayerType LayersPacket_Layer::DisplayItemLayer;
 const LayersPacket_Layer_LayerType LayersPacket_Layer::LayerType_MIN;
 const LayersPacket_Layer_LayerType LayersPacket_Layer::LayerType_MAX;
 const int LayersPacket_Layer::LayerType_ARRAYSIZE;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 bool LayersPacket_Layer_ScrollingDirect_IsValid(int value) {
--- a/gfx/layers/protobuf/LayerScopePacket.pb.h
+++ b/gfx/layers/protobuf/LayerScopePacket.pb.h
@@ -126,17 +126,16 @@ const int TexturePacket_Filter_Filter_AR
 enum LayersPacket_Layer_LayerType {
   LayersPacket_Layer_LayerType_UnknownLayer = 0,
   LayersPacket_Layer_LayerType_LayerManager = 1,
   LayersPacket_Layer_LayerType_ContainerLayer = 2,
   LayersPacket_Layer_LayerType_PaintedLayer = 3,
   LayersPacket_Layer_LayerType_CanvasLayer = 4,
   LayersPacket_Layer_LayerType_ImageLayer = 5,
   LayersPacket_Layer_LayerType_ColorLayer = 6,
-  LayersPacket_Layer_LayerType_TextLayer = 7,
   LayersPacket_Layer_LayerType_RefLayer = 8,
   LayersPacket_Layer_LayerType_ReadbackLayer = 9,
   LayersPacket_Layer_LayerType_DisplayItemLayer = 10
 };
 bool LayersPacket_Layer_LayerType_IsValid(int value);
 const LayersPacket_Layer_LayerType LayersPacket_Layer_LayerType_LayerType_MIN = LayersPacket_Layer_LayerType_UnknownLayer;
 const LayersPacket_Layer_LayerType LayersPacket_Layer_LayerType_LayerType_MAX = LayersPacket_Layer_LayerType_DisplayItemLayer;
 const int LayersPacket_Layer_LayerType_LayerType_ARRAYSIZE = LayersPacket_Layer_LayerType_LayerType_MAX + 1;
@@ -1947,18 +1946,16 @@ class LayersPacket_Layer : public ::goog
   static const LayerType PaintedLayer =
     LayersPacket_Layer_LayerType_PaintedLayer;
   static const LayerType CanvasLayer =
     LayersPacket_Layer_LayerType_CanvasLayer;
   static const LayerType ImageLayer =
     LayersPacket_Layer_LayerType_ImageLayer;
   static const LayerType ColorLayer =
     LayersPacket_Layer_LayerType_ColorLayer;
-  static const LayerType TextLayer =
-    LayersPacket_Layer_LayerType_TextLayer;
   static const LayerType RefLayer =
     LayersPacket_Layer_LayerType_RefLayer;
   static const LayerType ReadbackLayer =
     LayersPacket_Layer_LayerType_ReadbackLayer;
   static const LayerType DisplayItemLayer =
     LayersPacket_Layer_LayerType_DisplayItemLayer;
   static inline bool LayerType_IsValid(int value) {
     return LayersPacket_Layer_LayerType_IsValid(value);
--- a/gfx/layers/protobuf/LayerScopePacket.proto
+++ b/gfx/layers/protobuf/LayerScopePacket.proto
@@ -74,17 +74,16 @@ message LayersPacket {
     enum LayerType {
       UnknownLayer = 0;
       LayerManager = 1;
       ContainerLayer = 2;
       PaintedLayer = 3;
       CanvasLayer = 4;
       ImageLayer = 5;
       ColorLayer = 6;
-      TextLayer = 7;
       RefLayer = 8;
       ReadbackLayer = 9;
       DisplayItemLayer = 10;
     }
     enum ScrollingDirect {
       VERTICAL = 1;
       HORIZONTAL = 2;
     }
--- a/gfx/layers/wr/ScrollingLayersHelper.h
+++ b/gfx/layers/wr/ScrollingLayersHelper.h
@@ -5,16 +5,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef GFX_SCROLLINGLAYERSHELPER_H
 #define GFX_SCROLLINGLAYERSHELPER_H
 
 #include <unordered_map>
 
 #include "mozilla/Attributes.h"
+#include "mozilla/webrender/WebRenderAPI.h"
+#include "FrameMetrics.h"
 
 class nsDisplayItem;
 
 namespace mozilla {
 
 struct ActiveScrolledRoot;
 struct DisplayItemClipChain;
 
--- a/gfx/layers/wr/WebRenderLayerManager.h
+++ b/gfx/layers/wr/WebRenderLayerManager.h
@@ -79,17 +79,16 @@ public:
   virtual const char* Name() const override { return "WebRender"; }
 
   virtual void SetRoot(Layer* aLayer) override;
 
   already_AddRefed<PaintedLayer> CreatePaintedLayer() override { return nullptr; }
   already_AddRefed<ContainerLayer> CreateContainerLayer() override { return nullptr; }
   already_AddRefed<ImageLayer> CreateImageLayer() override { return nullptr; }
   already_AddRefed<ColorLayer> CreateColorLayer() override { return nullptr; }
-  already_AddRefed<TextLayer> CreateTextLayer() override { return nullptr; }
   already_AddRefed<BorderLayer> CreateBorderLayer() override { return nullptr; }
   already_AddRefed<CanvasLayer> CreateCanvasLayer() override { return nullptr; }
 
   virtual bool NeedsWidgetInvalidation() override { return false; }
 
   virtual void SetLayerObserverEpoch(uint64_t aLayerObserverEpoch) override;
 
   virtual void DidComposite(uint64_t aTransactionId,
--- a/gfx/tests/gtest/TestLayers.cpp
+++ b/gfx/tests/gtest/TestLayers.cpp
@@ -71,19 +71,16 @@ public:
   }
   virtual already_AddRefed<PaintedLayer> CreatePaintedLayer() {
     RefPtr<PaintedLayer> layer = new TestPaintedLayer(this);
     return layer.forget();
   }
   virtual already_AddRefed<ColorLayer> CreateColorLayer() {
     MOZ_CRASH("Not implemented.");
   }
-  virtual already_AddRefed<TextLayer> CreateTextLayer() {
-    MOZ_CRASH("Not implemented.");
-  }
   virtual already_AddRefed<BorderLayer> CreateBorderLayer() {
     MOZ_CRASH("Not implemented.");
   }
   virtual void SetRoot(Layer* aLayer) {}
   virtual bool BeginTransactionWithTarget(gfxContext* aTarget) { return true; }
   virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() {
     MOZ_CRASH("Not implemented.");
   }
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -544,17 +544,16 @@ private:
   DECL_OVERRIDE_PREF(Live, "layers.advanced.bullet-layers",           LayersAllowBulletLayers, gfxPrefs::OverrideBase_WebRender());
   DECL_OVERRIDE_PREF(Live, "layers.advanced.canvas-background-color", LayersAllowCanvasBackgroundColorLayers, gfxPrefs::OverrideBase_WebRender());
   DECL_GFX_PREF(Live, "layers.advanced.caret-layers",                 LayersAllowCaretLayers, bool, false);
   DECL_OVERRIDE_PREF(Live, "layers.advanced.columnRule-layers",       LayersAllowColumnRuleLayers, gfxPrefs::OverrideBase_WebRender());
   DECL_OVERRIDE_PREF(Live, "layers.advanced.image-layers",            LayersAllowImageLayers, gfxPrefs::OverrideBase_WebRender());
   DECL_OVERRIDE_PREF(Live, "layers.advanced.outline-layers",          LayersAllowOutlineLayers, gfxPrefs::OverrideBase_WebRender());
   DECL_GFX_PREF(Live, "layers.advanced.solid-color",                  LayersAllowSolidColorLayers, bool, false);
   DECL_GFX_PREF(Live, "layers.advanced.table",                        LayersAllowTable, bool, false);
-  DECL_OVERRIDE_PREF(Live, "layers.advanced.text-layers",             LayersAllowTextLayers, gfxPrefs::OverrideBase_WebRender());
   DECL_GFX_PREF(Once, "layers.amd-switchable-gfx.enabled",     LayersAMDSwitchableGfxEnabled, bool, false);
   DECL_GFX_PREF(Once, "layers.async-pan-zoom.enabled",         AsyncPanZoomEnabledDoNotUseDirectly, bool, true);
   DECL_GFX_PREF(Once, "layers.async-pan-zoom.separate-event-thread", AsyncPanZoomSeparateEventThread, bool, false);
   DECL_GFX_PREF(Live, "layers.bench.enabled",                  LayersBenchEnabled, bool, false);
   DECL_GFX_PREF(Once, "layers.bufferrotation.enabled",         BufferRotationEnabled, bool, true);
   DECL_GFX_PREF(Live, "layers.child-process-shutdown",         ChildProcessShutdown, bool, true);
 #ifdef MOZ_GFX_OPTIMIZE_MOBILE
   // If MOZ_GFX_OPTIMIZE_MOBILE is defined, we force component alpha off
--- a/layout/generic/TextOverflow.cpp
+++ b/layout/generic/TextOverflow.cpp
@@ -293,20 +293,16 @@ nsDisplayTextOverflowMarker::PaintTextTo
 
 bool
 nsDisplayTextOverflowMarker::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
                                                      mozilla::wr::IpcResourceUpdateQueue& aResources,
                                                      const StackingContextHelper& aSc,
                                                      layers::WebRenderLayerManager* aManager,
                                                      nsDisplayListBuilder* aDisplayListBuilder)
 {
-  if (!gfxPrefs::LayersAllowTextLayers()) {
-      return false;
-  }
-
   bool snap;
   nsRect bounds = GetBounds(aDisplayListBuilder, &snap);
   if (bounds.IsEmpty()) {
     return true;
   }
 
   // Run the rendering algorithm to capture the glyphs and shadows
   RefPtr<TextDrawTarget> textDrawer = new TextDrawTarget(aBuilder, aSc, aManager, this, bounds);
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -5120,20 +5120,16 @@ nsDisplayText::Paint(nsDisplayListBuilde
 
 bool
 nsDisplayText::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
                                        mozilla::wr::IpcResourceUpdateQueue& aResources,
                                        const StackingContextHelper& aSc,
                                        WebRenderLayerManager* aManager,
                                        nsDisplayListBuilder* aDisplayListBuilder)
 {
-  if (!gfxPrefs::LayersAllowTextLayers()) {
-    return false;
-  }
-
   if (mBounds.IsEmpty()) {
     return true;
   }
 
   RefPtr<TextDrawTarget> textDrawer = new TextDrawTarget(aBuilder, aSc, aManager, this, mBounds);
   RefPtr<gfxContext> captureCtx = gfxContext::CreateOrNull(textDrawer);
 
   RenderToContext(captureCtx, aDisplayListBuilder, true);
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -5888,17 +5888,16 @@ pref("layers.advanced.border-layers", 2)
 pref("layers.advanced.bullet-layers", 2);
 pref("layers.advanced.canvas-background-color", 2);
 pref("layers.advanced.caret-layers", false);
 pref("layers.advanced.columnRule-layers", 2);
 pref("layers.advanced.image-layers", 2);
 pref("layers.advanced.outline-layers", 2);
 pref("layers.advanced.solid-color", false);
 pref("layers.advanced.table", false);
-pref("layers.advanced.text-layers", 2);
 
 // Enable lowercased response header name
 pref("dom.xhr.lowercase_header.enabled", false);
 
 // Control whether clients.openWindow() opens windows in the same process
 // that called the API vs following our normal multi-process selection
 // algorithm.  Restricting openWindow to same process improves service worker
 // web compat in the short term.  Once the SW multi-e10s refactor is complete