mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 1122383 - Optimize Moz2D's ConvertBGRXToBGRA. r=jwatt
From 4c67bb1f0d9378831559983ccf53f63ad104974e Mon Sep 17 00:00:00 2001 --- gfx/2d/DataSurfaceHelpers.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
This commit is contained in:
parent
be5ad9913e
commit
3566618b84
@ -45,19 +45,19 @@ SurfaceContainsPoint(SourceSurface* aSurface, const IntPoint& aPoint)
|
||||
}
|
||||
|
||||
void
|
||||
ConvertBGRXToBGRA(uint8_t* aData, const IntSize &aSize, int32_t aStride)
|
||||
ConvertBGRXToBGRA(uint8_t* aData, const IntSize &aSize, const int32_t aStride)
|
||||
{
|
||||
uint32_t* pixel = reinterpret_cast<uint32_t*>(aData);
|
||||
int height = aSize.height, width = aSize.width * 4;
|
||||
|
||||
for (int row = 0; row < aSize.height; ++row) {
|
||||
for (int column = 0; column < aSize.width; ++column) {
|
||||
for (int row = 0; row < height; ++row) {
|
||||
for (int column = 0; column < width; column += 4) {
|
||||
#ifdef IS_BIG_ENDIAN
|
||||
pixel[column] |= 0x000000FF;
|
||||
aData[column] = 0xFF;
|
||||
#else
|
||||
pixel[column] |= 0xFF000000;
|
||||
aData[column + 3] = 0xFF;
|
||||
#endif
|
||||
}
|
||||
pixel += (aStride/4);
|
||||
aData += aStride;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
void
|
||||
ConvertBGRXToBGRA(uint8_t* aData, const IntSize &aSize, int32_t aStride);
|
||||
ConvertBGRXToBGRA(uint8_t* aData, const IntSize &aSize, const int32_t aStride);
|
||||
|
||||
/**
|
||||
* Copy the pixel data from aSrc and pack it into aDst. aSrcSize, aSrcStride
|
||||
|
Loading…
Reference in New Issue
Block a user