зеркало из https://github.com/mozilla/gecko-dev.git
Bug 978105 - convert content/ to use Endian.h; r=smaug
This commit is contained in:
Родитель
1adee1da91
Коммит
fb7c786978
|
@ -74,6 +74,7 @@
|
|||
#include "mozilla/dom/ImageData.h"
|
||||
#include "mozilla/dom/PBrowserParent.h"
|
||||
#include "mozilla/dom/TypedArray.h"
|
||||
#include "mozilla/Endian.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/gfx/PathHelpers.h"
|
||||
#include "mozilla/gfx/DataSurfaceHelpers.h"
|
||||
|
@ -3809,7 +3810,7 @@ CanvasRenderingContext2D::GetImageDataArray(JSContext* aCx,
|
|||
for (int32_t j = 0; j < dstWriteRect.height; ++j) {
|
||||
for (int32_t i = 0; i < dstWriteRect.width; ++i) {
|
||||
// XXX Is there some useful swizzle MMX we can use here?
|
||||
#ifdef IS_LITTLE_ENDIAN
|
||||
#if MOZ_LITTLE_ENDIAN
|
||||
uint8_t b = *src++;
|
||||
uint8_t g = *src++;
|
||||
uint8_t r = *src++;
|
||||
|
@ -3967,7 +3968,7 @@ CanvasRenderingContext2D::PutImageData_explicit(int32_t x, int32_t y, uint32_t w
|
|||
uint8_t a = *src++;
|
||||
|
||||
// Convert to premultiplied color (losslessly if the input came from getImageData)
|
||||
#ifdef IS_LITTLE_ENDIAN
|
||||
#if MOZ_LITTLE_ENDIAN
|
||||
*dst++ = gfxUtils::sPremultiplyTable[a * 256 + b];
|
||||
*dst++ = gfxUtils::sPremultiplyTable[a * 256 + g];
|
||||
*dst++ = gfxUtils::sPremultiplyTable[a * 256 + r];
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include "mozilla/dom/ImageData.h"
|
||||
#include "mozilla/Endian.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
@ -2555,7 +2556,7 @@ WebGLContext::ReadPixels(GLint x, GLint y, GLsizei width,
|
|||
uint8_t *row = static_cast<uint8_t*>(data);
|
||||
for (GLint j = 0; j < height; ++j) {
|
||||
uint8_t *rowp = row;
|
||||
#ifdef IS_LITTLE_ENDIAN
|
||||
#if MOZ_LITTLE_ENDIAN
|
||||
// offset to get the alpha byte; we're always going to
|
||||
// move by 4 bytes
|
||||
rowp += 3;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "GStreamerFormatHelper.h"
|
||||
#include "VideoUtils.h"
|
||||
#include "mozilla/dom/TimeRanges.h"
|
||||
#include "mozilla/Endian.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
@ -162,7 +163,7 @@ void GStreamerReader::CopyIntoImageBuffer(GstBuffer* aBuffer,
|
|||
GstCaps* GStreamerReader::BuildAudioSinkCaps()
|
||||
{
|
||||
GstCaps* caps;
|
||||
#ifdef IS_LITTLE_ENDIAN
|
||||
#if MOZ_LITTLE_ENDIAN
|
||||
int endianness = 1234;
|
||||
#else
|
||||
int endianness = 4321;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "GStreamerFormatHelper.h"
|
||||
#include "VideoUtils.h"
|
||||
#include "mozilla/dom/TimeRanges.h"
|
||||
#include "mozilla/Endian.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/unused.h"
|
||||
#include "GStreamerLoader.h"
|
||||
|
@ -1204,13 +1205,13 @@ GstCaps* GStreamerReader::BuildAudioSinkCaps()
|
|||
GstCaps* caps = gst_caps_from_string("audio/x-raw, channels={1,2}");
|
||||
const char* format;
|
||||
#ifdef MOZ_SAMPLE_TYPE_FLOAT32
|
||||
#ifdef IS_LITTLE_ENDIAN
|
||||
#if MOZ_LITTLE_ENDIAN
|
||||
format = "F32LE";
|
||||
#else
|
||||
format = "F32BE";
|
||||
#endif
|
||||
#else /* !MOZ_SAMPLE_TYPE_FLOAT32 */
|
||||
#ifdef IS_LITTLE_ENDIAN
|
||||
#if MOZ_LITTLE_ENDIAN
|
||||
format = "S16LE";
|
||||
#else
|
||||
format = "S16BE";
|
||||
|
|
Загрузка…
Ссылка в новой задаче