Bug 1383714 - Update to cbindgen 0.1.19. r=kats
MozReview-Commit-ID: FdtZ9Pw0Z2A
--- a/gfx/layers/LayersLogging.h
+++ b/gfx/layers/LayersLogging.h
@@ -17,18 +17,25 @@
#include "nsPrintfCString.h" // for nsPrintfCString
#include "nsRegion.h" // for nsRegion, nsIntRegion
#include "nscore.h" // for nsACString, etc
namespace mozilla {
namespace wr {
struct ColorF;
-struct LayoutRect;
-struct LayoutSize;
+
+struct TypedSize2D_f32__LayerPixel;
+typedef TypedSize2D_f32__LayerPixel LayerSize;
+typedef LayerSize LayoutSize;
+
+struct TypedRect_f32__LayerPixel;
+typedef TypedRect_f32__LayerPixel LayerRect;
+typedef LayerRect LayoutRect;
+
} // namespace wr
namespace gfx {
template <class units, class F> struct RectTyped;
} // namespace gfx
enum class ImageFormat;
--- a/gfx/webrender_bindings/WebRenderAPI.cpp
+++ b/gfx/webrender_bindings/WebRenderAPI.cpp
@@ -204,17 +204,17 @@ WebRenderAPI::GenerateFrame(const nsTArr
aTransformArray.IsEmpty() ?
nullptr : aTransformArray.Elements(),
aTransformArray.Length());
}
void
WebRenderAPI::SetRootDisplayList(gfx::Color aBgColor,
Epoch aEpoch,
- LayerSize aViewportSize,
+ mozilla::LayerSize aViewportSize,
wr::WrPipelineId pipeline_id,
const LayoutSize& content_size,
wr::BuiltDisplayListDescriptor dl_descriptor,
uint8_t *dl_data,
size_t dl_size)
{
wr_api_set_root_display_list(mRenderApi,
ToColorF(aBgColor),
--- a/gfx/webrender_bindings/WebRenderAPI.h
+++ b/gfx/webrender_bindings/WebRenderAPI.h
@@ -54,17 +54,17 @@ public:
void GenerateFrame();
void GenerateFrame(const nsTArray<wr::WrOpacityProperty>& aOpacityArray,
const nsTArray<wr::WrTransformProperty>& aTransformArray);
void SetWindowParameters(LayoutDeviceIntSize size);
void SetRootDisplayList(gfx::Color aBgColor,
Epoch aEpoch,
- LayerSize aViewportSize,
+ mozilla::LayerSize aViewportSize,
wr::WrPipelineId pipeline_id,
const wr::LayoutSize& content_size,
wr::BuiltDisplayListDescriptor dl_descriptor,
uint8_t *dl_data,
size_t dl_size);
void ClearRootDisplayList(Epoch aEpoch,
wr::WrPipelineId pipeline_id);
@@ -138,17 +138,17 @@ protected:
class DisplayListBuilder {
public:
explicit DisplayListBuilder(wr::PipelineId aId,
const wr::LayoutSize& aContentSize);
DisplayListBuilder(DisplayListBuilder&&) = default;
~DisplayListBuilder();
- void Begin(const LayerIntSize& aSize);
+ void Begin(const mozilla::LayerIntSize& aSize);
void End();
void Finalize(wr::LayoutSize& aOutContentSize,
wr::BuiltDisplayList& aOutDisplayList);
void PushStackingContext(const wr::LayoutRect& aBounds, // TODO: We should work with strongly typed rects
const uint64_t& aAnimationId,
const float* aOpacity,
--- a/gfx/webrender_bindings/WebRenderTypes.h
+++ b/gfx/webrender_bindings/WebRenderTypes.h
@@ -337,28 +337,28 @@ static inline wr::BorderStyle ToBorderSt
static inline wr::BorderSide ToBorderSide(const gfx::Color& color, const uint8_t& style)
{
wr::BorderSide bs;
bs.color = ToColorF(color);
bs.style = ToBorderStyle(style);
return bs;
}
-static inline wr::BorderRadius ToUniformBorderRadius(const LayerSize& aSize)
+static inline wr::BorderRadius ToUniformBorderRadius(const mozilla::LayerSize& aSize)
{
wr::BorderRadius br;
br.top_left = ToLayoutSize(aSize);
br.top_right = ToLayoutSize(aSize);
br.bottom_left = ToLayoutSize(aSize);
br.bottom_right = ToLayoutSize(aSize);
return br;
}
-static inline wr::BorderRadius ToBorderRadius(const LayerSize& topLeft, const LayerSize& topRight,
- const LayerSize& bottomLeft, const LayerSize& bottomRight)
+static inline wr::BorderRadius ToBorderRadius(const mozilla::LayerSize& topLeft, const mozilla::LayerSize& topRight,
+ const mozilla::LayerSize& bottomLeft, const mozilla::LayerSize& bottomRight)
{
wr::BorderRadius br;
br.top_left = ToLayoutSize(topLeft);
br.top_right = ToLayoutSize(topRight);
br.bottom_left = ToLayoutSize(bottomLeft);
br.bottom_right = ToLayoutSize(bottomRight);
return br;
}
@@ -435,27 +435,27 @@ static inline wr::WrOpacityProperty ToWr
{
wr::WrOpacityProperty prop;
prop.id = id;
prop.opacity = opacity;
return prop;
}
static inline wr::WrComplexClipRegion ToWrComplexClipRegion(const wr::LayoutRect& rect,
- const LayerSize& size)
+ const mozilla::LayerSize& size)
{
wr::WrComplexClipRegion complex_clip;
complex_clip.rect = rect;
complex_clip.radii = wr::ToUniformBorderRadius(size);
return complex_clip;
}
template<class T>
static inline wr::WrComplexClipRegion ToWrComplexClipRegion(const gfx::RectTyped<T>& rect,
- const LayerSize& size)
+ const mozilla::LayerSize& size)
{
return ToWrComplexClipRegion(wr::ToLayoutRect(rect), size);
}
// Whenever possible, use wr::ExternalImageId instead of manipulating uint64_t.
inline uint64_t AsUint64(const ExternalImageId& aId) {
return static_cast<uint64_t>(aId.mHandle);
}
@@ -483,29 +483,29 @@ static inline wr::WrExternalImage Native
{
return wr::WrExternalImage {
wr::WrExternalImageType::NativeTexture,
aHandle, u0, v0, u1, v1,
nullptr, 0
};
}
-struct VecU8 {
+struct Vec_u8 {
wr::WrVecU8 inner;
- VecU8() {
+ Vec_u8() {
SetEmpty();
}
- VecU8(VecU8&) = delete;
- VecU8(VecU8&& src) {
+ Vec_u8(Vec_u8&) = delete;
+ Vec_u8(Vec_u8&& src) {
inner = src.inner;
src.SetEmpty();
}
- VecU8&
- operator=(VecU8&& src) {
+ Vec_u8&
+ operator=(Vec_u8&& src) {
inner = src.inner;
src.SetEmpty();
return *this;
}
wr::WrVecU8
Extract() {
wr::WrVecU8 ret = inner;
@@ -515,17 +515,17 @@ struct VecU8 {
void
SetEmpty() {
inner.data = (uint8_t*)1;
inner.capacity = 0;
inner.length = 0;
}
- ~VecU8() {
+ ~Vec_u8() {
if (inner.data) {
wr_vec_u8_free(inner);
}
}
};
struct ByteBuffer
{
--- 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.1.18 */
+/* Generated with cbindgen:0.1.19 */
/* 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/rlhunt/cbindgen` and use a tagged release
* 2. Run `cbindgen toolkit/library/rust/ --crate webrender_bindings -o gfx/webrender_bindings/webrender_ffi_generated.h`
*/
@@ -44,16 +44,25 @@ enum class BoxShadowClipMode : uint32_t
enum class ExtendMode : uint32_t {
Clamp = 0,
Repeat = 1,
Sentinel /* this must be last for serialization purposes. */
};
+enum class ExternalImageType : uint32_t {
+ Texture2DHandle = 0,
+ TextureRectHandle = 1,
+ TextureExternalHandle = 2,
+ ExternalBuffer = 3,
+
+ Sentinel /* this must be last for serialization purposes. */
+};
+
enum class ImageFormat : uint32_t {
Invalid = 0,
A8 = 1,
RGB8 = 2,
BGRA8 = 3,
RGBAF32 = 4,
RG8 = 5,
@@ -100,25 +109,16 @@ enum class RepeatMode : uint32_t {
enum class TransformStyle : uint32_t {
Flat = 0,
Preserve3D = 1,
Sentinel /* this must be last for serialization purposes. */
};
-enum class WrExternalImageBufferType : uint32_t {
- Texture2DHandle = 0,
- TextureRectHandle = 1,
- TextureExternalHandle = 2,
- ExternalBuffer = 3,
-
- Sentinel /* this must be last for serialization purposes. */
-};
-
enum class WrExternalImageType : uint32_t {
NativeTexture = 0,
RawData = 1,
Sentinel /* this must be last for serialization purposes. */
};
enum class WrFilterOpType : uint32_t {
@@ -130,49 +130,55 @@ enum class WrFilterOpType : uint32_t {
Invert = 5,
Opacity = 6,
Saturate = 7,
Sepia = 8,
Sentinel /* this must be last for serialization purposes. */
};
-enum class WrYuvColorSpace : uint32_t {
+enum class YuvColorSpace : uint32_t {
Rec601 = 0,
Rec709 = 1,
Sentinel /* this must be last for serialization purposes. */
};
-struct ArcVecU8;
+struct Arc_VecU8;
struct LayerPixel;
struct RenderApi;
struct Renderer;
-struct VecU8;
+struct Vec_u8;
struct WrRenderedEpochs;
struct WrState;
struct WrThreadPool;
-struct WrImageKey {
+typedef Vec_u8 VecU8;
+
+typedef Arc_VecU8 ArcVecU8;
+
+struct ImageKey {
uint32_t mNamespace;
uint32_t mHandle;
- bool operator==(const WrImageKey& aOther) const {
+ bool operator==(const ImageKey& aOther) const {
return mNamespace == aOther.mNamespace &&
mHandle == aOther.mHandle;
}
};
+typedef ImageKey WrImageKey;
+
struct WrImageDescriptor {
ImageFormat format;
uint32_t width;
uint32_t height;
uint32_t stride;
bool is_opaque;
bool operator==(const WrImageDescriptor& aOther) const {
@@ -197,60 +203,72 @@ struct ByteSlice {
struct WrExternalImageId {
uint64_t mHandle;
bool operator==(const WrExternalImageId& aOther) const {
return mHandle == aOther.mHandle;
}
};
-struct WrFontKey {
+typedef ExternalImageType WrExternalImageBufferType;
+
+struct FontKey {
uint32_t mNamespace;
uint32_t mHandle;
- bool operator==(const WrFontKey& aOther) const {
+ bool operator==(const FontKey& aOther) const {
return mNamespace == aOther.mNamespace &&
mHandle == aOther.mHandle;
}
};
-struct WrEpoch {
+typedef FontKey WrFontKey;
+
+struct Epoch {
uint32_t mHandle;
- bool operator==(const WrEpoch& aOther) const {
+ bool operator==(const Epoch& aOther) const {
return mHandle == aOther.mHandle;
}
- bool operator<(const WrEpoch& aOther) const {
+ bool operator<(const Epoch& aOther) const {
return mHandle < aOther.mHandle;
}
- bool operator<=(const WrEpoch& aOther) const {
+ bool operator<=(const Epoch& aOther) const {
return mHandle <= aOther.mHandle;
}
};
-struct WrPipelineId {
+typedef Epoch WrEpoch;
+
+struct PipelineId {
uint32_t mNamespace;
uint32_t mHandle;
- bool operator==(const WrPipelineId& aOther) const {
+ bool operator==(const PipelineId& aOther) const {
return mNamespace == aOther.mNamespace &&
mHandle == aOther.mHandle;
}
};
-struct LayoutSize {
+typedef PipelineId WrPipelineId;
+
+struct TypedSize2D_f32__LayerPixel {
float width;
float height;
- bool operator==(const LayoutSize& aOther) const {
+ bool operator==(const TypedSize2D_f32__LayerPixel& aOther) const {
return width == aOther.width &&
height == aOther.height;
}
};
+typedef TypedSize2D_f32__LayerPixel LayerSize;
+
+typedef LayerSize LayoutSize;
+
struct BuiltDisplayListDescriptor {
uint64_t builder_start_time;
uint64_t builder_finish_time;
bool operator==(const BuiltDisplayListDescriptor& aOther) const {
return builder_start_time == aOther.builder_start_time &&
builder_finish_time == aOther.builder_finish_time;
}
@@ -273,17 +291,17 @@ struct WrOpacityProperty {
float opacity;
bool operator==(const WrOpacityProperty& aOther) const {
return id == aOther.id &&
opacity == aOther.opacity;
}
};
-struct LayoutTransform {
+struct TypedTransform3D_f32__LayoutPixel__LayoutPixel {
float m11;
float m12;
float m13;
float m14;
float m21;
float m22;
float m23;
float m24;
@@ -291,17 +309,17 @@ struct LayoutTransform {
float m32;
float m33;
float m34;
float m41;
float m42;
float m43;
float m44;
- bool operator==(const LayoutTransform& aOther) const {
+ bool operator==(const TypedTransform3D_f32__LayoutPixel__LayoutPixel& aOther) const {
return m11 == aOther.m11 &&
m12 == aOther.m12 &&
m13 == aOther.m13 &&
m14 == aOther.m14 &&
m21 == aOther.m21 &&
m22 == aOther.m22 &&
m23 == aOther.m23 &&
m24 == aOther.m24 &&
@@ -311,35 +329,41 @@ struct LayoutTransform {
m34 == aOther.m34 &&
m41 == aOther.m41 &&
m42 == aOther.m42 &&
m43 == aOther.m43 &&
m44 == aOther.m44;
}
};
+typedef LayerPixel LayoutPixel;
+
+typedef TypedTransform3D_f32__LayoutPixel__LayoutPixel LayoutTransform;
+
struct WrTransformProperty {
uint64_t id;
LayoutTransform transform;
};
-struct WrIdNamespace {
+struct IdNamespace {
uint32_t mHandle;
- bool operator==(const WrIdNamespace& aOther) const {
+ bool operator==(const IdNamespace& aOther) const {
return mHandle == aOther.mHandle;
}
- bool operator<(const WrIdNamespace& aOther) const {
+ bool operator<(const IdNamespace& aOther) const {
return mHandle < aOther.mHandle;
}
- bool operator<=(const WrIdNamespace& aOther) const {
+ bool operator<=(const IdNamespace& aOther) const {
return mHandle <= aOther.mHandle;
}
};
+typedef IdNamespace WrIdNamespace;
+
struct ColorF {
float r;
float g;
float b;
float a;
bool operator==(const ColorF& aOther) const {
return r == aOther.r &&
@@ -354,36 +378,30 @@ struct TypedPoint2D_f32__LayerPixel {
float y;
bool operator==(const TypedPoint2D_f32__LayerPixel& aOther) const {
return x == aOther.x &&
y == aOther.y;
}
};
-struct TypedSize2D_f32__LayerPixel {
- float width;
- float height;
-
- bool operator==(const TypedSize2D_f32__LayerPixel& aOther) const {
- return width == aOther.width &&
- height == aOther.height;
- }
-};
-
-struct LayoutRect {
+struct TypedRect_f32__LayerPixel {
TypedPoint2D_f32__LayerPixel origin;
TypedSize2D_f32__LayerPixel size;
- bool operator==(const LayoutRect& aOther) const {
+ bool operator==(const TypedRect_f32__LayerPixel& aOther) const {
return origin == aOther.origin &&
size == aOther.size;
}
};
+typedef TypedRect_f32__LayerPixel LayerRect;
+
+typedef LayerRect LayoutRect;
+
struct BorderWidths {
float left;
float top;
float right;
float bottom;
bool operator==(const BorderWidths& aOther) const {
return left == aOther.left &&
@@ -412,86 +430,84 @@ struct BorderRadius {
bool operator==(const BorderRadius& aOther) const {
return top_left == aOther.top_left &&
top_right == aOther.top_right &&
bottom_left == aOther.bottom_left &&
bottom_right == aOther.bottom_right;
}
};
-struct LayoutPoint {
- float x;
- float y;
+typedef TypedPoint2D_f32__LayerPixel LayerPoint;
- bool operator==(const LayoutPoint& aOther) const {
- return x == aOther.x &&
- y == aOther.y;
- }
-};
+typedef LayerPoint LayoutPoint;
struct GradientStop {
float offset;
ColorF color;
bool operator==(const GradientStop& aOther) const {
return offset == aOther.offset &&
color == aOther.color;
}
};
+struct SideOffsets2D_u32 {
+ uint32_t top;
+ uint32_t right;
+ uint32_t bottom;
+ uint32_t left;
+
+ bool operator==(const SideOffsets2D_u32& aOther) const {
+ return top == aOther.top &&
+ right == aOther.right &&
+ bottom == aOther.bottom &&
+ left == aOther.left;
+ }
+};
+
struct SideOffsets2D_f32 {
float top;
float right;
float bottom;
float left;
bool operator==(const SideOffsets2D_f32& aOther) const {
return top == aOther.top &&
right == aOther.right &&
bottom == aOther.bottom &&
left == aOther.left;
}
};
-struct SideOffsets2D_u32 {
- uint32_t top;
- uint32_t right;
- uint32_t bottom;
- uint32_t left;
-
- bool operator==(const SideOffsets2D_u32& aOther) const {
- return top == aOther.top &&
- right == aOther.right &&
- bottom == aOther.bottom &&
- left == aOther.left;
- }
-};
-
struct NinePatchDescriptor {
uint32_t width;
uint32_t height;
SideOffsets2D_u32 slice;
bool operator==(const NinePatchDescriptor& aOther) const {
return width == aOther.width &&
height == aOther.height &&
slice == aOther.slice;
}
};
-struct LayoutVector2D {
+struct TypedVector2D_f32__LayerPixel {
float x;
float y;
- bool operator==(const LayoutVector2D& aOther) const {
+ bool operator==(const TypedVector2D_f32__LayerPixel& aOther) const {
return x == aOther.x &&
y == aOther.y;
}
};
+typedef TypedVector2D_f32__LayerPixel LayerVector2D;
+
+typedef LayerVector2D LayoutVector2D;
+
struct WrComplexClipRegion {
LayoutRect rect;
BorderRadius radii;
bool operator==(const WrComplexClipRegion& aOther) const {
return rect == aOther.rect &&
radii == aOther.radii;
}
@@ -524,16 +540,18 @@ struct GlyphInstance {
LayoutPoint point;
bool operator==(const GlyphInstance& aOther) const {
return index == aOther.index &&
point == aOther.point;
}
};
+typedef YuvColorSpace WrYuvColorSpace;
+
struct MutByteSlice {
uint8_t *buffer;
size_t len;
bool operator==(const MutByteSlice& aOther) const {
return buffer == aOther.buffer &&
len == aOther.len;
}