Bug 1456114 - Update for WR PR 2679. r?jrmuizel
MozReview-Commit-ID: GrFwU62DcWU
--- a/gfx/layers/wr/WebRenderBridgeChild.cpp
+++ b/gfx/layers/wr/WebRenderBridgeChild.cpp
@@ -267,17 +267,17 @@ WriteFontDescriptor(const uint8_t* aData
*sink->mFontKey = sink->mWrBridge->GetNextFontKey();
sink->mResources->AddFontDescriptor(*sink->mFontKey, Range<uint8_t>(const_cast<uint8_t*>(aData), aLength), aIndex);
}
void
WebRenderBridgeChild::PushGlyphs(wr::DisplayListBuilder& aBuilder, Range<const wr::GlyphInstance> aGlyphs,
gfx::ScaledFont* aFont, const wr::ColorF& aColor, const StackingContextHelper& aSc,
- const wr::LayerRect& aBounds, const wr::LayerRect& aClip, bool aBackfaceVisible,
+ const wr::LayoutRect& aBounds, const wr::LayoutRect& aClip, bool aBackfaceVisible,
const wr::GlyphOptions* aGlyphOptions)
{
MOZ_ASSERT(aFont);
wr::WrFontInstanceKey key = GetFontKeyForScaledFont(aFont);
MOZ_ASSERT(key.mNamespace.mHandle && key.mHandle);
aBuilder.PushText(aBounds,
--- a/gfx/layers/wr/WebRenderBridgeChild.h
+++ b/gfx/layers/wr/WebRenderBridgeChild.h
@@ -128,17 +128,17 @@ public:
wr::WrImageKey GetNextImageKey()
{
return wr::WrImageKey{ GetNamespace(), GetNextResourceId() };
}
void PushGlyphs(wr::DisplayListBuilder& aBuilder, Range<const wr::GlyphInstance> aGlyphs,
gfx::ScaledFont* aFont, const wr::ColorF& aColor,
const StackingContextHelper& aSc,
- const wr::LayerRect& aBounds, const wr::LayerRect& aClip,
+ const wr::LayoutRect& aBounds, const wr::LayoutRect& aClip,
bool aBackfaceVisible,
const wr::GlyphOptions* aGlyphOptions = nullptr);
wr::FontInstanceKey GetFontKeyForScaledFont(gfx::ScaledFont* aScaledFont);
wr::FontKey GetFontKeyForUnscaledFont(gfx::UnscaledFont* aUnscaledFont);
void RemoveExpiredFontKeys(wr::IpcResourceUpdateQueue& aResources);
--- a/gfx/webrender_bindings/webrender_ffi_generated.h
+++ b/gfx/webrender_bindings/webrender_ffi_generated.h
@@ -1,13 +1,13 @@
/* 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/. */
-/* Generated with cbindgen:0.5.2 */
+/* Generated with cbindgen:0.6.0 */
/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
* To generate this file:
* 1. Get the latest cbindgen using `cargo install --force cbindgen`
* a. Alternatively, you can clone `https://github.com/eqrion/cbindgen` and use a tagged release
* 2. Run `rustup run nightly cbindgen toolkit/library/rust/ --lockfile Cargo.lock --crate webrender_bindings -o gfx/webrender_bindings/webrender_ffi_generated.h`
*/
@@ -214,18 +214,18 @@ template<typename T>
struct Arc;
// Geometry in the coordinate system of the render target (screen or intermediate
// surface) in physical pixels.
struct DevicePixel;
struct DocumentHandle;
-// Geometry in a layer's local coordinate space (logical pixels).
-struct LayerPixel;
+// Geometry in a stacking context's local coordinate space (logical pixels).
+struct LayoutPixel;
// The renderer is responsible for submitting to the GPU the work prepared by the
// RenderBackend.
struct Renderer;
// The resource updates for a given transaction (they must be applied in the same frame).
struct ResourceUpdates;
@@ -381,19 +381,17 @@ struct TypedSize2D {
bool operator==(const TypedSize2D& aOther) const {
return width == aOther.width &&
height == aOther.height;
}
};
using DeviceUintSize = TypedSize2D<uint32_t, DevicePixel>;
-using LayerSize = TypedSize2D<float, LayerPixel>;
-
-using LayoutSize = LayerSize;
+using LayoutSize = TypedSize2D<float, LayoutPixel>;
// Describes the memory layout of a display list.
//
// A display list consists of some number of display list items, followed by a number of display
// items.
struct BuiltDisplayListDescriptor {
// The first IPC time stamp: before any work has been done
uint64_t builder_start_time;
@@ -445,19 +443,17 @@ struct TypedRect {
TypedSize2D<T, U> size;
bool operator==(const TypedRect& aOther) const {
return origin == aOther.origin &&
size == aOther.size;
}
};
-using LayerRect = TypedRect<float, LayerPixel>;
-
-using LayoutRect = LayerRect;
+using LayoutRect = TypedRect<float, LayoutPixel>;
struct BorderRadius {
LayoutSize top_left;
LayoutSize top_right;
LayoutSize bottom_left;
LayoutSize bottom_right;
bool operator==(const BorderRadius& aOther) const {
@@ -536,19 +532,17 @@ struct TypedVector2D {
T y;
bool operator==(const TypedVector2D& aOther) const {
return x == aOther.x &&
y == aOther.y;
}
};
-using LayerVector2D = TypedVector2D<float, LayerPixel>;
-
-using LayoutVector2D = LayerVector2D;
+using LayoutVector2D = TypedVector2D<float, LayoutPixel>;
struct BorderWidths {
float left;
float top;
float right;
float bottom;
bool operator==(const BorderWidths& aOther) const {
@@ -582,19 +576,17 @@ struct BorderSide {
BorderStyle style;
bool operator==(const BorderSide& aOther) const {
return color == aOther.color &&
style == aOther.style;
}
};
-using LayerPoint = TypedPoint2D<float, LayerPixel>;
-
-using LayoutPoint = LayerPoint;
+using LayoutPoint = TypedPoint2D<float, LayoutPixel>;
struct GradientStop {
float offset;
ColorF color;
bool operator==(const GradientStop& aOther) const {
return offset == aOther.offset &&
color == aOther.color;
@@ -649,21 +641,16 @@ struct WrAnimationProperty {
uint64_t id;
bool operator==(const WrAnimationProperty& aOther) const {
return effect_type == aOther.effect_type &&
id == aOther.id;
}
};
-// Geometry in a stacking context's local coordinate space (logical pixels).
-//
-// For now layout pixels are equivalent to layer pixels, but it may change.
-using LayoutPixel = LayerPixel;
-
// A 3d transform stored as a 4 by 4 matrix in row-major order in memory.
//
// Transforms can be parametrized over the source and destination units, to describe a
// transformation from a space to another.
// For example, `TypedTransform3D<f32, WorldSpace, ScreenSpace>::transform_point3d`
// takes a `TypedPoint3D<f32, WorldSpace>` and returns a `TypedPoint3D<f32, ScreenSpace>`.
//
// Transforms expose a set of convenience methods for pre- and post-transformations.
--- a/layout/generic/TextDrawTarget.h
+++ b/layout/generic/TextDrawTarget.h
@@ -298,17 +298,17 @@ public:
? wr::LineOrientation::Vertical
: wr::LineOrientation::Horizontal;
decoration.style = wr::LineStyle::Wavy;
mBuilder.PushLine(ClipRect(), mBackfaceVisible, decoration);
}
private:
- wr::LayerRect ClipRect()
+ wr::LayoutRect ClipRect()
{
return wr::ToRoundedLayoutRect(mClipStack.LastElement());
}
// Whether anything unsupported was encountered. Currently:
//
// * Synthetic bold/italics
// * SVG fonts
// * Unserializable fonts
@@ -323,17 +323,17 @@ private:
// Things used to push to webrender
wr::DisplayListBuilder& mBuilder;
const layers::StackingContextHelper& mSc;
layers::WebRenderLayerManager* mManager;
// Computed facts
IntSize mSize;
- wr::LayerRect mBoundsRect;
+ wr::LayoutRect mBoundsRect;
nsTArray<LayoutDeviceRect> mClipStack;
bool mBackfaceVisible;
wr::FontInstanceFlags mWRGlyphFlags = {0};
// The rest of this is dummy implementations of DrawTarget's API
public:
DrawTargetType GetType() const override {