Bug 1362925 - Update webrender_bindings for cbindgen:0.1.7 r?kats draft
authorRyan Hunt <rhunt@eqrion.net>
Mon, 08 May 2017 01:31:20 -0400
changeset 573928 deace018f5d25f3eeecd5d4d683bb4f9a782a05c
parent 573926 93f41e15c9a7e3340277e1e32bd268e05d3f6618
child 627439 ef5c6748dcb1d033b1206e6c1b3515ff0d582755
push id57540
push userbmo:rhunt@eqrion.net
push dateMon, 08 May 2017 05:47:28 +0000
reviewerskats
bugs1362925
milestone55.0a1
Bug 1362925 - Update webrender_bindings for cbindgen:0.1.7 r?kats MozReview-Commit-ID: AwlqUWWEWfz
gfx/webrender_bindings/cbindgen.toml
gfx/webrender_bindings/src/bindings.rs
gfx/webrender_bindings/webrender_ffi.h
gfx/webrender_bindings/webrender_ffi_generated.h
new file mode 100644
--- /dev/null
+++ b/gfx/webrender_bindings/cbindgen.toml
@@ -0,0 +1,23 @@
+header = """/* 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/. */"""
+autogen_warning = """/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
+ * To generate this file, clone `https://github.com/rlhunt/cbindgen` or run `cargo install cbindgen`,
+ * then run `cbindgen gfx/webrender_bindings/ -o gfx/webrender_bindings/webrender_ffi_generated.h` */"""
+include_version = true
+braces = "SameLine"
+line_length = 100
+tab_width = 2
+language = "C++"
+
+[fn]
+prefix = "WR_INLINE"
+postfix = "WR_FUNC"
+args = "Vertical"
+rename_args = "GeckoCase"
+
+[struct]
+derive_eq = true
+
+[enum]
+add_sentinel = true
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -29,22 +29,22 @@ type WrBuiltDisplayListDescriptor = Buil
 type WrImageFormat = ImageFormat;
 type WrImageRendering = ImageRendering;
 type WrMixBlendMode = MixBlendMode;
 type WrRenderer = Renderer;
 type WrSideOffsets2Du32 = WrSideOffsets2D<u32>;
 type WrSideOffsets2Df32 = WrSideOffsets2D<f32>;
 
 /// cbindgen:field-names=[mHandle]
-/// cbindgen:struct-gen-op-lt=true
-/// cbindgen:struct-gen-op-lte=true
+/// cbindgen:derive-lt=true
+/// cbindgen:derive-lte=true
 type WrEpoch = Epoch;
 /// cbindgen:field-names=[mHandle]
-/// cbindgen:struct-gen-op-lt=true
-/// cbindgen:struct-gen-op-lte=true
+/// cbindgen:derive-lt=true
+/// cbindgen:derive-lte=true
 type WrIdNamespace = IdNamespace;
 
 /// cbindgen:field-names=[mNamespace, mHandle]
 type WrPipelineId = PipelineId;
 /// cbindgen:field-names=[mNamespace, mHandle]
 type WrImageKey = ImageKey;
 /// cbindgen:field-names=[mNamespace, mHandle]
 type WrFontKey = FontKey;
@@ -596,18 +596,18 @@ impl ExternalImageHandler for WrExternal
     fn unlock(&mut self,
               id: ExternalImageId,
               channel_index: u8) {
         (self.unlock_func)(self.external_image_obj, id.into(), channel_index);
     }
 }
 
 /// cbindgen:field-names=[mHandle]
-/// cbindgen:struct-gen-op-lt=true
-/// cbindgen:struct-gen-op-lte=true
+/// cbindgen:derive-lt=true
+/// cbindgen:derive-lte=true
 #[repr(C)]
 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
 pub struct WrWindowId(u64);
 
 #[repr(C)]
 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
 pub struct WrImageDescriptor {
     pub format: WrImageFormat,
@@ -656,16 +656,17 @@ impl WrVecU8 {
     }
 }
 
 #[no_mangle]
 pub extern "C" fn wr_vec_u8_free(v: WrVecU8) {
     v.to_vec();
 }
 
+/// cbindgen:derive-eq=false
 #[repr(C)]
 #[derive(Debug)]
 pub struct WrTransformProperty {
     pub id: u64,
     pub transform: WrMatrix,
 }
 
 #[repr(C)]
@@ -803,17 +804,17 @@ pub extern "C" fn wr_renderer_current_ep
                                             -> bool {
     if let Some(epoch) = renderer.current_epoch(pipeline_id) {
         *out_epoch = epoch;
         return true;
     }
     return false;
 }
 
-/// cbindgen:function-postfix=WR_DESTRUCTOR_SAFE_FUNC
+/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
 #[no_mangle]
 pub unsafe extern "C" fn wr_renderer_delete(renderer: *mut WrRenderer) {
     Box::from_raw(renderer);
 }
 
 pub struct WrRenderedEpochs {
     data: Vec<(WrPipelineId, WrEpoch)>,
 }
@@ -835,17 +836,17 @@ pub unsafe extern "C" fn wr_rendered_epo
     if let Some((pipeline, epoch)) = pipeline_epochs.data.pop() {
         *out_pipeline = pipeline;
         *out_epoch = epoch;
         return true;
     }
     return false;
 }
 
-/// cbindgen:function-postfix=WR_DESTRUCTOR_SAFE_FUNC
+/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
 #[no_mangle]
 pub unsafe extern "C" fn wr_rendered_epochs_delete(pipeline_epochs: *mut WrRenderedEpochs) {
     Box::from_raw(pipeline_epochs);
 }
 
 // Call MakeCurrent before this.
 #[no_mangle]
 pub extern "C" fn wr_window_new(window_id: WrWindowId,
@@ -904,17 +905,17 @@ pub extern "C" fn wr_window_new(window_i
                                           }));
 
     *out_api = Box::into_raw(Box::new(sender.create_api()));
     *out_renderer = Box::into_raw(Box::new(renderer));
 
     return true;
 }
 
-/// cbindgen:function-postfix=WR_DESTRUCTOR_SAFE_FUNC
+/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
 #[no_mangle]
 pub unsafe extern "C" fn wr_api_delete(api: *mut WrAPI) {
     let api = Box::from_raw(api);
     api.shut_down();
 }
 
 #[no_mangle]
 pub extern "C" fn wr_api_add_image(api: &mut WrAPI,
@@ -1098,17 +1099,17 @@ pub extern "C" fn wr_api_generate_frame_
             };
             properties.floats.push(prop);
         }
     }
 
     api.generate_frame(Some(properties));
 }
 
-/// cbindgen:function-postfix=WR_DESTRUCTOR_SAFE_FUNC
+/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
 #[no_mangle]
 pub extern "C" fn wr_api_send_external_event(api: &mut WrAPI,
                                              evt: usize) {
     assert!(unsafe { !is_in_render_thread() });
 
     api.send_external_event(ExternalEvent::from_raw(evt));
 }
 
@@ -1176,17 +1177,17 @@ pub extern "C" fn wr_state_new(pipeline_
     let state = Box::new(WrState {
                              pipeline_id: pipeline_id,
                              frame_builder: WebRenderFrameBuilder::new(pipeline_id),
                          });
 
     Box::into_raw(state)
 }
 
-/// cbindgen:function-postfix=WR_DESTRUCTOR_SAFE_FUNC
+/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
 #[no_mangle]
 pub extern "C" fn wr_state_delete(state: *mut WrState) {
     assert!(unsafe { is_in_main_thread() });
 
     unsafe {
         Box::from_raw(state);
     }
 }
--- a/gfx/webrender_bindings/webrender_ffi.h
+++ b/gfx/webrender_bindings/webrender_ffi.h
@@ -18,16 +18,18 @@ extern "C" {
 
 bool is_in_compositor_thread();
 bool is_in_main_thread();
 bool is_in_render_thread();
 bool is_glcontext_egl(void* glcontext_ptr);
 void gfx_critical_note(const char* msg);
 void* get_proc_address_from_glcontext(void* glcontext_ptr, const char* procname);
 
+} // extern "C"
+
 // Some useful defines to stub out webrender binding functions for when we
 // build gecko without webrender. We try to tell the compiler these functions
 // are unreachable in that case, but VC++ emits a warning if it finds any
 // unreachable functions invoked from destructors. That warning gets turned into
 // an error and causes the build to fail. So for wr_* functions called by
 // destructors in C++ classes, use WR_DESTRUCTOR_SAFE_FUNC instead, which omits
 // the unreachable annotation.
 #ifdef MOZ_BUILD_WEBRENDER
@@ -39,17 +41,16 @@ void* get_proc_address_from_glcontext(vo
 #  define WR_FUNC { MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("WebRender disabled"); }
 #  define WR_DESTRUCTOR_SAFE_FUNC {}
 #endif
 
 #include "webrender_ffi_generated.h"
 
 #undef WR_FUNC
 #undef WR_DESTRUCTOR_SAFE_FUNC
-} // extern "C"
 
 struct WrGlyphArray
 {
   mozilla::gfx::Color color;
   nsTArray<WrGlyphInstance> glyphs;
 
   bool operator==(const WrGlyphArray& other) const
   {
--- a/gfx/webrender_bindings/webrender_ffi_generated.h
+++ b/gfx/webrender_bindings/webrender_ffi_generated.h
@@ -1,17 +1,21 @@
 /* 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.6 */
+/* Generated with cbindgen:0.1.7 */
 
 /* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
  * To generate this file, clone `https://github.com/rlhunt/cbindgen` or run `cargo install cbindgen`,
- * then run `cbindgen -c wr gfx/webrender_bindings/ gfx/webrender_bindings/webrender_ffi_generated.h` */
+ * then run `cbindgen gfx/webrender_bindings/ -o gfx/webrender_bindings/webrender_ffi_generated.h` */
+
+#include <stdint.h>
+
+extern "C" {
 
 enum class WrBorderStyle : uint32_t {
   None = 0,
   Solid = 1,
   Double = 2,
   Dotted = 3,
   Dashed = 4,
   Hidden = 5,
@@ -104,43 +108,43 @@ enum class WrYuvColorSpace : uint32_t {
 struct WrAPI;
 
 struct WrImageKey {
   uint32_t mNamespace;
   uint32_t mHandle;
 
   bool operator==(const WrImageKey& aOther) const {
     return mNamespace == aOther.mNamespace &&
-      mHandle == aOther.mHandle;
+           mHandle == aOther.mHandle;
   }
 };
 
 struct WrImageDescriptor {
   WrImageFormat format;
   uint32_t width;
   uint32_t height;
   uint32_t stride;
   bool is_opaque;
 
   bool operator==(const WrImageDescriptor& aOther) const {
     return format == aOther.format &&
-      width == aOther.width &&
-      height == aOther.height &&
-      stride == aOther.stride &&
-      is_opaque == aOther.is_opaque;
+           width == aOther.width &&
+           height == aOther.height &&
+           stride == aOther.stride &&
+           is_opaque == aOther.is_opaque;
   }
 };
 
 struct WrByteSlice {
   const uint8_t* buffer;
   size_t len;
 
   bool operator==(const WrByteSlice& aOther) const {
     return buffer == aOther.buffer &&
-      len == aOther.len;
+           len == aOther.len;
   }
 };
 
 struct WrExternalImageId {
   uint64_t mHandle;
 
   bool operator==(const WrExternalImageId& aOther) const {
     return mHandle == aOther.mHandle;
@@ -148,343 +152,328 @@ struct WrExternalImageId {
 };
 
 struct WrFontKey {
   uint32_t mNamespace;
   uint32_t mHandle;
 
   bool operator==(const WrFontKey& aOther) const {
     return mNamespace == aOther.mNamespace &&
-      mHandle == aOther.mHandle;
+           mHandle == aOther.mHandle;
   }
 };
 
 struct WrEpoch {
   uint32_t mHandle;
 
   bool operator==(const WrEpoch& aOther) const {
     return mHandle == aOther.mHandle;
   }
-
   bool operator<(const WrEpoch& aOther) const {
     return mHandle < aOther.mHandle;
   }
-
   bool operator<=(const WrEpoch& aOther) const {
     return mHandle <= aOther.mHandle;
   }
 };
 
 struct WrPipelineId {
   uint32_t mNamespace;
   uint32_t mHandle;
 
   bool operator==(const WrPipelineId& aOther) const {
     return mNamespace == aOther.mNamespace &&
-      mHandle == aOther.mHandle;
+           mHandle == aOther.mHandle;
   }
 };
 
 struct WrState;
 
 struct WrBuiltDisplayListDescriptor {
   size_t display_list_items_size;
   uint64_t builder_start_time;
   uint64_t builder_finish_time;
 
   bool operator==(const WrBuiltDisplayListDescriptor& aOther) const {
     return display_list_items_size == aOther.display_list_items_size &&
-      builder_start_time == aOther.builder_start_time &&
-      builder_finish_time == aOther.builder_finish_time;
+           builder_start_time == aOther.builder_start_time &&
+           builder_finish_time == aOther.builder_finish_time;
   }
 };
 
 struct WrVecU8 {
   uint8_t* data;
   size_t length;
   size_t capacity;
 
   bool operator==(const WrVecU8& aOther) const {
     return data == aOther.data &&
-      length == aOther.length &&
-      capacity == aOther.capacity;
+           length == aOther.length &&
+           capacity == aOther.capacity;
   }
 };
 
 struct WrAuxiliaryListsDescriptor {
   size_t gradient_stops_size;
   size_t complex_clip_regions_size;
   size_t filters_size;
   size_t glyph_instances_size;
 
   bool operator==(const WrAuxiliaryListsDescriptor& aOther) const {
     return gradient_stops_size == aOther.gradient_stops_size &&
-      complex_clip_regions_size == aOther.complex_clip_regions_size &&
-      filters_size == aOther.filters_size &&
-      glyph_instances_size == aOther.glyph_instances_size;
+           complex_clip_regions_size == aOther.complex_clip_regions_size &&
+           filters_size == aOther.filters_size &&
+           glyph_instances_size == aOther.glyph_instances_size;
   }
 };
 
 struct WrOpacityProperty {
   uint64_t id;
   float opacity;
 
   bool operator==(const WrOpacityProperty& aOther) const {
     return id == aOther.id &&
-      opacity == aOther.opacity;
+           opacity == aOther.opacity;
   }
 };
 
 struct WrMatrix {
   float values[16];
-
-  bool operator==(const WrMatrix& aOther) const {
-    return values == aOther.values;
-  }
 };
 
 struct WrTransformProperty {
   uint64_t id;
   WrMatrix transform;
-
-  bool operator==(const WrTransformProperty& aOther) const {
-    return id == aOther.id &&
-      transform == aOther.transform;
-  }
 };
 
 struct WrIdNamespace {
   uint32_t mHandle;
 
   bool operator==(const WrIdNamespace& aOther) const {
     return mHandle == aOther.mHandle;
   }
-
   bool operator<(const WrIdNamespace& aOther) const {
     return mHandle < aOther.mHandle;
   }
-
   bool operator<=(const WrIdNamespace& aOther) const {
     return mHandle <= aOther.mHandle;
   }
 };
 
 struct WrRect {
   float x;
   float y;
   float width;
   float height;
 
   bool operator==(const WrRect& aOther) const {
     return x == aOther.x &&
-      y == aOther.y &&
-      width == aOther.width &&
-      height == aOther.height;
+           y == aOther.y &&
+           width == aOther.width &&
+           height == aOther.height;
   }
 };
 
 struct WrItemRange {
   size_t start;
   size_t length;
 
   bool operator==(const WrItemRange& aOther) const {
     return start == aOther.start &&
-      length == aOther.length;
+           length == aOther.length;
   }
 };
 
 struct WrImageMask {
   WrImageKey image;
   WrRect rect;
   bool repeat;
 
   bool operator==(const WrImageMask& aOther) const {
     return image == aOther.image &&
-      rect == aOther.rect &&
-      repeat == aOther.repeat;
+           rect == aOther.rect &&
+           repeat == aOther.repeat;
   }
 };
 
 struct WrClipRegion {
   WrRect main;
   WrItemRange complex;
   WrImageMask image_mask;
   bool has_image_mask;
 
   bool operator==(const WrClipRegion& aOther) const {
     return main == aOther.main &&
-      complex == aOther.complex &&
-      image_mask == aOther.image_mask &&
-      has_image_mask == aOther.has_image_mask;
+           complex == aOther.complex &&
+           image_mask == aOther.image_mask &&
+           has_image_mask == aOther.has_image_mask;
   }
 };
 
 struct WrSize {
   float width;
   float height;
 
   bool operator==(const WrSize& aOther) const {
     return width == aOther.width &&
-      height == aOther.height;
+           height == aOther.height;
   }
 };
 
 struct WrBorderRadius {
   WrSize top_left;
   WrSize top_right;
   WrSize bottom_left;
   WrSize bottom_right;
 
   bool operator==(const WrBorderRadius& aOther) const {
     return top_left == aOther.top_left &&
-      top_right == aOther.top_right &&
-      bottom_left == aOther.bottom_left &&
-      bottom_right == aOther.bottom_right;
+           top_right == aOther.top_right &&
+           bottom_left == aOther.bottom_left &&
+           bottom_right == aOther.bottom_right;
   }
 };
 
 struct WrComplexClipRegion {
   WrRect rect;
   WrBorderRadius radii;
 
   bool operator==(const WrComplexClipRegion& aOther) const {
     return rect == aOther.rect &&
-      radii == aOther.radii;
+           radii == aOther.radii;
   }
 };
 
 struct WrBorderWidths {
   float left;
   float top;
   float right;
   float bottom;
 
   bool operator==(const WrBorderWidths& aOther) const {
     return left == aOther.left &&
-      top == aOther.top &&
-      right == aOther.right &&
-      bottom == aOther.bottom;
+           top == aOther.top &&
+           right == aOther.right &&
+           bottom == aOther.bottom;
   }
 };
 
 struct WrColor {
   float r;
   float g;
   float b;
   float a;
 
   bool operator==(const WrColor& aOther) const {
     return r == aOther.r &&
-      g == aOther.g &&
-      b == aOther.b &&
-      a == aOther.a;
+           g == aOther.g &&
+           b == aOther.b &&
+           a == aOther.a;
   }
 };
 
 struct WrBorderSide {
   WrColor color;
   WrBorderStyle style;
 
   bool operator==(const WrBorderSide& aOther) const {
     return color == aOther.color &&
-      style == aOther.style;
+           style == aOther.style;
   }
 };
 
 struct WrPoint {
   float x;
   float y;
 
   bool operator==(const WrPoint& aOther) const {
     return x == aOther.x &&
-      y == aOther.y;
+           y == aOther.y;
   }
 };
 
 struct WrGradientStop {
   float offset;
   WrColor color;
 
   bool operator==(const WrGradientStop& aOther) const {
     return offset == aOther.offset &&
-      color == aOther.color;
+           color == aOther.color;
   }
 };
 
 struct WrSideOffsets2Df32 {
   float top;
   float right;
   float bottom;
   float left;
 
   bool operator==(const WrSideOffsets2Df32& aOther) const {
     return top == aOther.top &&
-      right == aOther.right &&
-      bottom == aOther.bottom &&
-      left == aOther.left;
+           right == aOther.right &&
+           bottom == aOther.bottom &&
+           left == aOther.left;
   }
 };
 
 struct WrSideOffsets2Du32 {
   uint32_t top;
   uint32_t right;
   uint32_t bottom;
   uint32_t left;
 
   bool operator==(const WrSideOffsets2Du32& aOther) const {
     return top == aOther.top &&
-      right == aOther.right &&
-      bottom == aOther.bottom &&
-      left == aOther.left;
+           right == aOther.right &&
+           bottom == aOther.bottom &&
+           left == aOther.left;
   }
 };
 
 struct WrNinePatchDescriptor {
   uint32_t width;
   uint32_t height;
   WrSideOffsets2Du32 slice;
 
   bool operator==(const WrNinePatchDescriptor& aOther) const {
     return width == aOther.width &&
-      height == aOther.height &&
-      slice == aOther.slice;
+           height == aOther.height &&
+           slice == aOther.slice;
   }
 };
 
 struct WrGlyphInstance {
   uint32_t index;
   WrPoint point;
 
   bool operator==(const WrGlyphInstance& aOther) const {
     return index == aOther.index &&
-      point == aOther.point;
+           point == aOther.point;
   }
 };
 
 struct MutByteSlice {
   uint8_t* buffer;
   size_t len;
 
   bool operator==(const MutByteSlice& aOther) const {
     return buffer == aOther.buffer &&
-      len == aOther.len;
+           len == aOther.len;
   }
 };
 
 struct WrWindowId {
   uint64_t mHandle;
 
   bool operator==(const WrWindowId& aOther) const {
     return mHandle == aOther.mHandle;
   }
-
   bool operator<(const WrWindowId& aOther) const {
     return mHandle < aOther.mHandle;
   }
-
   bool operator<=(const WrWindowId& aOther) const {
     return mHandle <= aOther.mHandle;
   }
 };
 
 struct WrRenderedEpochs;
 
 struct WrRenderer;
@@ -496,425 +485,427 @@ struct WrExternalImage {
   float v0;
   float u1;
   float v1;
   const uint8_t* buff;
   size_t size;
 
   bool operator==(const WrExternalImage& aOther) const {
     return image_type == aOther.image_type &&
-      handle == aOther.handle &&
-      u0 == aOther.u0 &&
-      v0 == aOther.v0 &&
-      u1 == aOther.u1 &&
-      v1 == aOther.v1 &&
-      buff == aOther.buff &&
-      size == aOther.size;
+           handle == aOther.handle &&
+           u0 == aOther.u0 &&
+           v0 == aOther.v0 &&
+           u1 == aOther.u1 &&
+           v1 == aOther.v1 &&
+           buff == aOther.buff &&
+           size == aOther.size;
   }
 };
 
 typedef WrExternalImage (*LockExternalImageCallback)(void*, WrExternalImageId, uint8_t);
 
 typedef void (*UnlockExternalImageCallback)(void*, WrExternalImageId, uint8_t);
 
 struct WrExternalImageHandler {
   void* external_image_obj;
   LockExternalImageCallback lock_func;
   UnlockExternalImageCallback unlock_func;
 
   bool operator==(const WrExternalImageHandler& aOther) const {
     return external_image_obj == aOther.external_image_obj &&
-      lock_func == aOther.lock_func &&
-      unlock_func == aOther.unlock_func;
+           lock_func == aOther.lock_func &&
+           unlock_func == aOther.unlock_func;
   }
 };
 
 /* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
  * To generate this file, clone `https://github.com/rlhunt/cbindgen` or run `cargo install cbindgen`,
- * then run `cbindgen -c wr gfx/webrender_bindings/ gfx/webrender_bindings/webrender_ffi_generated.h` */
+ * then run `cbindgen gfx/webrender_bindings/ -o gfx/webrender_bindings/webrender_ffi_generated.h` */
 
-WR_INLINE void
-wr_api_add_blob_image(WrAPI* api,
-    WrImageKey image_key,
-    const WrImageDescriptor* descriptor,
-    WrByteSlice bytes)
+WR_INLINE
+void wr_api_add_blob_image(WrAPI* aApi,
+                           WrImageKey aImageKey,
+                           const WrImageDescriptor* aDescriptor,
+                           WrByteSlice aBytes)
 WR_FUNC;
 
-WR_INLINE void
-wr_api_add_external_image_buffer(WrAPI* api,
-    WrImageKey image_key,
-    const WrImageDescriptor* descriptor,
-    WrExternalImageId external_image_id)
+WR_INLINE
+void wr_api_add_external_image_buffer(WrAPI* aApi,
+                                      WrImageKey aImageKey,
+                                      const WrImageDescriptor* aDescriptor,
+                                      WrExternalImageId aExternalImageId)
 WR_FUNC;
 
-WR_INLINE void
-wr_api_add_external_image_handle(WrAPI* api,
-    WrImageKey image_key,
-    const WrImageDescriptor* descriptor,
-    WrExternalImageId external_image_id)
+WR_INLINE
+void wr_api_add_external_image_handle(WrAPI* aApi,
+                                      WrImageKey aImageKey,
+                                      const WrImageDescriptor* aDescriptor,
+                                      WrExternalImageId aExternalImageId)
 WR_FUNC;
 
-WR_INLINE void
-wr_api_add_image(WrAPI* api,
-    WrImageKey image_key,
-    const WrImageDescriptor* descriptor,
-    WrByteSlice bytes)
+WR_INLINE
+void wr_api_add_image(WrAPI* aApi,
+                      WrImageKey aImageKey,
+                      const WrImageDescriptor* aDescriptor,
+                      WrByteSlice aBytes)
 WR_FUNC;
 
-WR_INLINE void
-wr_api_add_raw_font(WrAPI* api,
-    WrFontKey key,
-    uint8_t* font_buffer,
-    size_t buffer_size,
-    uint32_t index)
+WR_INLINE
+void wr_api_add_raw_font(WrAPI* aApi,
+                         WrFontKey aKey,
+                         uint8_t* aFontBuffer,
+                         size_t aBufferSize,
+                         uint32_t aIndex)
 WR_FUNC;
 
-WR_INLINE void
-wr_api_clear_root_display_list(WrAPI* api,
-    WrEpoch epoch,
-    WrPipelineId pipeline_id)
+WR_INLINE
+void wr_api_clear_root_display_list(WrAPI* aApi,
+                                    WrEpoch aEpoch,
+                                    WrPipelineId aPipelineId)
 WR_FUNC;
 
-WR_INLINE void
-wr_api_delete(WrAPI* api)
+WR_INLINE
+void wr_api_delete(WrAPI* aApi)
 WR_DESTRUCTOR_SAFE_FUNC;
 
-WR_INLINE void
-wr_api_delete_font(WrAPI* api,
-    WrFontKey key)
+WR_INLINE
+void wr_api_delete_font(WrAPI* aApi,
+                        WrFontKey aKey)
 WR_FUNC;
 
-WR_INLINE void
-wr_api_delete_image(WrAPI* api,
-    WrImageKey key)
+WR_INLINE
+void wr_api_delete_image(WrAPI* aApi,
+                         WrImageKey aKey)
 WR_FUNC;
 
-WR_INLINE void
-wr_api_finalize_builder(WrState* state,
-    WrBuiltDisplayListDescriptor* dl_descriptor,
-    WrVecU8* dl_data,
-    WrAuxiliaryListsDescriptor* aux_descriptor,
-    WrVecU8* aux_data)
+WR_INLINE
+void wr_api_finalize_builder(WrState* aState,
+                             WrBuiltDisplayListDescriptor* aDlDescriptor,
+                             WrVecU8* aDlData,
+                             WrAuxiliaryListsDescriptor* aAuxDescriptor,
+                             WrVecU8* aAuxData)
 WR_FUNC;
 
-WR_INLINE void
-wr_api_generate_frame(WrAPI* api)
+WR_INLINE
+void wr_api_generate_frame(WrAPI* aApi)
 WR_FUNC;
 
-WR_INLINE void
-wr_api_generate_frame_with_properties(WrAPI* api,
-    const WrOpacityProperty* opacity_array,
-    size_t opacity_count,
-    const WrTransformProperty* transform_array,
-    size_t transform_count)
+WR_INLINE
+void wr_api_generate_frame_with_properties(WrAPI* aApi,
+                                           const WrOpacityProperty* aOpacityArray,
+                                           size_t aOpacityCount,
+                                           const WrTransformProperty* aTransformArray,
+                                           size_t aTransformCount)
 WR_FUNC;
 
-WR_INLINE WrIdNamespace
-wr_api_get_namespace(WrAPI* api)
+WR_INLINE
+WrIdNamespace wr_api_get_namespace(WrAPI* aApi)
 WR_FUNC;
 
-WR_INLINE void
-wr_api_send_external_event(WrAPI* api,
-    size_t evt)
+WR_INLINE
+void wr_api_send_external_event(WrAPI* aApi,
+                                size_t aEvt)
 WR_DESTRUCTOR_SAFE_FUNC;
 
-WR_INLINE void
-wr_api_set_root_display_list(WrAPI* api,
-    WrEpoch epoch,
-    float viewport_width,
-    float viewport_height,
-    WrPipelineId pipeline_id,
-    WrBuiltDisplayListDescriptor dl_descriptor,
-    uint8_t* dl_data,
-    size_t dl_size,
-    WrAuxiliaryListsDescriptor aux_descriptor,
-    uint8_t* aux_data,
-    size_t aux_size)
+WR_INLINE
+void wr_api_set_root_display_list(WrAPI* aApi,
+                                  WrEpoch aEpoch,
+                                  float aViewportWidth,
+                                  float aViewportHeight,
+                                  WrPipelineId aPipelineId,
+                                  WrBuiltDisplayListDescriptor aDlDescriptor,
+                                  uint8_t* aDlData,
+                                  size_t aDlSize,
+                                  WrAuxiliaryListsDescriptor aAuxDescriptor,
+                                  uint8_t* aAuxData,
+                                  size_t aAuxSize)
 WR_FUNC;
 
-WR_INLINE void
-wr_api_set_root_pipeline(WrAPI* api,
-    WrPipelineId pipeline_id)
+WR_INLINE
+void wr_api_set_root_pipeline(WrAPI* aApi,
+                              WrPipelineId aPipelineId)
 WR_FUNC;
 
-WR_INLINE void
-wr_api_set_window_parameters(WrAPI* api,
-    int32_t width,
-    int32_t height)
+WR_INLINE
+void wr_api_set_window_parameters(WrAPI* aApi,
+                                  int32_t aWidth,
+                                  int32_t aHeight)
 WR_FUNC;
 
-WR_INLINE void
-wr_api_update_image(WrAPI* api,
-    WrImageKey key,
-    const WrImageDescriptor* descriptor,
-    WrByteSlice bytes)
+WR_INLINE
+void wr_api_update_image(WrAPI* aApi,
+                         WrImageKey aKey,
+                         const WrImageDescriptor* aDescriptor,
+                         WrByteSlice aBytes)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_begin(WrState* state,
-    uint32_t width,
-    uint32_t height)
+WR_INLINE
+void wr_dp_begin(WrState* aState,
+                 uint32_t aWidth,
+                 uint32_t aHeight)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_end(WrState* state)
+WR_INLINE
+void wr_dp_end(WrState* aState)
 WR_FUNC;
 
-WR_INLINE WrClipRegion
-wr_dp_new_clip_region(WrState* state,
-    WrRect main,
-    const WrComplexClipRegion* complex,
-    size_t complex_count,
-    const WrImageMask* image_mask)
+WR_INLINE
+WrClipRegion wr_dp_new_clip_region(WrState* aState,
+                                   WrRect aMain,
+                                   const WrComplexClipRegion* aComplex,
+                                   size_t aComplexCount,
+                                   const WrImageMask* aImageMask)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_pop_scroll_layer(WrState* state)
+WR_INLINE
+void wr_dp_pop_scroll_layer(WrState* aState)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_pop_stacking_context(WrState* state)
+WR_INLINE
+void wr_dp_pop_stacking_context(WrState* aState)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_border(WrState* state,
-    WrRect rect,
-    WrClipRegion clip,
-    WrBorderWidths widths,
-    WrBorderSide top,
-    WrBorderSide right,
-    WrBorderSide bottom,
-    WrBorderSide left,
-    WrBorderRadius radius)
+WR_INLINE
+void wr_dp_push_border(WrState* aState,
+                       WrRect aRect,
+                       WrClipRegion aClip,
+                       WrBorderWidths aWidths,
+                       WrBorderSide aTop,
+                       WrBorderSide aRight,
+                       WrBorderSide aBottom,
+                       WrBorderSide aLeft,
+                       WrBorderRadius aRadius)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_border_gradient(WrState* state,
-    WrRect rect,
-    WrClipRegion clip,
-    WrBorderWidths widths,
-    WrPoint start_point,
-    WrPoint end_point,
-    const WrGradientStop* stops,
-    size_t stops_count,
-    WrGradientExtendMode extend_mode,
-    WrSideOffsets2Df32 outset)
+WR_INLINE
+void wr_dp_push_border_gradient(WrState* aState,
+                                WrRect aRect,
+                                WrClipRegion aClip,
+                                WrBorderWidths aWidths,
+                                WrPoint aStartPoint,
+                                WrPoint aEndPoint,
+                                const WrGradientStop* aStops,
+                                size_t aStopsCount,
+                                WrGradientExtendMode aExtendMode,
+                                WrSideOffsets2Df32 aOutset)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_border_image(WrState* state,
-    WrRect rect,
-    WrClipRegion clip,
-    WrBorderWidths widths,
-    WrImageKey image,
-    WrNinePatchDescriptor patch,
-    WrSideOffsets2Df32 outset,
-    WrRepeatMode repeat_horizontal,
-    WrRepeatMode repeat_vertical)
+WR_INLINE
+void wr_dp_push_border_image(WrState* aState,
+                             WrRect aRect,
+                             WrClipRegion aClip,
+                             WrBorderWidths aWidths,
+                             WrImageKey aImage,
+                             WrNinePatchDescriptor aPatch,
+                             WrSideOffsets2Df32 aOutset,
+                             WrRepeatMode aRepeatHorizontal,
+                             WrRepeatMode aRepeatVertical)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_border_radial_gradient(WrState* state,
-    WrRect rect,
-    WrClipRegion clip,
-    WrBorderWidths widths,
-    WrPoint center,
-    WrSize radius,
-    const WrGradientStop* stops,
-    size_t stops_count,
-    WrGradientExtendMode extend_mode,
-    WrSideOffsets2Df32 outset)
+WR_INLINE
+void wr_dp_push_border_radial_gradient(WrState* aState,
+                                       WrRect aRect,
+                                       WrClipRegion aClip,
+                                       WrBorderWidths aWidths,
+                                       WrPoint aCenter,
+                                       WrSize aRadius,
+                                       const WrGradientStop* aStops,
+                                       size_t aStopsCount,
+                                       WrGradientExtendMode aExtendMode,
+                                       WrSideOffsets2Df32 aOutset)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_box_shadow(WrState* state,
-    WrRect rect,
-    WrClipRegion clip,
-    WrRect box_bounds,
-    WrPoint offset,
-    WrColor color,
-    float blur_radius,
-    float spread_radius,
-    float border_radius,
-    WrBoxShadowClipMode clip_mode)
+WR_INLINE
+void wr_dp_push_box_shadow(WrState* aState,
+                           WrRect aRect,
+                           WrClipRegion aClip,
+                           WrRect aBoxBounds,
+                           WrPoint aOffset,
+                           WrColor aColor,
+                           float aBlurRadius,
+                           float aSpreadRadius,
+                           float aBorderRadius,
+                           WrBoxShadowClipMode aClipMode)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_built_display_list(WrState* state,
-    WrBuiltDisplayListDescriptor dl_descriptor,
-    WrVecU8 dl_data,
-    WrAuxiliaryListsDescriptor aux_descriptor,
-    WrVecU8 aux_data)
+WR_INLINE
+void wr_dp_push_built_display_list(WrState* aState,
+                                   WrBuiltDisplayListDescriptor aDlDescriptor,
+                                   WrVecU8 aDlData,
+                                   WrAuxiliaryListsDescriptor aAuxDescriptor,
+                                   WrVecU8 aAuxData)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_iframe(WrState* state,
-    WrRect rect,
-    WrClipRegion clip,
-    WrPipelineId pipeline_id)
+WR_INLINE
+void wr_dp_push_iframe(WrState* aState,
+                       WrRect aRect,
+                       WrClipRegion aClip,
+                       WrPipelineId aPipelineId)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_image(WrState* state,
-    WrRect bounds,
-    WrClipRegion clip,
-    WrSize stretch_size,
-    WrSize tile_spacing,
-    WrImageRendering image_rendering,
-    WrImageKey key)
+WR_INLINE
+void wr_dp_push_image(WrState* aState,
+                      WrRect aBounds,
+                      WrClipRegion aClip,
+                      WrSize aStretchSize,
+                      WrSize aTileSpacing,
+                      WrImageRendering aImageRendering,
+                      WrImageKey aKey)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_linear_gradient(WrState* state,
-    WrRect rect,
-    WrClipRegion clip,
-    WrPoint start_point,
-    WrPoint end_point,
-    const WrGradientStop* stops,
-    size_t stops_count,
-    WrGradientExtendMode extend_mode,
-    WrSize tile_size,
-    WrSize tile_spacing)
+WR_INLINE
+void wr_dp_push_linear_gradient(WrState* aState,
+                                WrRect aRect,
+                                WrClipRegion aClip,
+                                WrPoint aStartPoint,
+                                WrPoint aEndPoint,
+                                const WrGradientStop* aStops,
+                                size_t aStopsCount,
+                                WrGradientExtendMode aExtendMode,
+                                WrSize aTileSize,
+                                WrSize aTileSpacing)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_radial_gradient(WrState* state,
-    WrRect rect,
-    WrClipRegion clip,
-    WrPoint center,
-    WrSize radius,
-    const WrGradientStop* stops,
-    size_t stops_count,
-    WrGradientExtendMode extend_mode,
-    WrSize tile_size,
-    WrSize tile_spacing)
+WR_INLINE
+void wr_dp_push_radial_gradient(WrState* aState,
+                                WrRect aRect,
+                                WrClipRegion aClip,
+                                WrPoint aCenter,
+                                WrSize aRadius,
+                                const WrGradientStop* aStops,
+                                size_t aStopsCount,
+                                WrGradientExtendMode aExtendMode,
+                                WrSize aTileSize,
+                                WrSize aTileSpacing)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_rect(WrState* state,
-    WrRect rect,
-    WrClipRegion clip,
-    WrColor color)
+WR_INLINE
+void wr_dp_push_rect(WrState* aState,
+                     WrRect aRect,
+                     WrClipRegion aClip,
+                     WrColor aColor)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_scroll_layer(WrState* state,
-    WrRect content_rect,
-    WrRect clip_rect,
-    const WrImageMask* mask)
+WR_INLINE
+void wr_dp_push_scroll_layer(WrState* aState,
+                             WrRect aContentRect,
+                             WrRect aClipRect,
+                             const WrImageMask* aMask)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_stacking_context(WrState* state,
-    WrRect bounds,
-    uint64_t animation_id,
-    const float* opacity,
-    const WrMatrix* transform,
-    WrMixBlendMode mix_blend_mode)
+WR_INLINE
+void wr_dp_push_stacking_context(WrState* aState,
+                                 WrRect aBounds,
+                                 uint64_t aAnimationId,
+                                 const float* aOpacity,
+                                 const WrMatrix* aTransform,
+                                 WrMixBlendMode aMixBlendMode)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_text(WrState* state,
-    WrRect bounds,
-    WrClipRegion clip,
-    WrColor color,
-    WrFontKey font_key,
-    const WrGlyphInstance* glyphs,
-    uint32_t glyph_count,
-    float glyph_size)
+WR_INLINE
+void wr_dp_push_text(WrState* aState,
+                     WrRect aBounds,
+                     WrClipRegion aClip,
+                     WrColor aColor,
+                     WrFontKey aFontKey,
+                     const WrGlyphInstance* aGlyphs,
+                     uint32_t aGlyphCount,
+                     float aGlyphSize)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_yuv_NV12_image(WrState* state,
-    WrRect bounds,
-    WrClipRegion clip,
-    WrImageKey image_key_0,
-    WrImageKey image_key_1,
-    WrYuvColorSpace color_space)
+WR_INLINE
+void wr_dp_push_yuv_NV12_image(WrState* aState,
+                               WrRect aBounds,
+                               WrClipRegion aClip,
+                               WrImageKey aImageKey0,
+                               WrImageKey aImageKey1,
+                               WrYuvColorSpace aColorSpace)
 WR_FUNC;
 
-WR_INLINE void
-wr_dp_push_yuv_planar_image(WrState* state,
-    WrRect bounds,
-    WrClipRegion clip,
-    WrImageKey image_key_0,
-    WrImageKey image_key_1,
-    WrImageKey image_key_2,
-    WrYuvColorSpace color_space)
+WR_INLINE
+void wr_dp_push_yuv_planar_image(WrState* aState,
+                                 WrRect aBounds,
+                                 WrClipRegion aClip,
+                                 WrImageKey aImageKey0,
+                                 WrImageKey aImageKey1,
+                                 WrImageKey aImageKey2,
+                                 WrYuvColorSpace aColorSpace)
 WR_FUNC;
 
-WR_INLINE void
-wr_rendered_epochs_delete(WrRenderedEpochs* pipeline_epochs)
+WR_INLINE
+void wr_rendered_epochs_delete(WrRenderedEpochs* aPipelineEpochs)
 WR_DESTRUCTOR_SAFE_FUNC;
 
-WR_INLINE bool
-wr_rendered_epochs_next(WrRenderedEpochs* pipeline_epochs,
-    WrPipelineId* out_pipeline,
-    WrEpoch* out_epoch)
+WR_INLINE
+bool wr_rendered_epochs_next(WrRenderedEpochs* aPipelineEpochs,
+                             WrPipelineId* aOutPipeline,
+                             WrEpoch* aOutEpoch)
 WR_FUNC;
 
-WR_INLINE bool
-wr_renderer_current_epoch(WrRenderer* renderer,
-    WrPipelineId pipeline_id,
-    WrEpoch* out_epoch)
+WR_INLINE
+bool wr_renderer_current_epoch(WrRenderer* aRenderer,
+                               WrPipelineId aPipelineId,
+                               WrEpoch* aOutEpoch)
 WR_FUNC;
 
-WR_INLINE void
-wr_renderer_delete(WrRenderer* renderer)
+WR_INLINE
+void wr_renderer_delete(WrRenderer* aRenderer)
 WR_DESTRUCTOR_SAFE_FUNC;
 
-WR_INLINE WrRenderedEpochs*
-wr_renderer_flush_rendered_epochs(WrRenderer* renderer)
+WR_INLINE
+WrRenderedEpochs* wr_renderer_flush_rendered_epochs(WrRenderer* aRenderer)
+WR_FUNC;
+
+WR_INLINE
+void wr_renderer_readback(WrRenderer* aRenderer,
+                          uint32_t aWidth,
+                          uint32_t aHeight,
+                          uint8_t* aDstBuffer,
+                          size_t aBufferSize)
 WR_FUNC;
 
-WR_INLINE void
-wr_renderer_readback(WrRenderer* renderer,
-    uint32_t width,
-    uint32_t height,
-    uint8_t* dst_buffer,
-    size_t buffer_size)
+WR_INLINE
+void wr_renderer_render(WrRenderer* aRenderer,
+                        uint32_t aWidth,
+                        uint32_t aHeight)
 WR_FUNC;
 
-WR_INLINE void
-wr_renderer_render(WrRenderer* renderer,
-    uint32_t width,
-    uint32_t height)
+WR_INLINE
+void wr_renderer_set_external_image_handler(WrRenderer* aRenderer,
+                                            WrExternalImageHandler* aExternalImageHandler)
 WR_FUNC;
 
-WR_INLINE void
-wr_renderer_set_external_image_handler(WrRenderer* renderer,
-    WrExternalImageHandler* external_image_handler)
+WR_INLINE
+void wr_renderer_set_profiler_enabled(WrRenderer* aRenderer,
+                                      bool aEnabled)
 WR_FUNC;
 
-WR_INLINE void
-wr_renderer_set_profiler_enabled(WrRenderer* renderer,
-    bool enabled)
+WR_INLINE
+void wr_renderer_update(WrRenderer* aRenderer)
 WR_FUNC;
 
-WR_INLINE void
-wr_renderer_update(WrRenderer* renderer)
-WR_FUNC;
-
-WR_INLINE void
-wr_state_delete(WrState* state)
+WR_INLINE
+void wr_state_delete(WrState* aState)
 WR_DESTRUCTOR_SAFE_FUNC;
 
-WR_INLINE WrState*
-wr_state_new(WrPipelineId pipeline_id)
+WR_INLINE
+WrState* wr_state_new(WrPipelineId aPipelineId)
 WR_FUNC;
 
-WR_INLINE void
-wr_vec_u8_free(WrVecU8 v)
+WR_INLINE
+void wr_vec_u8_free(WrVecU8 aV)
 WR_FUNC;
 
-WR_INLINE bool
-wr_window_new(WrWindowId window_id,
-    uint32_t window_width,
-    uint32_t window_height,
-    void* gl_context,
-    bool enable_profiler,
-    WrAPI** out_api,
-    WrRenderer** out_renderer)
+WR_INLINE
+bool wr_window_new(WrWindowId aWindowId,
+                   uint32_t aWindowWidth,
+                   uint32_t aWindowHeight,
+                   void* aGlContext,
+                   bool aEnableProfiler,
+                   WrAPI** aOutApi,
+                   WrRenderer** aOutRenderer)
 WR_FUNC;
 
+} // extern "C"
+
 /* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
  * To generate this file, clone `https://github.com/rlhunt/cbindgen` or run `cargo install cbindgen`,
- * then run `cbindgen -c wr gfx/webrender_bindings/ gfx/webrender_bindings/webrender_ffi_generated.h` */
+ * then run `cbindgen gfx/webrender_bindings/ -o gfx/webrender_bindings/webrender_ffi_generated.h` */