Bug 924193 - Drop WebGLTexelConversions' custom FORCE_INLINE macro, use MOZ_ALWAYS_INLINE - r=jgilbert
authorBenoit Jacob <bjacob@mozilla.com>
Fri, 11 Oct 2013 09:16:44 -0400
changeset 150483 5779d659976ac5a2e3df3b083bc3e4639356446a
parent 150482 447425c70633f8c889425ddc8f4f46443e520f64
child 150484 a9f84f6cbc71707656775c200eb592408dfd870b
push id3001
push userryanvm@gmail.com
push dateFri, 11 Oct 2013 21:03:10 +0000
treeherderfx-team@9ab188de8245 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs924193
milestone27.0a1
Bug 924193 - Drop WebGLTexelConversions' custom FORCE_INLINE macro, use MOZ_ALWAYS_INLINE - r=jgilbert
content/canvas/src/WebGLTexelConversions.h
--- a/content/canvas/src/WebGLTexelConversions.h
+++ b/content/canvas/src/WebGLTexelConversions.h
@@ -29,24 +29,17 @@
 #define WEBGLTEXELCONVERSIONS_H_
 
 #ifdef __SUNPRO_CC
 #define __restrict
 #endif
 
 #include "WebGLTypes.h"
 #include <stdint.h>
-
-#if defined _MSC_VER
-#define FORCE_INLINE __forceinline
-#elif defined __GNUC__
-#define FORCE_INLINE __attribute__((always_inline)) inline
-#else
-#define FORCE_INLINE inline
-#endif
+#include "mozilla/Attributes.h"
 
 namespace mozilla {
 
 MOZ_BEGIN_ENUM_CLASS(WebGLTexelPremultiplicationOp, int)
     None,
     Premultiply,
     Unpremultiply
 MOZ_END_ENUM_CLASS(WebGLTexelPremultiplicationOp)
@@ -137,29 +130,29 @@ inline size_t TexelBytesForFormat(WebGLT
         case WebGLTexelFormat::RGBA32F:
             return 16;
         default:
             MOZ_ASSERT(false, "Unknown texel format. Coding mistake?");
             return 0;
     }
 }
 
-FORCE_INLINE bool HasAlpha(WebGLTexelFormat format) {
+MOZ_ALWAYS_INLINE bool HasAlpha(WebGLTexelFormat format) {
     return format == WebGLTexelFormat::A8 ||
            format == WebGLTexelFormat::A32F ||
            format == WebGLTexelFormat::RA8 ||
            format == WebGLTexelFormat::RA32F ||
            format == WebGLTexelFormat::RGBA8 ||
            format == WebGLTexelFormat::BGRA8 ||
            format == WebGLTexelFormat::RGBA32F ||
            format == WebGLTexelFormat::RGBA4444 ||
            format == WebGLTexelFormat::RGBA5551;
 }
 
-FORCE_INLINE bool HasColor(WebGLTexelFormat format) {
+MOZ_ALWAYS_INLINE bool HasColor(WebGLTexelFormat format) {
     return format == WebGLTexelFormat::R8 ||
            format == WebGLTexelFormat::R32F ||
            format == WebGLTexelFormat::RA8 ||
            format == WebGLTexelFormat::RA32F ||
            format == WebGLTexelFormat::RGB8 ||
            format == WebGLTexelFormat::BGRX8 ||
            format == WebGLTexelFormat::RGB565 ||
            format == WebGLTexelFormat::RGB32F ||
@@ -175,536 +168,534 @@ FORCE_INLINE bool HasColor(WebGLTexelFor
 
 // the pack/unpack functions here are originally from this file:
 //   http://trac.webkit.org/browser/trunk/WebCore/platform/graphics/GraphicsContext3D.cpp
 
 //----------------------------------------------------------------------
 // Pixel unpacking routines.
 
 template<MOZ_ENUM_CLASS_INTEGER_TYPE(WebGLTexelFormat) Format, typename SrcType, typename DstType>
-FORCE_INLINE void
+MOZ_ALWAYS_INLINE void
 unpack(const SrcType* __restrict src,
        DstType* __restrict dst)
 {
     MOZ_ASSERT(false, "Unimplemented texture format conversion");
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 unpack<WebGLTexelFormat::RGBA8, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[1];
     dst[2] = src[2];
     dst[3] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 unpack<WebGLTexelFormat::RGB8, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[1];
     dst[2] = src[2];
     dst[3] = 0xFF;
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 unpack<WebGLTexelFormat::BGRA8, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     dst[0] = src[2];
     dst[1] = src[1];
     dst[2] = src[0];
     dst[3] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 unpack<WebGLTexelFormat::BGRX8, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     dst[0] = src[2];
     dst[1] = src[1];
     dst[2] = src[0];
     dst[3] = 0xFF;
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 unpack<WebGLTexelFormat::RGBA5551, uint16_t, uint8_t>(const uint16_t* __restrict src, uint8_t* __restrict dst)
 {
     uint16_t packedValue = src[0];
     uint8_t r = (packedValue >> 11) & 0x1F;
     uint8_t g = (packedValue >> 6) & 0x1F;
     uint8_t b = (packedValue >> 1) & 0x1F;
     dst[0] = (r << 3) | (r & 0x7);
     dst[1] = (g << 3) | (g & 0x7);
     dst[2] = (b << 3) | (b & 0x7);
     dst[3] = (packedValue & 0x1) ? 0xFF : 0;
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 unpack<WebGLTexelFormat::RGBA4444, uint16_t, uint8_t>(const uint16_t* __restrict src, uint8_t* __restrict dst)
 {
     uint16_t packedValue = src[0];
     uint8_t r = (packedValue >> 12) & 0x0F;
     uint8_t g = (packedValue >> 8) & 0x0F;
     uint8_t b = (packedValue >> 4) & 0x0F;
     uint8_t a = packedValue & 0x0F;
     dst[0] = (r << 4) | r;
     dst[1] = (g << 4) | g;
     dst[2] = (b << 4) | b;
     dst[3] = (a << 4) | a;
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 unpack<WebGLTexelFormat::RGB565, uint16_t, uint8_t>(const uint16_t* __restrict src, uint8_t* __restrict dst)
 {
     uint16_t packedValue = src[0];
     uint8_t r = (packedValue >> 11) & 0x1F;
     uint8_t g = (packedValue >> 5) & 0x3F;
     uint8_t b = packedValue & 0x1F;
     dst[0] = (r << 3) | (r & 0x7);
     dst[1] = (g << 2) | (g & 0x3);
     dst[2] = (b << 3) | (b & 0x7);
     dst[3] = 0xFF;
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 unpack<WebGLTexelFormat::R8, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[0];
     dst[2] = src[0];
     dst[3] = 0xFF;
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 unpack<WebGLTexelFormat::RA8, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[0];
     dst[2] = src[0];
     dst[3] = src[1];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 unpack<WebGLTexelFormat::A8, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     dst[0] = 0;
     dst[1] = 0;
     dst[2] = 0;
     dst[3] = src[0];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 unpack<WebGLTexelFormat::RGBA32F, float, float>(const float* __restrict src, float* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[1];
     dst[2] = src[2];
     dst[3] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 unpack<WebGLTexelFormat::RGB32F, float, float>(const float* __restrict src, float* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[1];
     dst[2] = src[2];
     dst[3] = 1.0f;
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 unpack<WebGLTexelFormat::R32F, float, float>(const float* __restrict src, float* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[0];
     dst[2] = src[0];
     dst[3] = 1.0f;
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 unpack<WebGLTexelFormat::RA32F, float, float>(const float* __restrict src, float* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[0];
     dst[2] = src[0];
     dst[3] = src[1];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 unpack<WebGLTexelFormat::A32F, float, float>(const float* __restrict src, float* __restrict dst)
 {
     dst[0] = 0;
     dst[1] = 0;
     dst[2] = 0;
     dst[3] = src[0];
 }
 
 //----------------------------------------------------------------------
 // Pixel packing routines.
 //
 
 template<MOZ_ENUM_CLASS_INTEGER_TYPE(WebGLTexelFormat) Format,
          MOZ_ENUM_CLASS_INTEGER_TYPE(WebGLTexelPremultiplicationOp) PremultiplicationOp,
          typename SrcType,
          typename DstType>
-FORCE_INLINE void
+MOZ_ALWAYS_INLINE void
 pack(const SrcType* __restrict src,
      DstType* __restrict dst)
 {
     MOZ_ASSERT(false, "Unimplemented texture format conversion");
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::A8, WebGLTexelPremultiplicationOp::None, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     dst[0] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::A8, WebGLTexelPremultiplicationOp::Premultiply, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     dst[0] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::A8, WebGLTexelPremultiplicationOp::Unpremultiply, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     dst[0] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::R8, WebGLTexelPremultiplicationOp::None, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     dst[0] = src[0];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::R8, WebGLTexelPremultiplicationOp::Premultiply, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     float scaleFactor = src[3] / 255.0f;
     uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
     dst[0] = srcR;
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::R8, WebGLTexelPremultiplicationOp::Unpremultiply, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f;
     uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
     dst[0] = srcR;
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RA8, WebGLTexelPremultiplicationOp::None, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RA8, WebGLTexelPremultiplicationOp::Premultiply, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     float scaleFactor = src[3] / 255.0f;
     uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
     dst[0] = srcR;
     dst[1] = src[3];
 }
 
 // FIXME: this routine is lossy and must be removed.
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RA8, WebGLTexelPremultiplicationOp::Unpremultiply, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f;
     uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
     dst[0] = srcR;
     dst[1] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGB8, WebGLTexelPremultiplicationOp::None, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[1];
     dst[2] = src[2];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGB8, WebGLTexelPremultiplicationOp::Premultiply, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     float scaleFactor = src[3] / 255.0f;
     uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
     uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
     uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
     dst[0] = srcR;
     dst[1] = srcG;
     dst[2] = srcB;
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGB8, WebGLTexelPremultiplicationOp::Unpremultiply, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f;
     uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
     uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
     uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
     dst[0] = srcR;
     dst[1] = srcG;
     dst[2] = srcB;
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA8, WebGLTexelPremultiplicationOp::None, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[1];
     dst[2] = src[2];
     dst[3] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA8, WebGLTexelPremultiplicationOp::Premultiply, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     float scaleFactor = src[3] / 255.0f;
     uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
     uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
     uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
     dst[0] = srcR;
     dst[1] = srcG;
     dst[2] = srcB;
     dst[3] = src[3];
 }
 
 // FIXME: this routine is lossy and must be removed.
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA8, WebGLTexelPremultiplicationOp::Unpremultiply, uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f;
     uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
     uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
     uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
     dst[0] = srcR;
     dst[1] = srcG;
     dst[2] = srcB;
     dst[3] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA4444, WebGLTexelPremultiplicationOp::None, uint8_t, uint16_t>(const uint8_t* __restrict src, uint16_t* __restrict dst)
 {
     *dst = ( ((src[0] & 0xF0) << 8)
            | ((src[1] & 0xF0) << 4)
            | (src[2] & 0xF0)
            | (src[3] >> 4) );
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA4444, WebGLTexelPremultiplicationOp::Premultiply, uint8_t, uint16_t>(const uint8_t* __restrict src, uint16_t* __restrict dst)
 {
     float scaleFactor = src[3] / 255.0f;
     uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
     uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
     uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
     *dst = ( ((srcR & 0xF0) << 8)
            | ((srcG & 0xF0) << 4)
            | (srcB & 0xF0)
            | (src[3] >> 4));
 }
 
 // FIXME: this routine is lossy and must be removed.
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA4444, WebGLTexelPremultiplicationOp::Unpremultiply, uint8_t, uint16_t>(const uint8_t* __restrict src, uint16_t* __restrict dst)
 {
     float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f;
     uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
     uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
     uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
     *dst = ( ((srcR & 0xF0) << 8)
            | ((srcG & 0xF0) << 4)
            | (srcB & 0xF0)
            | (src[3] >> 4));
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA5551, WebGLTexelPremultiplicationOp::None, uint8_t, uint16_t>(const uint8_t* __restrict src, uint16_t* __restrict dst)
 {
     *dst = ( ((src[0] & 0xF8) << 8)
            | ((src[1] & 0xF8) << 3)
            | ((src[2] & 0xF8) >> 2)
            | (src[3] >> 7));
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA5551, WebGLTexelPremultiplicationOp::Premultiply, uint8_t, uint16_t>(const uint8_t* __restrict src, uint16_t* __restrict dst)
 {
     float scaleFactor = src[3] / 255.0f;
     uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
     uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
     uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
     *dst = ( ((srcR & 0xF8) << 8)
            | ((srcG & 0xF8) << 3)
            | ((srcB & 0xF8) >> 2)
            | (src[3] >> 7));
 }
 
 // FIXME: this routine is lossy and must be removed.
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA5551, WebGLTexelPremultiplicationOp::Unpremultiply, uint8_t, uint16_t>(const uint8_t* __restrict src, uint16_t* __restrict dst)
 {
     float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f;
     uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
     uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
     uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
     *dst = ( ((srcR & 0xF8) << 8)
            | ((srcG & 0xF8) << 3)
            | ((srcB & 0xF8) >> 2)
            | (src[3] >> 7));
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGB565, WebGLTexelPremultiplicationOp::None, uint8_t, uint16_t>(const uint8_t* __restrict src, uint16_t* __restrict dst)
 {
     *dst = ( ((src[0] & 0xF8) << 8)
            | ((src[1] & 0xFC) << 3)
            | ((src[2] & 0xF8) >> 3));
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGB565, WebGLTexelPremultiplicationOp::Premultiply, uint8_t, uint16_t>(const uint8_t* __restrict src, uint16_t* __restrict dst)
 {
     float scaleFactor = src[3] / 255.0f;
     uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
     uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
     uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
     *dst = ( ((srcR & 0xF8) << 8)
            | ((srcG & 0xFC) << 3)
            | ((srcB & 0xF8) >> 3));
 }
 
 // FIXME: this routine is lossy and must be removed.
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGB565, WebGLTexelPremultiplicationOp::Unpremultiply, uint8_t, uint16_t>(const uint8_t* __restrict src, uint16_t* __restrict dst)
 {
     float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f;
     uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
     uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
     uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
     *dst = ( ((srcR & 0xF8) << 8)
            | ((srcG & 0xFC) << 3)
            | ((srcB & 0xF8) >> 3));
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGB32F, WebGLTexelPremultiplicationOp::None, float, float>(const float* __restrict src, float* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[1];
     dst[2] = src[2];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGB32F, WebGLTexelPremultiplicationOp::Premultiply, float, float>(const float* __restrict src, float* __restrict dst)
 {
     float scaleFactor = src[3];
     dst[0] = src[0] * scaleFactor;
     dst[1] = src[1] * scaleFactor;
     dst[2] = src[2] * scaleFactor;
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA32F, WebGLTexelPremultiplicationOp::None, float, float>(const float* __restrict src, float* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[1];
     dst[2] = src[2];
     dst[3] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA32F, WebGLTexelPremultiplicationOp::Premultiply, float, float>(const float* __restrict src, float* __restrict dst)
 {
     float scaleFactor = src[3];
     dst[0] = src[0] * scaleFactor;
     dst[1] = src[1] * scaleFactor;
     dst[2] = src[2] * scaleFactor;
     dst[3] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::A32F, WebGLTexelPremultiplicationOp::None, float, float>(const float* __restrict src, float* __restrict dst)
 {
     dst[0] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::A32F, WebGLTexelPremultiplicationOp::Premultiply, float, float>(const float* __restrict src, float* __restrict dst)
 {
     dst[0] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::R32F, WebGLTexelPremultiplicationOp::None, float, float>(const float* __restrict src, float* __restrict dst)
 {
     dst[0] = src[0];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::R32F, WebGLTexelPremultiplicationOp::Premultiply, float, float>(const float* __restrict src, float* __restrict dst)
 {
     float scaleFactor = src[3];
     dst[0] = src[0] * scaleFactor;
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RA32F, WebGLTexelPremultiplicationOp::None, float, float>(const float* __restrict src, float* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RA32F, WebGLTexelPremultiplicationOp::Premultiply, float, float>(const float* __restrict src, float* __restrict dst)
 {
     float scaleFactor = src[3];
     dst[0] = src[0] * scaleFactor;
     dst[1] = scaleFactor;
 }
 
 /****** END CODE SHARED WITH WEBKIT ******/
 
-template<typename SrcType, typename DstType> FORCE_INLINE void
+template<typename SrcType, typename DstType> MOZ_ALWAYS_INLINE void
 convertType(const SrcType* __restrict src, DstType* __restrict dst)
 {
     MOZ_ASSERT(false, "Unimplemented texture format conversion");
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 convertType<uint8_t, uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[1];
     dst[2] = src[2];
     dst[3] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 convertType<float, float>(const float* __restrict src, float* __restrict dst)
 {
     dst[0] = src[0];
     dst[1] = src[1];
     dst[2] = src[2];
     dst[3] = src[3];
 }
 
-template<> FORCE_INLINE void
+template<> MOZ_ALWAYS_INLINE void
 convertType<uint8_t, float>(const uint8_t* __restrict src, float* __restrict dst)
 {
     const float scaleFactor = 1.f / 255.0f;
     dst[0] = src[0] * scaleFactor;
     dst[1] = src[1] * scaleFactor;
     dst[2] = src[2] * scaleFactor;
     dst[3] = src[3] * scaleFactor;
 }
 
-#undef FORCE_INLINE
-
 } // end namespace WebGLTexelConversions
 
 } // end namespace mozilla
 
 #endif // WEBGLTEXELCONVERSIONS_H_