Backed out changeset 497efe3a096b (bug 1406231) for windows build bustages on build\build\src\obj-firefox\dist\include\mozilla/layers/ScrollingLayersHelper.h(48) r=backout on a CLOSED TREE

This commit is contained in:
Cosmin Sabou 2017-12-08 13:04:05 +02:00
parent 154fd9c9ad
commit 9937354d94
25 changed files with 444 additions and 0 deletions

View File

@ -651,6 +651,49 @@ public:
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();
@ -787,6 +830,8 @@ CloneLayerTreePropertiesInternal(Layer* aRoot, bool aIsMask /* = false */)
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:

View File

@ -2119,6 +2119,23 @@ ColorLayer::DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent)
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)
{
@ -2468,5 +2485,20 @@ 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

View File

@ -92,6 +92,7 @@ class DisplayItemLayer;
class ColorLayer;
class CompositorAnimations;
class CompositorBridgeChild;
class TextLayer;
class CanvasLayer;
class BorderLayer;
class ReadbackLayer;
@ -433,6 +434,11 @@ public:
* 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.
@ -824,6 +830,7 @@ public:
TYPE_CONTAINER,
TYPE_DISPLAYITEM,
TYPE_IMAGE,
TYPE_TEXT,
TYPE_BORDER,
TYPE_READBACK,
TYPE_REF,
@ -1556,6 +1563,12 @@ public:
*/
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.
@ -2510,6 +2523,63 @@ protected:
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.
*/

View File

@ -117,6 +117,7 @@ public:
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;

View File

@ -0,0 +1,88 @@
/* -*- 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

View File

@ -106,6 +106,7 @@ public:
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;

View File

@ -0,0 +1,87 @@
/* -*- 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

View File

@ -1236,6 +1236,50 @@ LayerManagerComposite::HandlePixelsTarget()
}
#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
{
@ -1340,6 +1384,16 @@ LayerManagerComposite::CreateRefLayer()
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()
{

View File

@ -308,6 +308,7 @@ public:
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;

View File

@ -246,6 +246,17 @@ LayerTransactionParent::RecvUpdate(const TransactionInfo& aInfo)
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"));
@ -611,6 +622,19 @@ LayerTransactionParent::SetLayerAttributes(const OpSetLayerAttributes& aOp)
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"));

View File

@ -71,6 +71,7 @@ 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; };
@ -294,6 +295,9 @@ struct GlyphArray
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 {
@ -314,6 +318,7 @@ union SpecificLayerAttributes {
ContainerLayerAttributes;
ColorLayerAttributes;
CanvasLayerAttributes;
TextLayerAttributes;
RefLayerAttributes;
ImageLayerAttributes;
BorderLayerAttributes;
@ -492,6 +497,7 @@ union Edit {
OpCreateContainerLayer;
OpCreateImageLayer;
OpCreateColorLayer;
OpCreateTextLayer;
OpCreateBorderLayer;
OpCreateCanvasLayer;
OpCreateRefLayer;

View File

@ -339,6 +339,11 @@ 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);

View File

@ -177,6 +177,7 @@ public:
void CreatedColorLayer(ShadowableLayer* aColor);
void CreatedCanvasLayer(ShadowableLayer* aCanvas);
void CreatedRefLayer(ShadowableLayer* aRef);
void CreatedTextLayer(ShadowableLayer* aRef);
void CreatedBorderLayer(ShadowableLayer* aRef);
/**

View File

@ -164,6 +164,13 @@ LayerManagerMLGPU::CreateBorderLayer()
return nullptr;
}
already_AddRefed<TextLayer>
LayerManagerMLGPU::CreateTextLayer()
{
MOZ_ASSERT_UNREACHABLE("Not yet implemented");
return nullptr;
}
already_AddRefed<CanvasLayer>
LayerManagerMLGPU::CreateCanvasLayer()
{

View File

@ -44,6 +44,7 @@ public:
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;

View File

@ -342,6 +342,7 @@ UNIFIED_SOURCES += [
'basic/BasicLayerManager.cpp',
'basic/BasicLayersImpl.cpp',
'basic/BasicPaintedLayer.cpp',
'basic/BasicTextLayer.cpp',
'basic/TextureHostBasic.cpp',
'BSPTree.cpp',
'BufferTexture.cpp',
@ -356,6 +357,7 @@ UNIFIED_SOURCES += [
'client/ClientImageLayer.cpp',
'client/ClientLayerManager.cpp',
'client/ClientPaintedLayer.cpp',
'client/ClientTextLayer.cpp',
'client/ClientTiledPaintedLayer.cpp',
'client/CompositableClient.cpp',
'client/ContentClient.cpp',

View File

@ -302,6 +302,7 @@ 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;

View File

@ -131,6 +131,7 @@ enum LayersPacket_Layer_LayerType {
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
@ -1951,6 +1952,8 @@ class LayersPacket_Layer : public ::google::protobuf::MessageLite /* @@protoc_in
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 =

View File

@ -79,6 +79,7 @@ message LayersPacket {
CanvasLayer = 4;
ImageLayer = 5;
ColorLayer = 6;
TextLayer = 7;
RefLayer = 8;
ReadbackLayer = 9;
DisplayItemLayer = 10;

View File

@ -84,6 +84,7 @@ public:
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; }

View File

@ -76,6 +76,9 @@ public:
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.");
}

View File

@ -548,6 +548,7 @@ private:
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);

View File

@ -298,6 +298,10 @@ nsDisplayTextOverflowMarker::CreateWebRenderCommands(mozilla::wr::DisplayListBui
layers::WebRenderLayerManager* aManager,
nsDisplayListBuilder* aDisplayListBuilder)
{
if (!gfxPrefs::LayersAllowTextLayers()) {
return false;
}
bool snap;
nsRect bounds = GetBounds(aDisplayListBuilder, &snap);
if (bounds.IsEmpty()) {

View File

@ -5123,6 +5123,10 @@ nsDisplayText::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder
WebRenderLayerManager* aManager,
nsDisplayListBuilder* aDisplayListBuilder)
{
if (!gfxPrefs::LayersAllowTextLayers()) {
return false;
}
if (mBounds.IsEmpty()) {
return true;
}

View File

@ -5829,6 +5829,7 @@ 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);