mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1288649 - Remove NextPowerOfTwo. - r=jrmuizel
MozReview-Commit-ID: 9CR6lscs3d2
This commit is contained in:
parent
c6bdac40c5
commit
6790ba91a7
@ -261,8 +261,8 @@ TexImage2DHelper(GLContext* gl,
|
||||
|
||||
// Pad out texture width and height to the next power of two
|
||||
// as we don't support/want non power of two texture uploads
|
||||
GLsizei paddedWidth = NextPowerOfTwo(width);
|
||||
GLsizei paddedHeight = NextPowerOfTwo(height);
|
||||
GLsizei paddedWidth = RoundUpPow2((uint32_t)width);
|
||||
GLsizei paddedHeight = RoundUpPow2((uint32_t)height);
|
||||
|
||||
GLvoid* paddedPixels = new unsigned char[paddedWidth * paddedHeight * pixelsize];
|
||||
|
||||
|
@ -445,7 +445,7 @@ CalculatePOTSize(const IntSize& aSize, GLContext* gl)
|
||||
if (CanUploadNonPowerOfTwo(gl))
|
||||
return aSize;
|
||||
|
||||
return IntSize(NextPowerOfTwo(aSize.width), NextPowerOfTwo(aSize.height));
|
||||
return IntSize(RoundUpPow2(aSize.width), RoundUpPow2(aSize.height));
|
||||
}
|
||||
|
||||
// |aRect| is the rectangle we want to draw to. We will draw it with
|
||||
|
@ -126,8 +126,8 @@ GLBlitTextureImageHelper::BlitTextureImage(TextureImage *aSrc, const gfx::IntRec
|
||||
|
||||
gfx::IntSize realTexSize = srcSize;
|
||||
if (!CanUploadNonPowerOfTwo(gl)) {
|
||||
realTexSize = gfx::IntSize(gfx::NextPowerOfTwo(srcSize.width),
|
||||
gfx::NextPowerOfTwo(srcSize.height));
|
||||
realTexSize = gfx::IntSize(RoundUpPow2(srcSize.width),
|
||||
RoundUpPow2(srcSize.height));
|
||||
}
|
||||
|
||||
if (aSrc->GetWrapMode() == LOCAL_GL_REPEAT) {
|
||||
|
@ -1202,7 +1202,7 @@ gfxPlatform::ComputeTileSize()
|
||||
// Choose a size so that there are between 2 and 4 tiles per screen width.
|
||||
// FIXME: we should probably make sure this is within the max texture size,
|
||||
// but I think everything should at least support 1024
|
||||
w = h = clamped(NextPowerOfTwo(screenSize.width) / 4, 256, 1024);
|
||||
w = h = clamped(int32_t(RoundUpPow2(screenSize.width)) / 4, 256, 1024);
|
||||
}
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
@ -2500,7 +2500,7 @@ gfxPlatform::IsGfxInfoStatusOkay(int32_t aFeature, nsCString* aOutMessage, nsCSt
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t status;
|
||||
int32_t status;
|
||||
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(aFeature, aFailureId, &status)) &&
|
||||
status != nsIGfxInfo::FEATURE_STATUS_OK)
|
||||
{
|
||||
|
@ -292,16 +292,6 @@ namespace gfx {
|
||||
Color ToDeviceColor(Color aColor);
|
||||
Color ToDeviceColor(nscolor aColor);
|
||||
|
||||
/**
|
||||
* Returns the first integer greater than |aNumber| which is a power of two.
|
||||
*/
|
||||
static int
|
||||
NextPowerOfTwo(int aNumber)
|
||||
{
|
||||
MOZ_ASSERT(aNumber >= 0);
|
||||
return RoundUpPow2((size_t)aNumber + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a checked multiply of the given width, height, and bytes-per-pixel
|
||||
* values.
|
||||
|
@ -2160,8 +2160,8 @@ CreateCGContext(const LayoutDeviceIntSize& aSize)
|
||||
LayoutDeviceIntSize
|
||||
TextureSizeForSize(const LayoutDeviceIntSize& aSize)
|
||||
{
|
||||
return LayoutDeviceIntSize(gfx::NextPowerOfTwo(aSize.width),
|
||||
gfx::NextPowerOfTwo(aSize.height));
|
||||
return LayoutDeviceIntSize(RoundUpPow2(aSize.width),
|
||||
RoundUpPow2(aSize.height));
|
||||
}
|
||||
|
||||
// When this method is entered, mEffectsLock is already being held.
|
||||
|
Loading…
Reference in New Issue
Block a user