diff --git a/gfx/ipc/GfxMessageUtils.h b/gfx/ipc/GfxMessageUtils.h index 74b6577ccd429..fd838f5a809a4 100644 --- a/gfx/ipc/GfxMessageUtils.h +++ b/gfx/ipc/GfxMessageUtils.h @@ -25,6 +25,7 @@ #include "mozilla/layers/LayersTypes.h" #include "nsRect.h" #include "nsRegion.h" +#include "mozilla/Array.h" #include @@ -1284,6 +1285,26 @@ struct ParamTraits } }; +template +struct ParamTraits> +{ + typedef mozilla::Array paramType; + static void Write(Message* aMsg, const paramType& aParam) { + for (size_t i = 0; i < Length; i++) { + WriteParam(aMsg, aParam[i]); + } + } + + static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) { + for (size_t i = 0; i < Length; i++) { + if (!ReadParam(aMsg, aIter, &aResult[i])) { + return false; + } + } + return true; + } +}; + } /* namespace IPC */ #endif /* __GFXMESSAGEUTILS_H__ */ diff --git a/gfx/layers/LayerTreeInvalidation.cpp b/gfx/layers/LayerTreeInvalidation.cpp index f5a08b274b52a..f2061f57d770a 100644 --- a/gfx/layers/LayerTreeInvalidation.cpp +++ b/gfx/layers/LayerTreeInvalidation.cpp @@ -610,6 +610,7 @@ CloneLayerTreePropertiesInternal(Layer* aRoot, bool aIsMask /* = false */) case Layer::TYPE_SHADOW: case Layer::TYPE_PAINTED: case Layer::TYPE_TEXT: + case Layer::TYPE_BORDER: return MakeUnique(aRoot); } diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index 33319da0caf26..d621c408e8cca 100644 --- a/gfx/layers/Layers.cpp +++ b/gfx/layers/Layers.cpp @@ -2217,6 +2217,18 @@ TextLayer::DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent) 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) +{ + Layer::DumpPacket(aPacket, aParent); +} + CanvasLayer::CanvasLayer(LayerManager* aManager, void* aImplData) : Layer(aManager, aImplData) , mPreTransCallback(nullptr) diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index 530ae8680fb6f..ec6f1ade7d86d 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -18,6 +18,7 @@ #include "gfxRect.h" // for gfxRect #include "gfx2DGlue.h" #include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2, etc +#include "mozilla/Array.h" #include "mozilla/DebugOnly.h" // for DebugOnly #include "mozilla/EventForwards.h" // for nsPaintEvent #include "mozilla/Maybe.h" // for Maybe @@ -87,6 +88,7 @@ class ImageLayer; class ColorLayer; class TextLayer; class CanvasLayer; +class BorderLayer; class ReadbackLayer; class ReadbackProcessor; class RefLayer; @@ -407,6 +409,11 @@ class LayerManager { * Create a TextLayer for this manager's layer tree. */ virtual already_AddRefed CreateTextLayer() = 0; + /** + * CONSTRUCTION PHASE ONLY + * Create a BorderLayer for this manager's layer tree. + */ + virtual already_AddRefed CreateBorderLayer() { return nullptr; } /** * CONSTRUCTION PHASE ONLY * Create a CanvasLayer for this manager's layer tree. @@ -752,6 +759,7 @@ class Layer { TYPE_CONTAINER, TYPE_IMAGE, TYPE_TEXT, + TYPE_BORDER, TYPE_READBACK, TYPE_REF, TYPE_SHADOW, @@ -1536,6 +1544,12 @@ class Layer { */ 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 LayerComposite. Return null if this is not a * LayerComposite. Can be used anytime. @@ -2391,6 +2405,73 @@ class TextLayer : public Layer { RefPtr mFont; }; +/** + * A Layer which renders a rounded rect. + */ +class BorderLayer : public Layer { +public: + virtual BorderLayer* AsBorderLayer() override { return this; } + + /** + * CONSTRUCTION PHASE ONLY + * Set the color of the layer. + */ + + // Colors of each side as in css::Side + virtual void SetColors(const BorderColors& aColors) + { + MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) Colors", this)); + PodCopy(&mColors[0], &aColors[0], 4); + Mutated(); + } + + virtual void SetRect(const LayerRect& aRect) + { + MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) Rect", this)); + mRect = aRect; + Mutated(); + } + + // Size of each rounded corner as in css::Corner, 0.0 means a + // rectangular corner. + virtual void SetCornerRadii(const BorderCorners& aCorners) + { + MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) Corners", this)); + PodCopy(&mCorners[0], &aCorners[0], 4); + Mutated(); + } + + virtual void SetWidths(const BorderWidths& aWidths) + { + MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) Widths", this)); + PodCopy(&mWidths[0], &aWidths[0], 4); + Mutated(); + } + + MOZ_LAYER_DECL_NAME("BorderLayer", TYPE_BORDER) + + virtual void ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransformToSurface) override + { + gfx::Matrix4x4 idealTransform = GetLocalTransform() * aTransformToSurface; + mEffectiveTransform = SnapTransformTranslation(idealTransform, nullptr); + ComputeEffectiveTransformForMaskLayers(aTransformToSurface); + } + +protected: + BorderLayer(LayerManager* aManager, void* aImplData) + : Layer(aManager, aImplData) + {} + + virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) override; + + virtual void DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent) override; + + BorderColors mColors; + LayerRect mRect; + BorderCorners mCorners; + BorderWidths mWidths; +}; + /** * A Layer for HTML Canvas elements. It's backed by either a * gfxASurface or a GLContext (for WebGL layers), and has some control diff --git a/gfx/layers/LayersTypes.h b/gfx/layers/LayersTypes.h index f272bbdc5daed..b7264b0ac088e 100644 --- a/gfx/layers/LayersTypes.h +++ b/gfx/layers/LayersTypes.h @@ -242,6 +242,10 @@ typedef gfx::Matrix4x4Typed CSSTransformMa typedef gfx::Matrix4x4Typed AsyncTransformComponentMatrix; typedef gfx::Matrix4x4Typed AsyncTransformMatrix; +typedef Array BorderColors; +typedef Array BorderCorners; +typedef Array BorderWidths; + } // namespace layers } // namespace mozilla diff --git a/gfx/layers/basic/BasicBorderLayer.cpp b/gfx/layers/basic/BasicBorderLayer.cpp new file mode 100644 index 0000000000000..3861bee031733 --- /dev/null +++ b/gfx/layers/basic/BasicBorderLayer.cpp @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * 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" + +using namespace mozilla::gfx; + +namespace mozilla { +namespace layers { + +class BasicBorderLayer : public BorderLayer, public BasicImplData { +public: + explicit BasicBorderLayer(BasicLayerManager* aLayerManager) : + BorderLayer(aLayerManager, static_cast(this)) + { + MOZ_COUNT_CTOR(BasicBorderLayer); + } + +protected: + virtual ~BasicBorderLayer() + { + MOZ_COUNT_DTOR(BasicBorderLayer); + } + +public: + virtual void SetVisibleRegion(const LayerIntRegion& aRegion) override + { + NS_ASSERTION(BasicManager()->InConstruction(), + "Can only set properties in construction phase"); + BorderLayer::SetVisibleRegion(aRegion); + } + + virtual void Paint(DrawTarget* aDT, + const gfx::Point& aDeviceOffset, + Layer* aMaskLayer) override + { + if (IsHidden()) { + return; + } + + // We currently assume that we never have rounded corners, + // and that all borders have the same width and color. + + ColorPattern color(mColors[0]); + StrokeOptions strokeOptions(mWidths[0]); + + Rect rect = mRect.ToUnknownRect(); + rect.Deflate(mWidths[0] / 2.0); + aDT->StrokeRect(rect, color, strokeOptions); + } + +protected: + BasicLayerManager* BasicManager() + { + return static_cast(mManager); + } +}; + +already_AddRefed +BasicLayerManager::CreateBorderLayer() +{ + NS_ASSERTION(InConstruction(), "Only allowed in construction phase"); + RefPtr layer = new BasicBorderLayer(this); + return layer.forget(); +} + +} // namespace layers +} // namespace mozilla diff --git a/gfx/layers/basic/BasicLayers.h b/gfx/layers/basic/BasicLayers.h index 0f909a2230a71..d0aee0bbf379c 100644 --- a/gfx/layers/basic/BasicLayers.h +++ b/gfx/layers/basic/BasicLayers.h @@ -115,6 +115,7 @@ class BasicLayerManager final : virtual already_AddRefed CreateCanvasLayer() override; virtual already_AddRefed CreateColorLayer() override; virtual already_AddRefed CreateTextLayer() override; + virtual already_AddRefed CreateBorderLayer() override; virtual already_AddRefed CreateReadbackLayer() override; virtual ImageFactory *GetImageFactory(); diff --git a/gfx/layers/client/ClientBorderLayer.cpp b/gfx/layers/client/ClientBorderLayer.cpp new file mode 100644 index 0000000000000..df93af47ff1ba --- /dev/null +++ b/gfx/layers/client/ClientBorderLayer.cpp @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * 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 ClientBorderLayer : public BorderLayer, + public ClientLayer { +public: + explicit ClientBorderLayer(ClientLayerManager* aLayerManager) : + BorderLayer(aLayerManager, static_cast(this)) + { + MOZ_COUNT_CTOR(ClientBorderLayer); + } + +protected: + virtual ~ClientBorderLayer() + { + MOZ_COUNT_DTOR(ClientBorderLayer); + } + +public: + virtual void SetVisibleRegion(const LayerIntRegion& aRegion) + { + NS_ASSERTION(ClientManager()->InConstruction(), + "Can only set properties in construction phase"); + BorderLayer::SetVisibleRegion(aRegion); + } + + virtual void RenderLayer() + { + RenderMaskLayers(this); + } + + virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs) + { + aAttrs = BorderLayerAttributes(mRect, mColors, mCorners, mWidths); + } + + virtual Layer* AsLayer() { return this; } + virtual ShadowableLayer* AsShadowableLayer() { return this; } + + virtual void Disconnect() + { + ClientLayer::Disconnect(); + } + +protected: + ClientLayerManager* ClientManager() + { + return static_cast(mManager); + } +}; + +already_AddRefed +ClientLayerManager::CreateBorderLayer() +{ + NS_ASSERTION(InConstruction(), "Only allowed in construction phase"); + RefPtr layer = + new ClientBorderLayer(this); + CREATE_SHADOW(Border); + return layer.forget(); +} + +} // namespace layers +} // namespace mozilla diff --git a/gfx/layers/client/ClientLayerManager.h b/gfx/layers/client/ClientLayerManager.h index ddadb02fcc0f0..bd1ee7973f6f4 100644 --- a/gfx/layers/client/ClientLayerManager.h +++ b/gfx/layers/client/ClientLayerManager.h @@ -88,6 +88,7 @@ class ClientLayerManager final : public LayerManager virtual already_AddRefed CreateReadbackLayer() override; virtual already_AddRefed CreateColorLayer() override; virtual already_AddRefed CreateTextLayer() override; + virtual already_AddRefed CreateBorderLayer() override; virtual already_AddRefed CreateRefLayer() override; void UpdateTextureFactoryIdentifier(const TextureFactoryIdentifier& aNewIdentifier); diff --git a/gfx/layers/composite/LayerManagerComposite.cpp b/gfx/layers/composite/LayerManagerComposite.cpp index 606b7fc243dce..8f290b00424c5 100644 --- a/gfx/layers/composite/LayerManagerComposite.cpp +++ b/gfx/layers/composite/LayerManagerComposite.cpp @@ -1164,6 +1164,49 @@ class TextLayerComposite : public TextLayer, virtual const char* Name() const override { return "TextLayerComposite"; } }; +class BorderLayerComposite : public BorderLayer, + public LayerComposite +{ +public: + explicit BorderLayerComposite(LayerManagerComposite *aManager) + : BorderLayer(aManager, nullptr) + , LayerComposite(aManager) + { + MOZ_COUNT_CTOR(BorderLayerComposite); + mImplData = static_cast(this); + } + +protected: + ~BorderLayerComposite() + { + MOZ_COUNT_DTOR(BorderLayerComposite); + 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) 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 "BorderLayerComposite"; } +}; + already_AddRefed LayerManagerComposite::CreatePaintedLayer() { @@ -1234,6 +1277,16 @@ LayerManagerComposite::CreateTextLayer() return RefPtr(new TextLayerComposite(this)).forget(); } +already_AddRefed +LayerManagerComposite::CreateBorderLayer() +{ + if (LayerManagerComposite::mDestroyed) { + NS_WARNING("Call on destroyed layer manager"); + return nullptr; + } + return RefPtr(new BorderLayerComposite(this)).forget(); +} + LayerManagerComposite::AutoAddMaskEffect::AutoAddMaskEffect(Layer* aMaskLayer, EffectChain& aEffects) : mCompositable(nullptr), mFailed(false) diff --git a/gfx/layers/composite/LayerManagerComposite.h b/gfx/layers/composite/LayerManagerComposite.h index c335fe8bf2c07..c3f1e614066e6 100644 --- a/gfx/layers/composite/LayerManagerComposite.h +++ b/gfx/layers/composite/LayerManagerComposite.h @@ -240,6 +240,7 @@ class LayerManagerComposite final : public HostLayerManager virtual already_AddRefed CreateImageLayer() override; virtual already_AddRefed CreateColorLayer() override; virtual already_AddRefed CreateTextLayer() override; + virtual already_AddRefed CreateBorderLayer() override; virtual already_AddRefed CreateCanvasLayer() override; virtual already_AddRefed CreateRefLayer() override; diff --git a/gfx/layers/ipc/LayerTransactionParent.cpp b/gfx/layers/ipc/LayerTransactionParent.cpp index 2d03afe74b8e3..0bab39af594fb 100644 --- a/gfx/layers/ipc/LayerTransactionParent.cpp +++ b/gfx/layers/ipc/LayerTransactionParent.cpp @@ -337,6 +337,15 @@ LayerTransactionParent::RecvUpdate(InfallibleTArray&& cset, updateHitTestingTree = true; break; } + case Edit::TOpCreateBorderLayer: { + MOZ_LAYERS_LOG(("[ParentSide] CreateTextLayer")); + + RefPtr layer = layer_manager()->CreateBorderLayer(); + AsLayerComposite(edit.get_OpCreateBorderLayer())->Bind(layer); + + updateHitTestingTree = true; + break; + } case Edit::TOpCreateCanvasLayer: { MOZ_LAYERS_LOG(("[ParentSide] CreateCanvasLayer")); @@ -480,6 +489,19 @@ LayerTransactionParent::RecvUpdate(InfallibleTArray&& cset, textLayer->SetScaledFont(reinterpret_cast(specific.get_TextLayerAttributes().scaledFont())); break; } + case Specific::TBorderLayerAttributes: { + MOZ_LAYERS_LOG(("[ParentSide] border layer")); + + BorderLayer* borderLayer = layerParent->AsBorderLayer(); + if (!borderLayer) { + return IPC_FAIL_NO_REASON(this); + } + borderLayer->SetRect(specific.get_BorderLayerAttributes().rect()); + borderLayer->SetColors(specific.get_BorderLayerAttributes().colors()); + borderLayer->SetCornerRadii(specific.get_BorderLayerAttributes().corners()); + borderLayer->SetWidths(specific.get_BorderLayerAttributes().widths()); + break; + } case Specific::TCanvasLayerAttributes: { MOZ_LAYERS_LOG(("[ParentSide] canvas layer")); diff --git a/gfx/layers/ipc/LayersMessages.ipdlh b/gfx/layers/ipc/LayersMessages.ipdlh index f762885d727d7..03b20b9dd7334 100644 --- a/gfx/layers/ipc/LayersMessages.ipdlh +++ b/gfx/layers/ipc/LayersMessages.ipdlh @@ -33,6 +33,8 @@ using mozilla::dom::ScreenOrientationInternal from "mozilla/dom/ScreenOrientatio using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h"; using mozilla::LayerMargin from "Units.h"; using mozilla::LayerPoint from "Units.h"; +using mozilla::LayerCoord from "Units.h"; +using mozilla::LayerSize from "Units.h"; using mozilla::LayerRect from "Units.h"; using mozilla::LayerIntRegion from "Units.h"; using mozilla::ParentLayerIntRect from "Units.h"; @@ -46,6 +48,9 @@ using mozilla::layers::FrameMetrics::ViewID from "FrameMetrics.h"; using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h"; using mozilla::layers::MaybeLayerClip from "FrameMetrics.h"; using mozilla::gfx::Glyph from "Layers.h"; +using mozilla::layers::BorderColors from "mozilla/layers/LayersTypes.h"; +using mozilla::layers::BorderCorners from "mozilla/layers/LayersTypes.h"; +using mozilla::layers::BorderWidths from "mozilla/layers/LayersTypes.h"; namespace mozilla { namespace layers { @@ -63,6 +68,7 @@ struct OpCreateContainerLayer { PLayer layer; }; struct OpCreateImageLayer { PLayer layer; }; struct OpCreateColorLayer { PLayer layer; }; struct OpCreateTextLayer { PLayer layer; }; +struct OpCreateBorderLayer { PLayer layer; }; struct OpCreateCanvasLayer { PLayer layer; }; struct OpCreateRefLayer { PLayer layer; }; @@ -276,6 +282,12 @@ struct RefLayerAttributes { EventRegionsOverride eventRegionsOverride; }; struct ImageLayerAttributes { SamplingFilter samplingFilter; IntSize scaleToSize; ScaleMode scaleMode; }; +struct BorderLayerAttributes { + LayerRect rect; + BorderColors colors; + BorderCorners corners; + BorderWidths widths; +}; union SpecificLayerAttributes { null_t; @@ -286,6 +298,7 @@ union SpecificLayerAttributes { TextLayerAttributes; RefLayerAttributes; ImageLayerAttributes; + BorderLayerAttributes; }; struct LayerAttributes { @@ -453,6 +466,7 @@ union Edit { OpCreateImageLayer; OpCreateColorLayer; OpCreateTextLayer; + OpCreateBorderLayer; OpCreateCanvasLayer; OpCreateRefLayer; diff --git a/gfx/layers/ipc/ShadowLayerParent.cpp b/gfx/layers/ipc/ShadowLayerParent.cpp index 56ea2ead23f72..9d2902f666179 100644 --- a/gfx/layers/ipc/ShadowLayerParent.cpp +++ b/gfx/layers/ipc/ShadowLayerParent.cpp @@ -112,6 +112,14 @@ ShadowLayerParent::AsTextLayer() const : nullptr; } +BorderLayer* +ShadowLayerParent::AsBorderLayer() const +{ + return mLayer && mLayer->GetType() == Layer::TYPE_BORDER + ? static_cast(mLayer.get()) + : nullptr; +} + void ShadowLayerParent::ActorDestroy(ActorDestroyReason why) { diff --git a/gfx/layers/ipc/ShadowLayerParent.h b/gfx/layers/ipc/ShadowLayerParent.h index 93d8547ab0801..9c747c6bfe976 100644 --- a/gfx/layers/ipc/ShadowLayerParent.h +++ b/gfx/layers/ipc/ShadowLayerParent.h @@ -43,6 +43,7 @@ class ShadowLayerParent : public PLayerParent ColorLayer* AsColorLayer() const; TextLayer* AsTextLayer() const; ImageLayer* AsImageLayer() const; + BorderLayer* AsBorderLayer() const; RefLayer* AsRefLayer() const; PaintedLayer* AsPaintedLayer() const; diff --git a/gfx/layers/ipc/ShadowLayers.cpp b/gfx/layers/ipc/ShadowLayers.cpp index d7e727eace17d..9d8335bcf8b98 100644 --- a/gfx/layers/ipc/ShadowLayers.cpp +++ b/gfx/layers/ipc/ShadowLayers.cpp @@ -271,6 +271,11 @@ ShadowLayerForwarder::CreatedTextLayer(ShadowableLayer* aColor) CreatedLayer(mTxn, aColor); } void +ShadowLayerForwarder::CreatedBorderLayer(ShadowableLayer* aBorder) +{ + CreatedLayer(mTxn, aBorder); +} +void ShadowLayerForwarder::CreatedCanvasLayer(ShadowableLayer* aCanvas) { CreatedLayer(mTxn, aCanvas); diff --git a/gfx/layers/ipc/ShadowLayers.h b/gfx/layers/ipc/ShadowLayers.h index 53edc27d3d186..06005d0b5140a 100644 --- a/gfx/layers/ipc/ShadowLayers.h +++ b/gfx/layers/ipc/ShadowLayers.h @@ -210,6 +210,7 @@ class ShadowLayerForwarder final : public LayersIPCActor 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| diff --git a/gfx/layers/moz.build b/gfx/layers/moz.build index bc8aa699c5db2..21c2a21b9f895 100644 --- a/gfx/layers/moz.build +++ b/gfx/layers/moz.build @@ -274,6 +274,7 @@ UNIFIED_SOURCES += [ 'AsyncCanvasRenderer.cpp', 'AxisPhysicsModel.cpp', 'AxisPhysicsMSDModel.cpp', + 'basic/BasicBorderLayer.cpp', 'basic/BasicCanvasLayer.cpp', 'basic/BasicColorLayer.cpp', 'basic/BasicCompositor.cpp', @@ -288,6 +289,7 @@ UNIFIED_SOURCES += [ 'BufferTexture.cpp', 'BufferUnrotate.cpp', 'client/CanvasClient.cpp', + 'client/ClientBorderLayer.cpp', 'client/ClientCanvasLayer.cpp', 'client/ClientColorLayer.cpp', 'client/ClientContainerLayer.cpp', diff --git a/mfbt/Array.h b/mfbt/Array.h index 72b89ede17665..1636b01133808 100644 --- a/mfbt/Array.h +++ b/mfbt/Array.h @@ -46,6 +46,16 @@ class Array return mArr[aIndex]; } + bool operator==(const Array& aOther) const + { + for (size_t i = 0; i < Length; i++) { + if (mArr[i] != aOther[i]) { + return false; + } + } + return true; + } + typedef T* iterator; typedef const T* const_iterator; typedef ReverseIterator reverse_iterator;