From 4b82f948ca98459955a0640c00a36136bce1e086 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Wed, 23 Sep 2020 06:33:17 +0000 Subject: [PATCH] Bug 1659227 - Change the partial pre-render rect unit to LayoutDeviceRect. r=botond In SVG coordinates the rect size might be fractional. Differential Revision: https://phabricator.services.mozilla.com/D90648 --- gfx/layers/AnimationHelper.cpp | 2 +- gfx/layers/AnimationHelper.h | 2 +- gfx/layers/AnimationInfo.cpp | 4 ++-- gfx/layers/ipc/LayersMessages.ipdlh | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gfx/layers/AnimationHelper.cpp b/gfx/layers/AnimationHelper.cpp index e5221da7971e..af2c033a661d 100644 --- a/gfx/layers/AnimationHelper.cpp +++ b/gfx/layers/AnimationHelper.cpp @@ -658,7 +658,7 @@ static bool LineSegmentIntersectsClip(double aX0, double aY0, double aX1, } // static -bool AnimationHelper::ShouldBeJank(const LayoutDeviceIntRect& aPrerenderedRect, +bool AnimationHelper::ShouldBeJank(const LayoutDeviceRect& aPrerenderedRect, SideBits aOverflowSides, const gfx::Matrix4x4& aTransform, const ParentLayerRect& aClipRect) { diff --git a/gfx/layers/AnimationHelper.h b/gfx/layers/AnimationHelper.h index 224ad7106e14..84251edd06d3 100644 --- a/gfx/layers/AnimationHelper.h +++ b/gfx/layers/AnimationHelper.h @@ -141,7 +141,7 @@ class AnimationHelper { * composited in |aClipRect| there appears area which wasn't pre-rendered * on the main-thread. I.e. checkerboarding. */ - static bool ShouldBeJank(const LayoutDeviceIntRect& aPrerenderedRect, + static bool ShouldBeJank(const LayoutDeviceRect& aPrerenderedRect, SideBits aOverflowedSides, const gfx::Matrix4x4& aTransform, const ParentLayerRect& aClipRect); diff --git a/gfx/layers/AnimationInfo.cpp b/gfx/layers/AnimationInfo.cpp index 07ebdc57c267..a707feb67cd6 100644 --- a/gfx/layers/AnimationInfo.cpp +++ b/gfx/layers/AnimationInfo.cpp @@ -756,8 +756,8 @@ static PartialPrerenderData GetPartialPrerenderData( aFrame, devPixelsToAppUnits, clipFrame, scrollFrame); return PartialPrerenderData{ - LayoutDeviceIntRect::FromAppUnitsToInside(partialPrerenderedRect, - devPixelsToAppUnits), + LayoutDeviceRect::FromAppUnits(partialPrerenderedRect, + devPixelsToAppUnits), GetOverflowedSides(overflow, partialPrerenderedRect), scrollId, clipRect, diff --git a/gfx/layers/ipc/LayersMessages.ipdlh b/gfx/layers/ipc/LayersMessages.ipdlh index 4697682b5406..f7c1036d88b6 100644 --- a/gfx/layers/ipc/LayersMessages.ipdlh +++ b/gfx/layers/ipc/LayersMessages.ipdlh @@ -45,6 +45,7 @@ using mozilla::ParentLayerIntRect from "Units.h"; using mozilla::ParentLayerRect from "Units.h"; using mozilla::LayoutDeviceIntRect from "Units.h"; using mozilla::LayoutDevicePoint from "Units.h"; +using mozilla::LayoutDeviceRect from "Units.h"; using mozilla::layers::ScaleMode from "mozilla/layers/LayersTypes.h"; using mozilla::layers::EventRegions from "mozilla/layers/LayersTypes.h"; using mozilla::layers::EventRegionsOverride from "mozilla/layers/LayersTypes.h"; @@ -158,7 +159,7 @@ comparable struct MotionPathData { }; comparable struct PartialPrerenderData { - LayoutDeviceIntRect rect; + LayoutDeviceRect rect; SideBits overflowedSides; // the scroll id of the nearest scrollable frame of this partial prerender // data.