mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 06:09:19 +00:00
Bug 1931356 - Remove NS_ROUNDUP (replace usage by RoundUpToMultiple) r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D229017
This commit is contained in:
parent
b99c072211
commit
d8ad9862e4
@ -11,7 +11,6 @@
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsAttrValue.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsAlgorithm.h"
|
||||
#include <algorithm>
|
||||
|
||||
namespace mozilla::dom {
|
||||
|
@ -113,7 +113,7 @@ class gfxDWriteFontEntry final : public gfxFontEntry {
|
||||
mStretchRange =
|
||||
StretchRange(FontStretchFromDWriteStretch(aFont->GetStretch()));
|
||||
|
||||
int weight = NS_ROUNDUP(aFont->GetWeight() - 50, 100);
|
||||
int weight = mozilla::RoundUpToMultiple(aFont->GetWeight() - 50, 100);
|
||||
weight = std::clamp(weight, 100, 900);
|
||||
mWeightRange = WeightRange(FontWeight::FromInt(weight));
|
||||
|
||||
|
@ -5,8 +5,8 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "StackArena.h"
|
||||
#include "nsAlgorithm.h"
|
||||
#include "nsDebug.h"
|
||||
#include "mozilla/gfx/NumericTools.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -114,7 +114,7 @@ void* StackArena::Allocate(size_t aSize) {
|
||||
NS_ASSERTION(mStackTop > 0, "Allocate called without Push");
|
||||
|
||||
// Align to a multiple of 8.
|
||||
aSize = NS_ROUNDUP<size_t>(aSize, 8);
|
||||
aSize = RoundUpToMultiple(aSize, 8);
|
||||
|
||||
// On stack overflow, grab another block.
|
||||
if (mPos + aSize >= StackBlock::MAX_USABLE_SIZE) {
|
||||
|
@ -10,11 +10,6 @@
|
||||
#include <cstdint>
|
||||
#include "mozilla/Assertions.h"
|
||||
|
||||
template <class T>
|
||||
inline T NS_ROUNDUP(const T& aA, const T& aB) {
|
||||
return ((aA + (aB - 1)) / aB) * aB;
|
||||
}
|
||||
|
||||
// We use these instead of std::min/max because we can't include the algorithm
|
||||
// header in all of XPCOM because the stl wrappers will error out when included
|
||||
// in parts of XPCOM. These functions should never be used outside of XPCOM.
|
||||
|
Loading…
x
Reference in New Issue
Block a user