mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-27 02:47:31 +09:00
Issue #1925 - Move NS_FOR_CSS_HALF_CORNER to gfx/2d/Types.h and rewrite it.
This commit is contained in:
parent
8dc8875db6
commit
1730199755
2 changed files with 16 additions and 2 deletions
|
|
@ -443,6 +443,22 @@ enum HalfCorner {
|
||||||
eCornerBottomLeftY = 7
|
eCornerBottomLeftY = 7
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Creates a for loop that walks over the eight mozilla::HalfCorner values.
|
||||||
|
// This implementation uses the same technique as NS_FOR_CSS_SIDES.
|
||||||
|
#define NS_FOR_CSS_HALF_CORNERS(var_) \
|
||||||
|
int32_t MOZ_CONCAT(var_,__LINE__) = mozilla::eCornerTopLeftX; \
|
||||||
|
for (mozilla::HalfCorner var_; \
|
||||||
|
MOZ_CONCAT(var_,__LINE__) <= mozilla::eCornerBottomLeftY && \
|
||||||
|
(var_ = mozilla::HalfCorner(MOZ_CONCAT(var_,__LINE__)), true); \
|
||||||
|
++MOZ_CONCAT(var_,__LINE__))
|
||||||
|
|
||||||
|
static inline mozilla::HalfCorner operator++(mozilla::HalfCorner& aHalfCorner) {
|
||||||
|
MOZ_ASSERT(aHalfCorner >= eCornerTopLeftX && aHalfCorner <= eCornerBottomLeftY,
|
||||||
|
"Out of range half corner!");
|
||||||
|
aHalfCorner = mozilla::HalfCorner(aHalfCorner + 1);
|
||||||
|
return aHalfCorner;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
#endif /* MOZILLA_GFX_TYPES_H_ */
|
#endif /* MOZILLA_GFX_TYPES_H_ */
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,6 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#define NS_FOR_CSS_HALF_CORNERS(var_) for (int32_t var_ = 0; var_ < 8; ++var_)
|
|
||||||
|
|
||||||
// The results of these conversion macros are exhaustively checked in
|
// The results of these conversion macros are exhaustively checked in
|
||||||
// nsStyleCoord.cpp.
|
// nsStyleCoord.cpp.
|
||||||
// Arguments must not have side effects.
|
// Arguments must not have side effects.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue