From 1880bd37a560940fdaffcd3b19fae3f2be887441 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Tue, 11 Apr 2017 16:13:44 -0400 Subject: [PATCH] Bug 1355577 - Make the pointer in WrByteSlice const on the C++ side to match the Rust side. r=jrmuizel MozReview-Commit-ID: FWCzZt8RAMj --- gfx/webrender_bindings/Moz2DImageRenderer.cpp | 4 ++-- gfx/webrender_bindings/WebRenderTypes.h | 4 ++-- gfx/webrender_bindings/webrender_ffi.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gfx/webrender_bindings/Moz2DImageRenderer.cpp b/gfx/webrender_bindings/Moz2DImageRenderer.cpp index 9ac25360482e..a0924c53daea 100644 --- a/gfx/webrender_bindings/Moz2DImageRenderer.cpp +++ b/gfx/webrender_bindings/Moz2DImageRenderer.cpp @@ -11,10 +11,10 @@ namespace mozilla { namespace wr { -static bool Moz2DRenderCallback(const Range aBlob, +static bool Moz2DRenderCallback(const Range aBlob, gfx::IntSize aSize, gfx::SurfaceFormat aFormat, - Range output) + Range output) { return false; // TODO(nical) } diff --git a/gfx/webrender_bindings/WebRenderTypes.h b/gfx/webrender_bindings/WebRenderTypes.h index 6650b9d249a4..881f5b419506 100644 --- a/gfx/webrender_bindings/WebRenderTypes.h +++ b/gfx/webrender_bindings/WebRenderTypes.h @@ -488,8 +488,8 @@ inline WrByteSlice RangeToByteSlice(mozilla::Range aRange) { return WrByteSlice { aRange.begin().get(), aRange.length() }; } -inline mozilla::Range ByteSliceToRange(WrByteSlice aWrSlice) { - return mozilla::Range(aWrSlice.buffer, aWrSlice.len); +inline mozilla::Range ByteSliceToRange(WrByteSlice aWrSlice) { + return mozilla::Range(aWrSlice.buffer, aWrSlice.len); } struct BuiltDisplayList { diff --git a/gfx/webrender_bindings/webrender_ffi.h b/gfx/webrender_bindings/webrender_ffi.h index f881d8b7a885..3521147976e4 100644 --- a/gfx/webrender_bindings/webrender_ffi.h +++ b/gfx/webrender_bindings/webrender_ffi.h @@ -66,7 +66,7 @@ WR_DECL_FFI_2(WrFontKey, uint32_t, uint32_t) // view of a buffer of bytes. // The canonical gecko equivalent is mozilla::Range. struct WrByteSlice { - uint8_t* buffer; + const uint8_t* buffer; size_t len; };