mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1228597 - Remove the MOZ_SINGLE_PROCESS_APZ define. r=tn
Code previously guarded by this (added in bug 1224015) will now run unconditionally.
This commit is contained in:
parent
ce37075a9f
commit
b1fc428204
@ -4224,7 +4224,6 @@ cairo-uikit)
|
||||
CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
|
||||
MOZ_USER_DIR="Mozilla"
|
||||
MOZ_FS_LAYOUT=bundle
|
||||
AC_DEFINE(MOZ_SINGLE_PROCESS_APZ)
|
||||
;;
|
||||
|
||||
cairo-android)
|
||||
@ -4798,11 +4797,8 @@ MOZ_ARG_ENABLE_BOOL(android-apz,
|
||||
MOZ_ANDROID_APZ=1,
|
||||
MOZ_ANDROID_APZ=)
|
||||
if test -n "$MOZ_ANDROID_APZ"; then
|
||||
dnl Do this if defined in confvars.sh
|
||||
AC_DEFINE(MOZ_ANDROID_APZ)
|
||||
if test -z "$MOZ_B2GDROID"; then
|
||||
AC_DEFINE(MOZ_SINGLE_PROCESS_APZ)
|
||||
fi
|
||||
dnl Do this if defined in confvars.sh
|
||||
AC_DEFINE(MOZ_ANDROID_APZ)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
|
@ -7671,11 +7671,9 @@ nsContentUtils::ToWidgetPoint(const CSSPoint& aPoint,
|
||||
const nsPoint& aOffset,
|
||||
nsPresContext* aPresContext)
|
||||
{
|
||||
nsPoint point = CSSPoint::ToAppUnits(aPoint) + aOffset;
|
||||
#if defined(MOZ_SINGLE_PROCESS_APZ)
|
||||
point = point.ApplyResolution(aPresContext->PresShell()->GetCumulativeScaleResolution());
|
||||
#endif
|
||||
return LayoutDeviceIntPoint::FromAppUnitsRounded(point, aPresContext->AppUnitsPerDevPixel());
|
||||
return LayoutDeviceIntPoint::FromAppUnitsRounded(
|
||||
(CSSPoint::ToAppUnits(aPoint) + aOffset).ApplyResolution(aPresContext->PresShell()->GetCumulativeScaleResolution()),
|
||||
aPresContext->AppUnitsPerDevPixel());
|
||||
}
|
||||
|
||||
nsView*
|
||||
|
@ -935,11 +935,9 @@ Event::GetScreenCoords(nsPresContext* aPresContext,
|
||||
nsPoint pt =
|
||||
LayoutDevicePixel::ToAppUnits(aPoint, aPresContext->DeviceContext()->AppUnitsPerDevPixelAtUnitFullZoom());
|
||||
|
||||
#if defined(MOZ_SINGLE_PROCESS_APZ)
|
||||
if (aPresContext->PresShell()) {
|
||||
pt = pt.RemoveResolution(aPresContext->PresShell()->GetCumulativeScaleResolution());
|
||||
}
|
||||
#endif
|
||||
|
||||
pt += LayoutDevicePixel::ToAppUnits(guiEvent->widget->WidgetToScreenOffset(),
|
||||
aPresContext->DeviceContext()->AppUnitsPerDevPixelAtUnitFullZoom());
|
||||
|
@ -423,23 +423,6 @@ APZCCallbackHelper::ApplyCallbackTransform(const CSSPoint& aInput,
|
||||
if (aGuid.mScrollId == FrameMetrics::NULL_SCROLL_ID) {
|
||||
return input;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> content = nsLayoutUtils::FindContentFor(aGuid.mScrollId);
|
||||
if (!content) {
|
||||
return input;
|
||||
}
|
||||
|
||||
#if !defined(MOZ_SINGLE_PROCESS_APZ)
|
||||
// First, scale inversely by the root content document's pres shell
|
||||
// resolution to cancel the scale-to-resolution transform that the
|
||||
// compositor adds to the layer with the pres shell resolution. The points
|
||||
// sent to Gecko by APZ don't have this transform unapplied (unlike other
|
||||
// compositor-side transforms) because APZ doesn't know about it.
|
||||
if (nsIPresShell* shell = GetRootContentDocumentPresShellForContent(content)) {
|
||||
input = input / shell->GetResolution();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Apply the callback-transform.
|
||||
// XXX: technically we need to walk all the way up the layer tree from the layer
|
||||
// represented by |aGuid.mScrollId| up to the root of the layer tree and apply
|
||||
@ -451,12 +434,10 @@ APZCCallbackHelper::ApplyCallbackTransform(const CSSPoint& aInput,
|
||||
// some things transformed improperly. In practice we should rarely hit scenarios
|
||||
// where any of this matters, so I'm skipping it for now and just doing the single
|
||||
// transform for the layer that the input hit.
|
||||
|
||||
void* property = content->GetProperty(nsGkAtoms::apzCallbackTransform);
|
||||
if (property) {
|
||||
CSSPoint delta = (*static_cast<CSSPoint*>(property));
|
||||
|
||||
#if defined(MOZ_SINGLE_PROCESS_APZ)
|
||||
nsCOMPtr<nsIContent> content = nsLayoutUtils::FindContentFor(aGuid.mScrollId);
|
||||
if (content) {
|
||||
void* property = content->GetProperty(nsGkAtoms::apzCallbackTransform);
|
||||
CSSPoint delta = property ? (*static_cast<CSSPoint*>(property)) : CSSPoint(0.0f, 0.0f);
|
||||
// The delta is in root content document coordinate space while the
|
||||
// aInput point is in root document coordinate space so convert the
|
||||
// delta to root document space before adding it to the aInput point.
|
||||
@ -466,7 +447,6 @@ APZCCallbackHelper::ApplyCallbackTransform(const CSSPoint& aInput,
|
||||
}
|
||||
delta.x = delta.x * resolution;
|
||||
delta.y = delta.y * resolution;
|
||||
#endif // MOZ_SINGLE_PROCESS_APZ
|
||||
input += delta;
|
||||
}
|
||||
return input;
|
||||
|
@ -147,7 +147,6 @@ ChromeProcessController::HandleDoubleTap(const mozilla::CSSPoint& aPoint,
|
||||
}
|
||||
|
||||
CSSPoint point = APZCCallbackHelper::ApplyCallbackTransform(aPoint, aGuid);
|
||||
#if defined(MOZ_SINGLE_PROCESS_APZ)
|
||||
// CalculateRectToZoomTo performs a hit test on the frame associated with the
|
||||
// Root Content Document. Unfortunately that frame does not know about the
|
||||
// resolution of the document and so we must remove it before calculating
|
||||
@ -156,7 +155,6 @@ ChromeProcessController::HandleDoubleTap(const mozilla::CSSPoint& aPoint,
|
||||
const float resolution = presShell->ScaleToResolution() ? presShell->GetResolution () : 1.0f;
|
||||
point.x = point.x / resolution;
|
||||
point.y = point.y / resolution;
|
||||
#endif // MOZ_SINGLE_PROCESS_APZ
|
||||
CSSRect zoomToRect = CalculateRectToZoomTo(document, point);
|
||||
|
||||
uint32_t presShellId;
|
||||
|
@ -4575,13 +4575,9 @@ nsDisplayResolution::HitTest(nsDisplayListBuilder* aBuilder,
|
||||
HitTestState* aState,
|
||||
nsTArray<nsIFrame*> *aOutFrames)
|
||||
{
|
||||
#if defined(MOZ_SINGLE_PROCESS_APZ)
|
||||
nsIPresShell* presShell = mFrame->PresContext()->PresShell();
|
||||
nsRect rect = aRect.RemoveResolution(presShell->ScaleToResolution() ? presShell->GetResolution () : 1.0f);
|
||||
mList.HitTest(aBuilder, rect, aState, aOutFrames);
|
||||
#else
|
||||
mList.HitTest(aBuilder, aRect, aState, aOutFrames);
|
||||
#endif // MOZ_SINGLE_PROCESS_APZ
|
||||
}
|
||||
|
||||
already_AddRefed<Layer>
|
||||
|
@ -2021,9 +2021,7 @@ nsLayoutUtils::GetEventCoordinatesRelativeTo(nsIWidget* aWidget,
|
||||
nsPoint pt(presContext->DevPixelsToAppUnits(aPoint.x),
|
||||
presContext->DevPixelsToAppUnits(aPoint.y));
|
||||
pt = pt - view->ViewToWidgetOffset();
|
||||
#if defined(MOZ_SINGLE_PROCESS_APZ)
|
||||
pt = pt.RemoveResolution(presContext->PresShell()->GetCumulativeScaleResolution());
|
||||
#endif // MOZ_SINGLE_PROCESS_APZ
|
||||
return pt;
|
||||
}
|
||||
}
|
||||
@ -2059,12 +2057,10 @@ nsLayoutUtils::GetEventCoordinatesRelativeTo(nsIWidget* aWidget,
|
||||
int32_t rootAPD = rootFrame->PresContext()->AppUnitsPerDevPixel();
|
||||
int32_t localAPD = aFrame->PresContext()->AppUnitsPerDevPixel();
|
||||
widgetToView = widgetToView.ScaleToOtherAppUnits(rootAPD, localAPD);
|
||||
#if defined(MOZ_SINGLE_PROCESS_APZ)
|
||||
nsIPresShell* shell = aFrame->PresContext()->PresShell();
|
||||
|
||||
// XXX Bug 1224748 - Update nsLayoutUtils functions to correctly handle nsPresShell resolution
|
||||
widgetToView = widgetToView.RemoveResolution(shell->GetCumulativeScaleResolution());
|
||||
#endif
|
||||
|
||||
/* If we encountered a transform, we can't do simple arithmetic to figure
|
||||
* out how to convert back to aFrame's coordinates and must use the CTM.
|
||||
@ -2812,10 +2808,7 @@ nsLayoutUtils::TranslateViewToWidget(nsPresContext* aPresContext,
|
||||
return LayoutDeviceIntPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
|
||||
}
|
||||
|
||||
nsPoint pt = aPt + viewOffset;
|
||||
#if defined(MOZ_SINGLE_PROCESS_APZ)
|
||||
pt = pt.ApplyResolution(aPresContext->PresShell()->GetCumulativeScaleResolution());
|
||||
#endif // MOZ_SINGLE_PROCESS_APZ
|
||||
nsPoint pt = (aPt + viewOffset).ApplyResolution(aPresContext->PresShell()->GetCumulativeScaleResolution());
|
||||
LayoutDeviceIntPoint relativeToViewWidget(aPresContext->AppUnitsToDevPixels(pt.x),
|
||||
aPresContext->AppUnitsToDevPixels(pt.y));
|
||||
return relativeToViewWidget + WidgetToWidgetOffset(viewWidget, aWidget);
|
||||
|
@ -442,12 +442,10 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
aBuilder->EnterPresShell(subdocRootFrame,
|
||||
pointerEventsNone && !passPointerEventsToChildren);
|
||||
|
||||
#if defined(MOZ_SINGLE_PROCESS_APZ)
|
||||
if (!haveDisplayPort) {
|
||||
// Remove nsPresShell resolution
|
||||
dirty = dirty.RemoveResolution(presShell->ScaleToResolution() ? presShell->GetResolution () : 1.0f);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
dirty = aDirtyRect;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user