зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1057642 - Revert [Int]::PointTyped::[x|y] to be of primitive type. r=kats
--HG-- extra : rebase_source : 55e56423f6c8f5278315a6dc9dfcb9fb983c9309
This commit is contained in:
Родитель
bb5b3e24c2
Коммит
a5db405d9f
|
@ -726,7 +726,7 @@ public:
|
||||||
int32_t ScrollTop()
|
int32_t ScrollTop()
|
||||||
{
|
{
|
||||||
nsIScrollableFrame* sf = GetScrollFrame();
|
nsIScrollableFrame* sf = GetScrollFrame();
|
||||||
return sf ? sf->GetScrollPositionCSSPixels().y.value : 0;
|
return sf ? sf->GetScrollPositionCSSPixels().y : 0;
|
||||||
}
|
}
|
||||||
void SetScrollTop(int32_t aScrollTop)
|
void SetScrollTop(int32_t aScrollTop)
|
||||||
{
|
{
|
||||||
|
@ -739,7 +739,7 @@ public:
|
||||||
int32_t ScrollLeft()
|
int32_t ScrollLeft()
|
||||||
{
|
{
|
||||||
nsIScrollableFrame* sf = GetScrollFrame();
|
nsIScrollableFrame* sf = GetScrollFrame();
|
||||||
return sf ? sf->GetScrollPositionCSSPixels().x.value : 0;
|
return sf ? sf->GetScrollPositionCSSPixels().x : 0;
|
||||||
}
|
}
|
||||||
void SetScrollLeft(int32_t aScrollLeft)
|
void SetScrollLeft(int32_t aScrollLeft)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1989,7 +1989,7 @@ CanvasRenderingContext2D::ArcTo(double x1, double y1, double x2,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for colinearity
|
// Check for colinearity
|
||||||
dir = (p2.x - p1.x).value * (p0.y - p1.y).value + (p2.y - p1.y).value * (p1.x - p0.x).value;
|
dir = (p2.x - p1.x) * (p0.y - p1.y) + (p2.y - p1.y) * (p1.x - p0.x);
|
||||||
if (dir == 0) {
|
if (dir == 0) {
|
||||||
LineTo(p1.x, p1.y);
|
LineTo(p1.x, p1.y);
|
||||||
return;
|
return;
|
||||||
|
@ -4514,7 +4514,7 @@ CanvasPath::ArcTo(double x1, double y1, double x2, double y2, double radius,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for colinearity
|
// Check for colinearity
|
||||||
dir = (p2.x - p1.x).value * (p0.y - p1.y).value + (p2.y - p1.y).value * (p1.x - p0.x).value;
|
dir = (p2.x - p1.x) * (p0.y - p1.y) + (p2.y - p1.y) * (p1.x - p0.x);
|
||||||
if (dir == 0) {
|
if (dir == 0) {
|
||||||
LineTo(p1.x, p1.y);
|
LineTo(p1.x, p1.y);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1596,8 +1596,8 @@ EventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
|
||||||
LayoutDeviceIntPoint pt = aEvent->refPoint +
|
LayoutDeviceIntPoint pt = aEvent->refPoint +
|
||||||
LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset());
|
LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset());
|
||||||
LayoutDeviceIntPoint distance = pt - mGestureDownPoint;
|
LayoutDeviceIntPoint distance = pt - mGestureDownPoint;
|
||||||
if (Abs(distance.x.value) > AssertedCast<uint32_t>(pixelThresholdX) ||
|
if (Abs(distance.x) > AssertedCast<uint32_t>(pixelThresholdX) ||
|
||||||
Abs(distance.y.value) > AssertedCast<uint32_t>(pixelThresholdY)) {
|
Abs(distance.y) > AssertedCast<uint32_t>(pixelThresholdY)) {
|
||||||
if (Prefs::ClickHoldContextMenu()) {
|
if (Prefs::ClickHoldContextMenu()) {
|
||||||
// stop the click-hold before we fire off the drag gesture, in case
|
// stop the click-hold before we fire off the drag gesture, in case
|
||||||
// it takes a long time
|
// it takes a long time
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace gfx {
|
||||||
*/
|
*/
|
||||||
template <class T, class Sub, class Coord = T>
|
template <class T, class Sub, class Coord = T>
|
||||||
struct BasePoint {
|
struct BasePoint {
|
||||||
Coord x, y;
|
T x, y;
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
MOZ_CONSTEXPR BasePoint() : x(0), y(0) {}
|
MOZ_CONSTEXPR BasePoint() : x(0), y(0) {}
|
||||||
|
@ -68,7 +68,7 @@ struct BasePoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
T Length() const {
|
T Length() const {
|
||||||
return hypot(x.value, y.value);
|
return hypot(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Round() is *not* rounding to nearest integer if the values are negative.
|
// Round() is *not* rounding to nearest integer if the values are negative.
|
||||||
|
|
|
@ -2599,7 +2599,7 @@ DrawTargetD2D::SetupEffectForRadialGradient(const RadialGradientPattern *aPatter
|
||||||
mPrivateData->mEffect->GetVariableByName("DeviceSpaceToUserSpace")->
|
mPrivateData->mEffect->GetVariableByName("DeviceSpaceToUserSpace")->
|
||||||
AsMatrix()->SetMatrix(matrix);
|
AsMatrix()->SetMatrix(matrix);
|
||||||
|
|
||||||
float A = dc.x.value * dc.x.value + dc.y.value * dc.y.value - dr * dr;
|
float A = dc.x * dc.x + dc.y * dc.y - dr * dr;
|
||||||
|
|
||||||
uint32_t offset = 0;
|
uint32_t offset = 0;
|
||||||
switch (stops->mStopCollection->GetExtendMode()) {
|
switch (stops->mStopCollection->GetExtendMode()) {
|
||||||
|
|
|
@ -36,8 +36,8 @@ DrawTargetTiled::Init(const TileSet& aTiles)
|
||||||
mTiles[i].mTileOrigin.x + mTiles[i].mDrawTarget->GetSize().width);
|
mTiles[i].mTileOrigin.x + mTiles[i].mDrawTarget->GetSize().width);
|
||||||
uint32_t newYMost = max(mRect.YMost(),
|
uint32_t newYMost = max(mRect.YMost(),
|
||||||
mTiles[i].mTileOrigin.y + mTiles[i].mDrawTarget->GetSize().height);
|
mTiles[i].mTileOrigin.y + mTiles[i].mDrawTarget->GetSize().height);
|
||||||
mRect.x = min(mRect.x, mTiles[i].mTileOrigin.x.value);
|
mRect.x = min(mRect.x, mTiles[i].mTileOrigin.x);
|
||||||
mRect.y = min(mRect.y, mTiles[i].mTileOrigin.y.value);
|
mRect.y = min(mRect.y, mTiles[i].mTileOrigin.y);
|
||||||
mRect.width = newXMost - mRect.x;
|
mRect.width = newXMost - mRect.x;
|
||||||
mRect.height = newYMost - mRect.y;
|
mRect.height = newYMost - mRect.y;
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,7 +239,7 @@ static inline bool IsPatternSupportedByD2D(const Pattern &aPattern)
|
||||||
|
|
||||||
Point diff = pat->mCenter2 - pat->mCenter1;
|
Point diff = pat->mCenter2 - pat->mCenter1;
|
||||||
|
|
||||||
if (sqrt(diff.x.value * diff.x.value + diff.y.value * diff.y.value) >= pat->mRadius2) {
|
if (sqrt(diff.x * diff.x + diff.y * diff.y) >= pat->mRadius2) {
|
||||||
// Inner point lies outside the circle.
|
// Inner point lies outside the circle.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,7 +250,7 @@ FlattenBezierCurveSegment(const BezierControlPoints &aControlPoints,
|
||||||
Point cp21 = currentCP.mCP2 - currentCP.mCP3;
|
Point cp21 = currentCP.mCP2 - currentCP.mCP3;
|
||||||
Point cp31 = currentCP.mCP3 - currentCP.mCP1;
|
Point cp31 = currentCP.mCP3 - currentCP.mCP1;
|
||||||
|
|
||||||
Float s3 = (cp31.x.value * cp21.y.value - cp31.y.value * cp21.x.value) / hypotf(cp21.x, cp21.y);
|
Float s3 = (cp31.x * cp21.y - cp31.y * cp21.x) / hypotf(cp21.x, cp21.y);
|
||||||
|
|
||||||
t = 2 * Float(sqrt(aTolerance / (3. * abs(s3))));
|
t = 2 * Float(sqrt(aTolerance / (3. * abs(s3))));
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ FindInflectionApproximationRange(BezierControlPoints aControlPoints,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Float s3 = (cp41.x.value * cp21.y.value - cp41.y.value * cp21.x.value) / hypotf(cp21.x, cp21.y);
|
Float s3 = (cp41.x * cp21.y - cp41.y * cp21.x) / hypotf(cp21.x, cp21.y);
|
||||||
|
|
||||||
if (s3 == 0) {
|
if (s3 == 0) {
|
||||||
// This means within the precision we have it can be approximated
|
// This means within the precision we have it can be approximated
|
||||||
|
|
|
@ -98,14 +98,14 @@ typedef PointTyped<UnknownUnits> Point;
|
||||||
|
|
||||||
template<class units>
|
template<class units>
|
||||||
IntPointTyped<units> RoundedToInt(const PointTyped<units>& aPoint) {
|
IntPointTyped<units> RoundedToInt(const PointTyped<units>& aPoint) {
|
||||||
return IntPointTyped<units>(aPoint.x.Rounded(),
|
return IntPointTyped<units>(int32_t(floorf(aPoint.x + 0.5f)),
|
||||||
aPoint.y.Rounded());
|
int32_t(floorf(aPoint.y + 0.5f)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class units>
|
template<class units>
|
||||||
IntPointTyped<units> TruncatedToInt(const PointTyped<units>& aPoint) {
|
IntPointTyped<units> TruncatedToInt(const PointTyped<units>& aPoint) {
|
||||||
return IntPointTyped<units>(aPoint.x.Truncated(),
|
return IntPointTyped<units>(int32_t(aPoint.x),
|
||||||
aPoint.y.Truncated());
|
int32_t(aPoint.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class units>
|
template<class units>
|
||||||
|
|
|
@ -240,10 +240,10 @@ SVGTurbulenceRenderer<Type,Stitch,f32x4_t,i32x4_t,u8x16_t>::Noise2(Point aVec, c
|
||||||
uint8_t i = mLatticeSelector[b0.x & sBM];
|
uint8_t i = mLatticeSelector[b0.x & sBM];
|
||||||
uint8_t j = mLatticeSelector[b1.x & sBM];
|
uint8_t j = mLatticeSelector[b1.x & sBM];
|
||||||
|
|
||||||
const f32x4_t* qua = mGradient[(i + b0.y.value) & sBM];
|
const f32x4_t* qua = mGradient[(i + b0.y) & sBM];
|
||||||
const f32x4_t* qub = mGradient[(i + b1.y.value) & sBM];
|
const f32x4_t* qub = mGradient[(i + b1.y) & sBM];
|
||||||
const f32x4_t* qva = mGradient[(j + b0.y.value) & sBM];
|
const f32x4_t* qva = mGradient[(j + b0.y) & sBM];
|
||||||
const f32x4_t* qvb = mGradient[(j + b1.y.value) & sBM];
|
const f32x4_t* qvb = mGradient[(j + b1.y) & sBM];
|
||||||
|
|
||||||
return BiMix(simd::WSumF32(qua[0], qua[1], r.x, r.y),
|
return BiMix(simd::WSumF32(qua[0], qua[1], r.x, r.y),
|
||||||
simd::WSumF32(qva[0], qva[1], r.x - 1.f, r.y),
|
simd::WSumF32(qva[0], qva[1], r.x - 1.f, r.y),
|
||||||
|
|
|
@ -379,8 +379,8 @@ static bool IsCloseToVertical(float aAngle, float aThreshold)
|
||||||
template <typename Units>
|
template <typename Units>
|
||||||
static bool IsZero(const gfx::PointTyped<Units>& aPoint)
|
static bool IsZero(const gfx::PointTyped<Units>& aPoint)
|
||||||
{
|
{
|
||||||
return FuzzyEqualsMultiplicative(aPoint.x.value, 0.0f)
|
return FuzzyEqualsMultiplicative(aPoint.x, 0.0f)
|
||||||
&& FuzzyEqualsMultiplicative(aPoint.y.value, 0.0f);
|
&& FuzzyEqualsMultiplicative(aPoint.y, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void LogRendertraceRect(const ScrollableLayerGuid& aGuid, const char* aDesc, const char* aColor, const CSSRect& aRect)
|
static inline void LogRendertraceRect(const ScrollableLayerGuid& aGuid, const char* aDesc, const char* aColor, const CSSRect& aRect)
|
||||||
|
@ -538,9 +538,9 @@ public:
|
||||||
// We may have reached the end of the scroll range along one axis but
|
// We may have reached the end of the scroll range along one axis but
|
||||||
// not the other. In such a case we only want to hand off the relevant
|
// not the other. In such a case we only want to hand off the relevant
|
||||||
// component of the fling.
|
// component of the fling.
|
||||||
if (FuzzyEqualsAdditive(overscroll.x.value, 0.0f, COORDINATE_EPSILON)) {
|
if (FuzzyEqualsAdditive(overscroll.x, 0.0f, COORDINATE_EPSILON)) {
|
||||||
velocity.x = 0;
|
velocity.x = 0;
|
||||||
} else if (FuzzyEqualsAdditive(overscroll.y.value, 0.0f, COORDINATE_EPSILON)) {
|
} else if (FuzzyEqualsAdditive(overscroll.y, 0.0f, COORDINATE_EPSILON)) {
|
||||||
velocity.y = 0;
|
velocity.y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,8 +70,8 @@ void Axis::StartTouch(ScreenCoord aPos, uint32_t aTimestampMs) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Axis::AdjustDisplacement(CSSCoord aDisplacement,
|
bool Axis::AdjustDisplacement(CSSCoord aDisplacement,
|
||||||
CSSCoord& aDisplacementOut,
|
/* CSSCoord */ float& aDisplacementOut,
|
||||||
CSSCoord& aOverscrollAmountOut)
|
/* CSSCoord */ float& aOverscrollAmountOut)
|
||||||
{
|
{
|
||||||
if (mAxisLocked) {
|
if (mAxisLocked) {
|
||||||
aOverscrollAmountOut = 0;
|
aOverscrollAmountOut = 0;
|
||||||
|
|
|
@ -88,8 +88,8 @@ public:
|
||||||
* were changed.
|
* were changed.
|
||||||
*/
|
*/
|
||||||
bool AdjustDisplacement(CSSCoord aDisplacement,
|
bool AdjustDisplacement(CSSCoord aDisplacement,
|
||||||
CSSCoord& aDisplacementOut,
|
/* CSSCoord */ float& aDisplacementOut,
|
||||||
CSSCoord& aOverscrollAmountOut);
|
/* CSSCoord */ float& aOverscrollAmountOut);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overscrolls this axis by the requested amount in the requested direction.
|
* Overscrolls this axis by the requested amount in the requested direction.
|
||||||
|
|
|
@ -474,8 +474,8 @@ DecomposeIntoNoRepeatRects(const Rect& aRect,
|
||||||
|
|
||||||
// If we are dealing with wrapping br.x and br.y are greater than 1.0 so
|
// If we are dealing with wrapping br.x and br.y are greater than 1.0 so
|
||||||
// wrap them here as well.
|
// wrap them here as well.
|
||||||
br = Point(xwrap ? WrapTexCoord(br.x) : br.x.value,
|
br = Point(xwrap ? WrapTexCoord(br.x) : br.x,
|
||||||
ywrap ? WrapTexCoord(br.y) : br.y.value);
|
ywrap ? WrapTexCoord(br.y) : br.y);
|
||||||
|
|
||||||
// If we wrap around along the x axis, we will draw first from
|
// If we wrap around along the x axis, we will draw first from
|
||||||
// tl.x .. 1.0 and then from 0.0 .. br.x (which we just wrapped above).
|
// tl.x .. 1.0 and then from 0.0 .. br.x (which we just wrapped above).
|
||||||
|
|
|
@ -1805,8 +1805,8 @@ nsBaseWidget::debug_DumpEvent(FILE * aFileOut,
|
||||||
(void *) aWidget,
|
(void *) aWidget,
|
||||||
aWidgetName.get(),
|
aWidgetName.get(),
|
||||||
aWindowID,
|
aWindowID,
|
||||||
aGuiEvent->refPoint.x.value,
|
aGuiEvent->refPoint.x,
|
||||||
aGuiEvent->refPoint.y.value);
|
aGuiEvent->refPoint.y);
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
/* static */ void
|
/* static */ void
|
||||||
|
|
Загрузка…
Ссылка в новой задаче