Bug 1574493 - Part 3. Stop rounding rects/clips during display list building. r=jrmuizel

Rounding in layout pixels is very close to snapping in raster pixels if
there are no transforms involved. This is why it worked most of the time
and fell flat in many edge cases. In future parts of this series, we
will trust scene building and frame building to do the heavy lifting for
snapping purposes.

Differential Revision: https://phabricator.services.mozilla.com/D45058

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Osmond 2019-09-13 10:48:31 +00:00
Родитель b124fe4b02
Коммит b2d4e121cb
22 изменённых файлов: 120 добавлений и 103 удалений

Просмотреть файл

@ -381,7 +381,7 @@ void AsyncImagePipelineManager::ApplyAsyncImageForPipeline(
params.mix_blend_mode = aPipeline->mMixBlendMode; params.mix_blend_mode = aPipeline->mMixBlendMode;
Maybe<wr::WrSpatialId> referenceFrameId = builder.PushStackingContext( Maybe<wr::WrSpatialId> referenceFrameId = builder.PushStackingContext(
params, wr::ToRoundedLayoutRect(aPipeline->mScBounds), params, wr::ToLayoutRect(aPipeline->mScBounds),
// This is fine to do unconditionally because we only push images here. // This is fine to do unconditionally because we only push images here.
wr::RasterSpace::Screen()); wr::RasterSpace::Screen());
@ -402,14 +402,13 @@ void AsyncImagePipelineManager::ApplyAsyncImageForPipeline(
MOZ_ASSERT(aPipeline->mCurrentTexture->AsWebRenderTextureHost()); MOZ_ASSERT(aPipeline->mCurrentTexture->AsWebRenderTextureHost());
Range<wr::ImageKey> range_keys(&keys[0], keys.Length()); Range<wr::ImageKey> range_keys(&keys[0], keys.Length());
aPipeline->mCurrentTexture->PushDisplayItems( aPipeline->mCurrentTexture->PushDisplayItems(
builder, wr::ToRoundedLayoutRect(rect), wr::ToRoundedLayoutRect(rect), builder, wr::ToLayoutRect(rect), wr::ToLayoutRect(rect),
aPipeline->mFilter, range_keys); aPipeline->mFilter, range_keys);
HoldExternalImage(aPipelineId, aEpoch, aPipeline->mCurrentTexture); HoldExternalImage(aPipelineId, aEpoch, aPipeline->mCurrentTexture);
} else { } else {
MOZ_ASSERT(keys.Length() == 1); MOZ_ASSERT(keys.Length() == 1);
builder.PushImage(wr::ToRoundedLayoutRect(rect), builder.PushImage(wr::ToLayoutRect(rect), wr::ToLayoutRect(rect), true,
wr::ToRoundedLayoutRect(rect), true, aPipeline->mFilter, aPipeline->mFilter, keys[0]);
keys[0]);
} }
} }

Просмотреть файл

@ -304,8 +304,8 @@ Maybe<wr::WrSpaceAndClip> ClipManager::DefineScrollLayers(
LayoutDevicePoint scrollOffset = LayoutDevicePoint scrollOffset =
metrics.GetScrollOffset() * metrics.GetDevPixelsPerCSSPixel(); metrics.GetScrollOffset() * metrics.GetDevPixelsPerCSSPixel();
return Some(mBuilder->DefineScrollLayer( return Some(mBuilder->DefineScrollLayer(
viewId, parent, wr::ToRoundedLayoutRect(contentRect), viewId, parent, wr::ToLayoutRect(contentRect),
wr::ToRoundedLayoutRect(clipBounds), wr::ToLayoutPoint(scrollOffset))); wr::ToLayoutRect(clipBounds), wr::ToLayoutPoint(scrollOffset)));
} }
Maybe<wr::WrClipChainId> ClipManager::DefineClipChain( Maybe<wr::WrClipChainId> ClipManager::DefineClipChain(
@ -342,7 +342,7 @@ Maybe<wr::WrClipChainId> ClipManager::DefineClipChain(
// Define the clip // Define the clip
spaceAndClip->space = SpatialIdAfterOverride(spaceAndClip->space); spaceAndClip->space = SpatialIdAfterOverride(spaceAndClip->space);
wr::WrClipId clipId = mBuilder->DefineClip( wr::WrClipId clipId = mBuilder->DefineClip(
spaceAndClip, wr::ToRoundedLayoutRect(clip), &wrRoundedRects); spaceAndClip, wr::ToLayoutRect(clip), &wrRoundedRects);
clipIds.AppendElement(clipId); clipIds.AppendElement(clipId);
cache[chain] = clipId; cache[chain] = clipId;
CLIP_LOG("cache[%p] <= %zu\n", chain, clipId.id); CLIP_LOG("cache[%p] <= %zu\n", chain, clipId.id);
@ -373,7 +373,7 @@ void ClipManager::ItemClips::UpdateSeparateLeaf(
Maybe<wr::LayoutRect> clipLeaf; Maybe<wr::LayoutRect> clipLeaf;
if (mSeparateLeaf) { if (mSeparateLeaf) {
MOZ_ASSERT(mChain); MOZ_ASSERT(mChain);
clipLeaf.emplace(wr::ToRoundedLayoutRect(LayoutDeviceRect::FromAppUnits( clipLeaf.emplace(wr::ToLayoutRect(LayoutDeviceRect::FromAppUnits(
mChain->mClip.GetClipRect(), aAppUnitsPerDevPixel))); mChain->mClip.GetClipRect(), aAppUnitsPerDevPixel)));
} }

Просмотреть файл

@ -1927,8 +1927,8 @@ bool WebRenderCommandBuilder::PushImage(
return false; return false;
} }
auto r = wr::ToRoundedLayoutRect(aRect); auto r = wr::ToLayoutRect(aRect);
auto c = wr::ToRoundedLayoutRect(aClip); auto c = wr::ToLayoutRect(aClip);
aBuilder.PushImage(r, c, !aItem->BackfaceIsHidden(), rendering, key.value()); aBuilder.PushImage(r, c, !aItem->BackfaceIsHidden(), rendering, key.value());
return true; return true;
@ -2563,7 +2563,7 @@ bool WebRenderCommandBuilder::PushItemAsImage(
return false; return false;
} }
wr::LayoutRect dest = wr::ToRoundedLayoutRect(imageRect); wr::LayoutRect dest = wr::ToLayoutRect(imageRect);
gfx::SamplingFilter sampleFilter = gfx::SamplingFilter sampleFilter =
nsLayoutUtils::GetSamplingFilterForFrame(aItem->Frame()); nsLayoutUtils::GetSamplingFilterForFrame(aItem->Frame());
aBuilder.PushImage(dest, dest, !aItem->BackfaceIsHidden(), aBuilder.PushImage(dest, dest, !aItem->BackfaceIsHidden(),

Просмотреть файл

@ -315,7 +315,7 @@ void WebRenderLayerManager::EndTransactionWithoutLayer(
renderRoot == wr::RenderRoot::Default renderRoot == wr::RenderRoot::Default
? LayoutDeviceSize(size) ? LayoutDeviceSize(size)
: LayoutDeviceSize()); : LayoutDeviceSize());
wrRects[renderRoot] = wr::ToRoundedLayoutRect(rects[renderRoot]); wrRects[renderRoot] = wr::ToLayoutRect(rects[renderRoot]);
} }
wr::DisplayListBuilder builder( wr::DisplayListBuilder builder(

Просмотреть файл

@ -263,7 +263,7 @@ void WebRenderImageData::CreateAsyncImageWebRenderCommands(
// context need to be done manually and pushed over to the parent side, // context need to be done manually and pushed over to the parent side,
// where it will be done when we build the display list for the iframe. // where it will be done when we build the display list for the iframe.
// That happens in AsyncImagePipelineManager. // That happens in AsyncImagePipelineManager.
wr::LayoutRect r = wr::ToRoundedLayoutRect(aBounds); wr::LayoutRect r = wr::ToLayoutRect(aBounds);
aBuilder.PushIFrame(r, aIsBackfaceVisible, mPipelineId.ref(), aBuilder.PushIFrame(r, aIsBackfaceVisible, mPipelineId.ref(),
/*ignoreMissingPipelines*/ false); /*ignoreMissingPipelines*/ false);

Просмотреть файл

@ -6967,17 +6967,46 @@ IntSize nsLayoutUtils::ComputeImageContainerDrawingParameters(
} }
} }
// Compute our size in layer pixels. We may need to revisit this for Android // Attempt to snap pixels, the same as ComputeSnappedImageDrawingParameters.
// because mobile websites are rarely displayed at a 1:1 // Any changes to the algorithm here will need to be reflected there.
// LayoutPixel:ScreenPixel ratio and the snapping here may be insufficient. bool snapped = false;
const LayerIntSize layerSize = gfxSize gfxLayerSize;
RoundedToInt(LayerSize(aDestRect.Width() * scaleFactors.width, const gfx::Matrix& itm = aSc.GetInheritedTransform();
aDestRect.Height() * scaleFactors.height)); if (!itm.HasNonAxisAlignedTransform() && itm._11 > 0.0 && itm._22 > 0.0) {
gfxRect rect(gfxPoint(aDestRect.X(), aDestRect.Y()),
gfxSize(aDestRect.Width(), aDestRect.Height()));
// An empty size is unacceptable so we ensure our suggested size is at least gfxPoint p1 = ThebesPoint(itm.TransformPoint(ToPoint(rect.TopLeft())));
// 1 pixel wide/tall. gfxPoint p2 = ThebesPoint(itm.TransformPoint(ToPoint(rect.TopRight())));
gfxSize gfxLayerSize = gfxPoint p3 = ThebesPoint(itm.TransformPoint(ToPoint(rect.BottomRight())));
gfxSize(std::max(layerSize.width, 1), std::max(layerSize.height, 1));
if (p2 == gfxPoint(p1.x, p3.y) || p2 == gfxPoint(p3.x, p1.y)) {
p1.Round();
p3.Round();
rect.MoveTo(gfxPoint(std::min(p1.x, p3.x), std::min(p1.y, p3.y)));
rect.SizeTo(gfxSize(std::max(p1.x, p3.x) - rect.X(),
std::max(p1.y, p3.y) - rect.Y()));
// An empty size is unacceptable so we ensure our suggested size is at
// least 1 pixel wide/tall.
gfxLayerSize =
gfxSize(std::max(rect.Width(), 1.0), std::max(rect.Height(), 1.0));
snapped = true;
}
}
if (!snapped) {
// Compute our size in layer pixels.
const LayerIntSize layerSize =
RoundedToInt(LayerSize(aDestRect.Width() * scaleFactors.width,
aDestRect.Height() * scaleFactors.height));
// An empty size is unacceptable so we ensure our suggested size is at least
// 1 pixel wide/tall.
gfxLayerSize =
gfxSize(std::max(layerSize.width, 1), std::max(layerSize.height, 1));
}
return aImage->OptimalImageSizeForDest( return aImage->OptimalImageSizeForDest(
gfxLayerSize, imgIContainer::FRAME_CURRENT, samplingFilter, aFlags); gfxLayerSize, imgIContainer::FRAME_CURRENT, samplingFilter, aFlags);

Просмотреть файл

@ -134,11 +134,11 @@ bool nsDisplayButtonBoxShadowOuter::CreateWebRenderCommands(
nsRect shadowRect = nsRect(ToReferenceFrame(), mFrame->GetSize()); nsRect shadowRect = nsRect(ToReferenceFrame(), mFrame->GetSize());
LayoutDeviceRect deviceBox = LayoutDeviceRect deviceBox =
LayoutDeviceRect::FromAppUnits(shadowRect, appUnitsPerDevPixel); LayoutDeviceRect::FromAppUnits(shadowRect, appUnitsPerDevPixel);
wr::LayoutRect deviceBoxRect = wr::ToRoundedLayoutRect(deviceBox); wr::LayoutRect deviceBoxRect = wr::ToLayoutRect(deviceBox);
LayoutDeviceRect clipRect = LayoutDeviceRect clipRect =
LayoutDeviceRect::FromAppUnits(GetPaintRect(), appUnitsPerDevPixel); LayoutDeviceRect::FromAppUnits(GetPaintRect(), appUnitsPerDevPixel);
wr::LayoutRect deviceClipRect = wr::ToRoundedLayoutRect(clipRect); wr::LayoutRect deviceClipRect = wr::ToLayoutRect(clipRect);
bool hasBorderRadius; bool hasBorderRadius;
Unused << nsCSSRendering::HasBoxShadowNativeTheme(mFrame, hasBorderRadius); Unused << nsCSSRendering::HasBoxShadowNativeTheme(mFrame, hasBorderRadius);

Просмотреть файл

@ -185,12 +185,12 @@ bool nsDisplayFieldSetBorder::CreateWebRenderCommands(
if (!legendRect.IsEmpty()) { if (!legendRect.IsEmpty()) {
// We need to clip out the part of the border where the legend would go // We need to clip out the part of the border where the legend would go
auto appUnitsPerDevPixel = frame->PresContext()->AppUnitsPerDevPixel(); auto appUnitsPerDevPixel = frame->PresContext()->AppUnitsPerDevPixel();
auto layoutRect = wr::ToRoundedLayoutRect(LayoutDeviceRect::FromAppUnits( auto layoutRect = wr::ToLayoutRect(LayoutDeviceRect::FromAppUnits(
frame->GetVisualOverflowRectRelativeToSelf() + offset, frame->GetVisualOverflowRectRelativeToSelf() + offset,
appUnitsPerDevPixel)); appUnitsPerDevPixel));
wr::ComplexClipRegion region; wr::ComplexClipRegion region;
region.rect = wr::ToRoundedLayoutRect( region.rect = wr::ToLayoutRect(
LayoutDeviceRect::FromAppUnits(legendRect, appUnitsPerDevPixel)); LayoutDeviceRect::FromAppUnits(legendRect, appUnitsPerDevPixel));
region.mode = wr::ClipMode::ClipOut; region.mode = wr::ClipMode::ClipOut;
region.radii = wr::EmptyBorderRadius(); region.radii = wr::EmptyBorderRadius();

Просмотреть файл

@ -84,7 +84,7 @@ class TextDrawTarget : public DrawTarget {
LayoutDeviceRect layoutBoundsRect = LayoutDeviceRect layoutBoundsRect =
LayoutDeviceRect::FromAppUnits(aBounds, appUnitsPerDevPixel); LayoutDeviceRect::FromAppUnits(aBounds, appUnitsPerDevPixel);
LayoutDeviceRect layoutClipRect = layoutBoundsRect; LayoutDeviceRect layoutClipRect = layoutBoundsRect;
mBoundsRect = wr::ToRoundedLayoutRect(layoutBoundsRect); mBoundsRect = wr::ToLayoutRect(layoutBoundsRect);
// Add 1 pixel of dirty area around clip rect to allow us to paint // Add 1 pixel of dirty area around clip rect to allow us to paint
// antialiased pixels beyond the measured text extents. // antialiased pixels beyond the measured text extents.
@ -275,7 +275,7 @@ class TextDrawTarget : public DrawTarget {
} }
wr::Line decoration; wr::Line decoration;
decoration.bounds = wr::ToRoundedLayoutRect(LayoutDeviceRect(pos, size)); decoration.bounds = wr::ToLayoutRect(LayoutDeviceRect(pos, size));
decoration.wavyLineThickness = 0; // dummy value, unused decoration.wavyLineThickness = 0; // dummy value, unused
decoration.color = wr::ToColorF(aColor); decoration.color = wr::ToColorF(aColor);
decoration.orientation = aVertical ? wr::LineOrientation::Vertical decoration.orientation = aVertical ? wr::LineOrientation::Vertical
@ -310,7 +310,7 @@ class TextDrawTarget : public DrawTarget {
wr::Line decoration; wr::Line decoration;
decoration.bounds = decoration.bounds =
wr::ToRoundedLayoutRect(LayoutDeviceRect::FromUnknownRect(aBounds)); wr::ToLayoutRect(LayoutDeviceRect::FromUnknownRect(aBounds));
decoration.wavyLineThickness = aThickness; decoration.wavyLineThickness = aThickness;
decoration.color = wr::ToColorF(aColor); decoration.color = wr::ToColorF(aColor);
decoration.orientation = aVertical ? wr::LineOrientation::Vertical decoration.orientation = aVertical ? wr::LineOrientation::Vertical
@ -347,7 +347,7 @@ class TextDrawTarget : public DrawTarget {
private: private:
wr::LayoutRect ClipRect() { wr::LayoutRect ClipRect() {
return wr::ToRoundedLayoutRect(mClipStack.LastElement()); return wr::ToLayoutRect(mClipStack.LastElement());
} }
LayoutDeviceRect GeckoClipRect() { return mClipStack.LastElement(); } LayoutDeviceRect GeckoClipRect() { return mClipStack.LastElement(); }
// Whether anything unsupported was encountered. This will result in this // Whether anything unsupported was encountered. This will result in this
@ -463,8 +463,7 @@ class TextDrawTarget : public DrawTarget {
if (!aRect.Intersects(GeckoClipRect().ToUnknownRect())) { if (!aRect.Intersects(GeckoClipRect().ToUnknownRect())) {
return; return;
} }
auto rect = auto rect = wr::ToLayoutRect(LayoutDeviceRect::FromUnknownRect(aRect));
wr::ToRoundedLayoutRect(LayoutDeviceRect::FromUnknownRect(aRect));
auto color = auto color =
wr::ToColorF(static_cast<const ColorPattern&>(aPattern).mColor); wr::ToColorF(static_cast<const ColorPattern&>(aPattern).mColor);
mBuilder.PushRect(rect, ClipRect(), mBackfaceVisible, color); mBuilder.PushRect(rect, ClipRect(), mBackfaceVisible, color);
@ -491,7 +490,7 @@ class TextDrawTarget : public DrawTarget {
if (!rect.Intersects(GeckoClipRect())) { if (!rect.Intersects(GeckoClipRect())) {
return; return;
} }
wr::LayoutRect bounds = wr::ToRoundedLayoutRect(rect); wr::LayoutRect bounds = wr::ToLayoutRect(rect);
mBuilder.PushBorder(bounds, ClipRect(), true, widths, mBuilder.PushBorder(bounds, ClipRect(), true, widths,
Range<const wr::BorderSide>(sides, 4), radius); Range<const wr::BorderSide>(sides, 4), radius);
} }

Просмотреть файл

@ -446,7 +446,6 @@ ImgDrawResult BulletRenderer::CreateWebRenderCommandsForImage(
aItem->Frame()->PresContext()->AppUnitsPerDevPixel(); aItem->Frame()->PresContext()->AppUnitsPerDevPixel();
LayoutDeviceRect destRect = LayoutDeviceRect destRect =
LayoutDeviceRect::FromAppUnits(mDest, appUnitsPerDevPixel); LayoutDeviceRect::FromAppUnits(mDest, appUnitsPerDevPixel);
destRect.Round();
Maybe<SVGImageContext> svgContext; Maybe<SVGImageContext> svgContext;
gfx::IntSize decodeSize = gfx::IntSize decodeSize =
@ -485,7 +484,7 @@ bool BulletRenderer::CreateWebRenderCommandsForPath(
mozilla::layers::RenderRootStateManager* aManager, mozilla::layers::RenderRootStateManager* aManager,
nsDisplayListBuilder* aDisplayListBuilder) { nsDisplayListBuilder* aDisplayListBuilder) {
MOZ_ASSERT(IsPathType()); MOZ_ASSERT(IsPathType());
wr::LayoutRect dest = wr::ToRoundedLayoutRect(mPathRect); wr::LayoutRect dest = wr::ToLayoutRect(mPathRect);
auto color = wr::ToColorF(ToDeviceColor(mColor)); auto color = wr::ToColorF(ToDeviceColor(mColor));
bool isBackfaceVisible = !aItem->BackfaceIsHidden(); bool isBackfaceVisible = !aItem->BackfaceIsHidden();
switch (mListStyleType) { switch (mListStyleType) {

Просмотреть файл

@ -372,8 +372,8 @@ bool nsDisplayCanvasBackgroundColor::CreateWebRenderCommands(
LayoutDeviceRect rect = LayoutDeviceRect rect =
LayoutDeviceRect::FromAppUnits(bgClipRect, appUnitsPerDevPixel); LayoutDeviceRect::FromAppUnits(bgClipRect, appUnitsPerDevPixel);
wr::LayoutRect roundedRect = wr::ToRoundedLayoutRect(rect); wr::LayoutRect r = wr::ToLayoutRect(rect);
aBuilder.PushRect(roundedRect, roundedRect, !BackfaceIsHidden(), aBuilder.PushRect(r, r, !BackfaceIsHidden(),
wr::ToColorF(ToDeviceColor(mColor))); wr::ToColorF(ToDeviceColor(mColor)));
return true; return true;
} }

Просмотреть файл

@ -2309,10 +2309,9 @@ bool nsDisplaySelectionOverlay::CreateWebRenderCommands(
const StackingContextHelper& aSc, const StackingContextHelper& aSc,
mozilla::layers::RenderRootStateManager* aManager, mozilla::layers::RenderRootStateManager* aManager,
nsDisplayListBuilder* aDisplayListBuilder) { nsDisplayListBuilder* aDisplayListBuilder) {
wr::LayoutRect bounds = wr::LayoutRect bounds = wr::ToLayoutRect(LayoutDeviceRect::FromAppUnits(
wr::ToRoundedLayoutRect(LayoutDeviceRect::FromAppUnits( nsRect(ToReferenceFrame(), Frame()->GetSize()),
nsRect(ToReferenceFrame(), Frame()->GetSize()), mFrame->PresContext()->AppUnitsPerDevPixel()));
mFrame->PresContext()->AppUnitsPerDevPixel()));
aBuilder.PushRect(bounds, bounds, !BackfaceIsHidden(), aBuilder.PushRect(bounds, bounds, !BackfaceIsHidden(),
wr::ToColorF(ComputeColor())); wr::ToColorF(ComputeColor()));
return true; return true;

Просмотреть файл

@ -163,7 +163,7 @@ class nsDisplayCanvas final : public nsPaintedDisplayItem {
// parent side, where it will be done when we build the display list for // parent side, where it will be done when we build the display list for
// the iframe. That happens in WebRenderCompositableHolder. // the iframe. That happens in WebRenderCompositableHolder.
wr::LayoutRect r = wr::ToRoundedLayoutRect(bounds); wr::LayoutRect r = wr::ToLayoutRect(bounds);
aBuilder.PushIFrame(r, !BackfaceIsHidden(), data->GetPipelineId().ref(), aBuilder.PushIFrame(r, !BackfaceIsHidden(), data->GetPipelineId().ref(),
/*ignoreMissingPipelines*/ false); /*ignoreMissingPipelines*/ false);

Просмотреть файл

@ -1569,7 +1569,7 @@ ImgDrawResult nsImageFrame::DisplayAltFeedbackWithoutLayer(
// Clip to this rect so we don't render outside the inner rect // Clip to this rect so we don't render outside the inner rect
LayoutDeviceRect bounds = LayoutDeviceRect::FromAppUnits( LayoutDeviceRect bounds = LayoutDeviceRect::FromAppUnits(
inner, PresContext()->AppUnitsPerDevPixel()); inner, PresContext()->AppUnitsPerDevPixel());
auto wrBounds = wr::ToRoundedLayoutRect(bounds); auto wrBounds = wr::ToLayoutRect(bounds);
// Draw image // Draw image
ImgDrawResult result = ImgDrawResult::NOT_READY; ImgDrawResult result = ImgDrawResult::NOT_READY;
@ -1609,7 +1609,6 @@ ImgDrawResult nsImageFrame::DisplayAltFeedbackWithoutLayer(
const int32_t factor = PresContext()->AppUnitsPerDevPixel(); const int32_t factor = PresContext()->AppUnitsPerDevPixel();
LayoutDeviceRect destRect(LayoutDeviceRect::FromAppUnits(dest, factor)); LayoutDeviceRect destRect(LayoutDeviceRect::FromAppUnits(dest, factor));
destRect.Round();
Maybe<SVGImageContext> svgContext; Maybe<SVGImageContext> svgContext;
IntSize decodeSize = IntSize decodeSize =
@ -1641,7 +1640,7 @@ ImgDrawResult nsImageFrame::DisplayAltFeedbackWithoutLayer(
nsRect rect(iconXPos, inner.y, size, size); nsRect rect(iconXPos, inner.y, size, size);
auto devPxRect = LayoutDeviceRect::FromAppUnits( auto devPxRect = LayoutDeviceRect::FromAppUnits(
rect, PresContext()->AppUnitsPerDevPixel()); rect, PresContext()->AppUnitsPerDevPixel());
auto dest = wr::ToRoundedLayoutRect(devPxRect); auto dest = wr::ToLayoutRect(devPxRect);
auto borderWidths = wr::ToBorderWidths(1.0, 1.0, 1.0, 1.0); auto borderWidths = wr::ToBorderWidths(1.0, 1.0, 1.0, 1.0);
wr::BorderSide side = {color, wr::BorderStyle::Solid}; wr::BorderSide side = {color, wr::BorderStyle::Solid};
@ -1656,7 +1655,7 @@ ImgDrawResult nsImageFrame::DisplayAltFeedbackWithoutLayer(
size / 2 - twoPX); size / 2 - twoPX);
devPxRect = LayoutDeviceRect::FromAppUnits( devPxRect = LayoutDeviceRect::FromAppUnits(
rect, PresContext()->AppUnitsPerDevPixel()); rect, PresContext()->AppUnitsPerDevPixel());
dest = wr::ToRoundedLayoutRect(devPxRect); dest = wr::ToLayoutRect(devPxRect);
aBuilder.PushRoundedRect(dest, wrBounds, isBackfaceVisible, color); aBuilder.PushRoundedRect(dest, wrBounds, isBackfaceVisible, color);
} }
@ -1891,7 +1890,6 @@ bool nsDisplayImage::CreateWebRenderCommands(
const int32_t factor = mFrame->PresContext()->AppUnitsPerDevPixel(); const int32_t factor = mFrame->PresContext()->AppUnitsPerDevPixel();
LayoutDeviceRect destRect( LayoutDeviceRect destRect(
LayoutDeviceRect::FromAppUnits(GetDestRect(), factor)); LayoutDeviceRect::FromAppUnits(GetDestRect(), factor));
destRect.Round();
Maybe<SVGImageContext> svgContext; Maybe<SVGImageContext> svgContext;
IntSize decodeSize = nsLayoutUtils::ComputeImageContainerDrawingParameters( IntSize decodeSize = nsLayoutUtils::ComputeImageContainerDrawingParameters(

Просмотреть файл

@ -1505,8 +1505,8 @@ bool nsDisplayRemote::CreateWebRenderCommands(
mFrame->PresContext()->AppUnitsPerDevPixel()); mFrame->PresContext()->AppUnitsPerDevPixel());
rect += mOffset; rect += mOffset;
aBuilder.PushIFrame(mozilla::wr::ToRoundedLayoutRect(rect), aBuilder.PushIFrame(mozilla::wr::ToLayoutRect(rect), !BackfaceIsHidden(),
!BackfaceIsHidden(), mozilla::wr::AsPipelineId(mLayersId), mozilla::wr::AsPipelineId(mLayersId),
/*ignoreMissingPipelines*/ true); /*ignoreMissingPipelines*/ true);
return true; return true;

Просмотреть файл

@ -3328,7 +3328,7 @@ void nsCSSBorderRenderer::CreateWebRenderCommands(
wr::IpcResourceUpdateQueue& aResources, wr::IpcResourceUpdateQueue& aResources,
const layers::StackingContextHelper& aSc) { const layers::StackingContextHelper& aSc) {
LayoutDeviceRect outerRect = LayoutDeviceRect::FromUnknownRect(mOuterRect); LayoutDeviceRect outerRect = LayoutDeviceRect::FromUnknownRect(mOuterRect);
wr::LayoutRect roundedRect = wr::ToRoundedLayoutRect(outerRect); wr::LayoutRect roundedRect = wr::ToLayoutRect(outerRect);
wr::LayoutRect clipRect = roundedRect; wr::LayoutRect clipRect = roundedRect;
wr::BorderSide side[4]; wr::BorderSide side[4];
NS_FOR_CSS_SIDES(i) { NS_FOR_CSS_SIDES(i) {
@ -3345,7 +3345,7 @@ void nsCSSBorderRenderer::CreateWebRenderCommands(
if (mLocalClip) { if (mLocalClip) {
LayoutDeviceRect localClip = LayoutDeviceRect localClip =
LayoutDeviceRect::FromUnknownRect(mLocalClip.value()); LayoutDeviceRect::FromUnknownRect(mLocalClip.value());
clipRect = wr::ToRoundedLayoutRect(localClip.Intersect(outerRect)); clipRect = wr::ToLayoutRect(localClip.Intersect(outerRect));
} }
Range<const wr::BorderSide> wrsides(side, 4); Range<const wr::BorderSide> wrsides(side, 4);
@ -3593,7 +3593,7 @@ ImgDrawResult nsCSSBorderImageRenderer::CreateWebRenderCommands(
if (!mClip.IsEmpty()) { if (!mClip.IsEmpty()) {
LayoutDeviceRect clipRect = LayoutDeviceRect clipRect =
LayoutDeviceRect::FromAppUnits(mClip, appUnitsPerDevPixel); LayoutDeviceRect::FromAppUnits(mClip, appUnitsPerDevPixel);
clip = wr::ToRoundedLayoutRect(clipRect); clip = wr::ToLayoutRect(clipRect);
} }
ImgDrawResult drawResult = ImgDrawResult::SUCCESS; ImgDrawResult drawResult = ImgDrawResult::SUCCESS;

Просмотреть файл

@ -3866,16 +3866,16 @@ bool nsDisplaySolidColor::CreateWebRenderCommands(
LayoutDeviceRect renderRootRect = LayoutDeviceRect renderRootRect =
aDisplayListBuilder->GetRenderRootRect(renderRoot); aDisplayListBuilder->GetRenderRootRect(renderRoot);
wr::LayoutRect intersection = wr::LayoutRect intersection =
wr::ToRoundedLayoutRect(bounds.Intersect(renderRootRect)); wr::ToLayoutRect(bounds.Intersect(renderRootRect));
aBuilder.SubBuilder(renderRoot) aBuilder.SubBuilder(renderRoot)
.PushRect(intersection, intersection, !BackfaceIsHidden(), .PushRect(intersection, intersection, !BackfaceIsHidden(),
wr::ToColorF(ToDeviceColor(mColor))); wr::ToColorF(ToDeviceColor(mColor)));
} }
} }
} else { } else {
wr::LayoutRect roundedRect = wr::ToRoundedLayoutRect(bounds); wr::LayoutRect r = wr::ToLayoutRect(bounds);
aBuilder.PushRect(roundedRect, roundedRect, !BackfaceIsHidden(), aBuilder.PushRect(r, r, !BackfaceIsHidden(),
wr::ToColorF(ToDeviceColor(mColor))); wr::ToColorF(ToDeviceColor(mColor)));
} }
@ -3915,8 +3915,8 @@ bool nsDisplaySolidColorRegion::CreateWebRenderCommands(
nsRect rect = iter.Get(); nsRect rect = iter.Get();
LayoutDeviceRect layerRects = LayoutDeviceRect::FromAppUnits( LayoutDeviceRect layerRects = LayoutDeviceRect::FromAppUnits(
rect, mFrame->PresContext()->AppUnitsPerDevPixel()); rect, mFrame->PresContext()->AppUnitsPerDevPixel());
wr::LayoutRect roundedRect = wr::ToRoundedLayoutRect(layerRects); wr::LayoutRect r = wr::ToLayoutRect(layerRects);
aBuilder.PushRect(roundedRect, roundedRect, !BackfaceIsHidden(), aBuilder.PushRect(r, r, !BackfaceIsHidden(),
wr::ToColorF(ToDeviceColor(mColor))); wr::ToColorF(ToDeviceColor(mColor)));
} }
@ -5181,9 +5181,9 @@ bool nsDisplayBackgroundColor::CreateWebRenderCommands(
LayoutDeviceRect bounds = LayoutDeviceRect::FromAppUnits( LayoutDeviceRect bounds = LayoutDeviceRect::FromAppUnits(
mBackgroundRect, mFrame->PresContext()->AppUnitsPerDevPixel()); mBackgroundRect, mFrame->PresContext()->AppUnitsPerDevPixel());
wr::LayoutRect roundedRect = wr::ToRoundedLayoutRect(bounds); wr::LayoutRect r = wr::ToLayoutRect(bounds);
aBuilder.PushRect(roundedRect, roundedRect, !BackfaceIsHidden(), aBuilder.PushRect(r, r, !BackfaceIsHidden(),
wr::ToColorF(ToDeviceColor(mColor))); wr::ToColorF(ToDeviceColor(mColor)));
return true; return true;
@ -5366,7 +5366,7 @@ bool nsDisplayClearBackground::CreateWebRenderCommands(
nsRect(ToReferenceFrame(), mFrame->GetSize()), nsRect(ToReferenceFrame(), mFrame->GetSize()),
mFrame->PresContext()->AppUnitsPerDevPixel()); mFrame->PresContext()->AppUnitsPerDevPixel());
aBuilder.PushClearRect(wr::ToRoundedLayoutRect(bounds)); aBuilder.PushClearRect(wr::ToLayoutRect(bounds));
return true; return true;
} }
@ -5539,7 +5539,7 @@ bool nsDisplayCompositorHitTestInfo::CreateWebRenderCommands(
const LayoutDeviceRect devRect = const LayoutDeviceRect devRect =
LayoutDeviceRect::FromAppUnits(HitTestArea(), mAppUnitsPerDevPixel); LayoutDeviceRect::FromAppUnits(HitTestArea(), mAppUnitsPerDevPixel);
const wr::LayoutRect rect = wr::ToRoundedLayoutRect(devRect); const wr::LayoutRect rect = wr::ToLayoutRect(devRect);
aBuilder.PushHitTest(rect, rect, !BackfaceIsHidden()); aBuilder.PushHitTest(rect, rect, !BackfaceIsHidden());
aBuilder.ClearHitTestInfo(); aBuilder.ClearHitTestInfo();
@ -5611,8 +5611,8 @@ bool nsDisplayCaret::CreateWebRenderCommands(
LayoutDeviceRect devHookRect = LayoutDeviceRect::FromAppUnits( LayoutDeviceRect devHookRect = LayoutDeviceRect::FromAppUnits(
hookRect + ToReferenceFrame(), appUnitsPerDevPixel); hookRect + ToReferenceFrame(), appUnitsPerDevPixel);
wr::LayoutRect caret = wr::ToRoundedLayoutRect(devCaretRect); wr::LayoutRect caret = wr::ToLayoutRect(devCaretRect);
wr::LayoutRect hook = wr::ToRoundedLayoutRect(devHookRect); wr::LayoutRect hook = wr::ToLayoutRect(devHookRect);
// Note, WR will pixel snap anything that is layout aligned. // Note, WR will pixel snap anything that is layout aligned.
aBuilder.PushRect(caret, caret, !BackfaceIsHidden(), wr::ToColorF(color)); aBuilder.PushRect(caret, caret, !BackfaceIsHidden(), wr::ToColorF(color));
@ -5886,8 +5886,8 @@ bool nsDisplayBoxShadowOuter::CreateWebRenderCommands(
LayoutDeviceRect deviceBox = LayoutDeviceRect deviceBox =
LayoutDeviceRect::FromAppUnits(shadowRect, appUnitsPerDevPixel); LayoutDeviceRect::FromAppUnits(shadowRect, appUnitsPerDevPixel);
wr::LayoutRect deviceBoxRect = wr::ToRoundedLayoutRect(deviceBox); wr::LayoutRect deviceBoxRect = wr::ToLayoutRect(deviceBox);
wr::LayoutRect deviceClipRect = wr::ToRoundedLayoutRect(clipRect); wr::LayoutRect deviceClipRect = wr::ToLayoutRect(clipRect);
LayoutDeviceSize zeroSize; LayoutDeviceSize zeroSize;
wr::BorderRadius borderRadius = wr::BorderRadius borderRadius =
@ -6015,7 +6015,7 @@ void nsDisplayBoxShadowInner::CreateInsetBoxShadowWebRenderCommands(
// Now translate everything to device pixels. // Now translate everything to device pixels.
LayoutDeviceRect deviceBoxRect = LayoutDeviceRect deviceBoxRect =
LayoutDeviceRect::FromAppUnits(shadowRect, appUnitsPerDevPixel); LayoutDeviceRect::FromAppUnits(shadowRect, appUnitsPerDevPixel);
wr::LayoutRect deviceClipRect = wr::ToRoundedLayoutRect(clipRect); wr::LayoutRect deviceClipRect = wr::ToLayoutRect(clipRect);
Color shadowColor = Color shadowColor =
nsCSSRendering::GetShadowColor(shadow.base, aFrame, 1.0); nsCSSRendering::GetShadowColor(shadow.base, aFrame, 1.0);
@ -7736,7 +7736,7 @@ bool nsDisplayStickyPosition::CreateWebRenderCommands(
NSAppUnitsToFloatPixels(appliedOffset.x, auPerDevPixel), NSAppUnitsToFloatPixels(appliedOffset.x, auPerDevPixel),
NSAppUnitsToFloatPixels(appliedOffset.y, auPerDevPixel)}; NSAppUnitsToFloatPixels(appliedOffset.y, auPerDevPixel)};
wr::WrSpatialId spatialId = aBuilder.DefineStickyFrame( wr::WrSpatialId spatialId = aBuilder.DefineStickyFrame(
wr::ToRoundedLayoutRect(bounds), topMargin.ptrOr(nullptr), wr::ToLayoutRect(bounds), topMargin.ptrOr(nullptr),
rightMargin.ptrOr(nullptr), bottomMargin.ptrOr(nullptr), rightMargin.ptrOr(nullptr), bottomMargin.ptrOr(nullptr),
leftMargin.ptrOr(nullptr), vBounds, hBounds, applied); leftMargin.ptrOr(nullptr), vBounds, hBounds, applied);
@ -10031,7 +10031,7 @@ static Maybe<wr::WrClipId> CreateSimpleClipRegion(
wr::ToComplexClipRegion(insetRect, radii, appUnitsPerDevPixel)); wr::ToComplexClipRegion(insetRect, radii, appUnitsPerDevPixel));
} }
rect = wr::ToRoundedLayoutRect( rect = wr::ToLayoutRect(
LayoutDeviceRect::FromAppUnits(insetRect, appUnitsPerDevPixel)); LayoutDeviceRect::FromAppUnits(insetRect, appUnitsPerDevPixel));
break; break;
} }
@ -10060,7 +10060,7 @@ static Maybe<wr::WrClipId> CreateSimpleClipRegion(
clipRegions.AppendElement(wr::ToComplexClipRegion( clipRegions.AppendElement(wr::ToComplexClipRegion(
ellipseRect, ellipseRadii, appUnitsPerDevPixel)); ellipseRect, ellipseRadii, appUnitsPerDevPixel));
rect = wr::ToRoundedLayoutRect( rect = wr::ToLayoutRect(
LayoutDeviceRect::FromAppUnits(ellipseRect, appUnitsPerDevPixel)); LayoutDeviceRect::FromAppUnits(ellipseRect, appUnitsPerDevPixel));
break; break;
} }
@ -10099,7 +10099,7 @@ static Maybe<Pair<wr::WrClipId, HandleOpacity>> CreateWRClipPathAndMasks(
} }
wr::WrClipId clipId = aBuilder.DefineClip( wr::WrClipId clipId = aBuilder.DefineClip(
Nothing(), wr::ToRoundedLayoutRect(aBounds), nullptr, mask.ptr()); Nothing(), wr::ToLayoutRect(aBounds), nullptr, mask.ptr());
return Some(MakePair(clipId, HandleOpacity::No)); return Some(MakePair(clipId, HandleOpacity::No));
} }
@ -10512,7 +10512,7 @@ bool nsDisplayFilters::CreateWebRenderCommands(
auto devPxRect = LayoutDeviceRect::FromAppUnits( auto devPxRect = LayoutDeviceRect::FromAppUnits(
filterClip.value() + ToReferenceFrame(), auPerDevPixel); filterClip.value() + ToReferenceFrame(), auPerDevPixel);
wr::WrClipId clipId = wr::WrClipId clipId =
aBuilder.DefineClip(Nothing(), wr::ToRoundedLayoutRect(devPxRect)); aBuilder.DefineClip(Nothing(), wr::ToLayoutRect(devPxRect));
clip = wr::WrStackingContextClip::ClipId(clipId); clip = wr::WrStackingContextClip::ClipId(clipId);
} else { } else {
clip = wr::WrStackingContextClip::ClipChain(aBuilder.CurrentClipChainId()); clip = wr::WrStackingContextClip::ClipChain(aBuilder.CurrentClipChainId());

Просмотреть файл

@ -603,7 +603,6 @@ ImgDrawResult nsImageRenderer::BuildWebRenderDisplayItems(
LayoutDeviceRect destRect = LayoutDeviceRect destRect =
LayoutDeviceRect::FromAppUnits(aDest, appUnitsPerDevPixel); LayoutDeviceRect::FromAppUnits(aDest, appUnitsPerDevPixel);
auto stretchSize = wr::ToLayoutSize(destRect.Size()); auto stretchSize = wr::ToLayoutSize(destRect.Size());
destRect.Round();
gfx::IntSize decodeSize = gfx::IntSize decodeSize =
nsLayoutUtils::ComputeImageContainerDrawingParameters( nsLayoutUtils::ComputeImageContainerDrawingParameters(
@ -630,15 +629,15 @@ ImgDrawResult nsImageRenderer::BuildWebRenderDisplayItems(
break; break;
} }
wr::LayoutRect roundedDest = wr::ToLayoutRect(destRect); wr::LayoutRect dest = wr::ToLayoutRect(destRect);
wr::LayoutRect clip = wr::ToRoundedLayoutRect( wr::LayoutRect clip = wr::ToLayoutRect(
LayoutDeviceRect::FromAppUnits(aFill, appUnitsPerDevPixel)); LayoutDeviceRect::FromAppUnits(aFill, appUnitsPerDevPixel));
if (mExtendMode == ExtendMode::CLAMP) { if (mExtendMode == ExtendMode::CLAMP) {
// The image is not repeating. Just push as a regular image. // The image is not repeating. Just push as a regular image.
aBuilder.PushImage(roundedDest, clip, !aItem->BackfaceIsHidden(), aBuilder.PushImage(dest, clip, !aItem->BackfaceIsHidden(), rendering,
rendering, key.value()); key.value());
} else { } else {
nsPoint firstTilePos = nsLayoutUtils::GetBackgroundFirstTilePos( nsPoint firstTilePos = nsLayoutUtils::GetBackgroundFirstTilePos(
aDest.TopLeft(), aFill.TopLeft(), aRepeatSize); aDest.TopLeft(), aFill.TopLeft(), aRepeatSize);
@ -647,18 +646,18 @@ ImgDrawResult nsImageRenderer::BuildWebRenderDisplayItems(
aFill.XMost() - firstTilePos.x, aFill.XMost() - firstTilePos.x,
aFill.YMost() - firstTilePos.y), aFill.YMost() - firstTilePos.y),
appUnitsPerDevPixel); appUnitsPerDevPixel);
wr::LayoutRect fill = wr::ToRoundedLayoutRect(fillRect); wr::LayoutRect fill = wr::ToLayoutRect(fillRect);
switch (mExtendMode) { switch (mExtendMode) {
case ExtendMode::REPEAT_Y: case ExtendMode::REPEAT_Y:
fill.origin.x = roundedDest.origin.x; fill.origin.x = dest.origin.x;
fill.size.width = roundedDest.size.width; fill.size.width = dest.size.width;
stretchSize.width = roundedDest.size.width; stretchSize.width = dest.size.width;
break; break;
case ExtendMode::REPEAT_X: case ExtendMode::REPEAT_X:
fill.origin.y = roundedDest.origin.y; fill.origin.y = dest.origin.y;
fill.size.height = roundedDest.size.height; fill.size.height = dest.size.height;
stretchSize.height = roundedDest.size.height; stretchSize.height = dest.size.height;
break; break;
default: default:
break; break;

Просмотреть файл

@ -6925,20 +6925,19 @@ static void CreateWRCommandsForBeveledBorder(
for (const auto& segment : segments) { for (const auto& segment : segments) {
auto rect = LayoutDeviceRect::FromUnknownRect(NSRectToRect( auto rect = LayoutDeviceRect::FromUnknownRect(NSRectToRect(
segment.mRect + aOffset, aBorderParams.mAppUnitsPerDevPixel)); segment.mRect + aOffset, aBorderParams.mAppUnitsPerDevPixel));
auto roundedRect = wr::ToRoundedLayoutRect(rect); auto r = wr::ToLayoutRect(rect);
auto color = wr::ToColorF(ToDeviceColor(segment.mColor)); auto color = wr::ToColorF(ToDeviceColor(segment.mColor));
// Adjust for the start bevel if needed. // Adjust for the start bevel if needed.
AdjustAndPushBevel(aBuilder, roundedRect, segment.mColor, AdjustAndPushBevel(aBuilder, r, segment.mColor, segment.mStartBevel,
segment.mStartBevel, aBorderParams.mAppUnitsPerDevPixel, aBorderParams.mAppUnitsPerDevPixel,
aBorderParams.mBackfaceIsVisible, true); aBorderParams.mBackfaceIsVisible, true);
AdjustAndPushBevel(aBuilder, roundedRect, segment.mColor, segment.mEndBevel, AdjustAndPushBevel(aBuilder, r, segment.mColor, segment.mEndBevel,
aBorderParams.mAppUnitsPerDevPixel, aBorderParams.mAppUnitsPerDevPixel,
aBorderParams.mBackfaceIsVisible, false); aBorderParams.mBackfaceIsVisible, false);
aBuilder.PushRect(roundedRect, roundedRect, aBuilder.PushRect(r, r, aBorderParams.mBackfaceIsVisible, color);
aBorderParams.mBackfaceIsVisible, color);
} }
} }
@ -6953,7 +6952,7 @@ static void CreateWRCommandsForBorderSegment(
auto borderRect = LayoutDeviceRect::FromUnknownRect(NSRectToRect( auto borderRect = LayoutDeviceRect::FromUnknownRect(NSRectToRect(
aBorderParams.mBorderRect + aOffset, aBorderParams.mAppUnitsPerDevPixel)); aBorderParams.mBorderRect + aOffset, aBorderParams.mAppUnitsPerDevPixel));
wr::LayoutRect roundedRect = wr::ToRoundedLayoutRect(borderRect); wr::LayoutRect r = wr::ToLayoutRect(borderRect);
wr::BorderSide wrSide[4]; wr::BorderSide wrSide[4];
NS_FOR_CSS_SIDES(i) { NS_FOR_CSS_SIDES(i) {
wrSide[i] = wr::ToBorderSide(ToDeviceColor(aBorderParams.mBorderColor), wrSide[i] = wr::ToBorderSide(ToDeviceColor(aBorderParams.mBorderColor),
@ -6961,8 +6960,7 @@ static void CreateWRCommandsForBorderSegment(
} }
const bool horizontal = aBorderParams.mStartBevelSide == eSideTop || const bool horizontal = aBorderParams.mStartBevelSide == eSideTop ||
aBorderParams.mStartBevelSide == eSideBottom; aBorderParams.mStartBevelSide == eSideBottom;
auto borderWidth = auto borderWidth = horizontal ? r.size.height : r.size.width;
horizontal ? roundedRect.size.height : roundedRect.size.width;
// All border style is set to none except left side. So setting the widths of // All border style is set to none except left side. So setting the widths of
// each side to width of rect is fine. // each side to width of rect is fine.
@ -6978,9 +6976,8 @@ static void CreateWRCommandsForBorderSegment(
} }
Range<const wr::BorderSide> wrsides(wrSide, 4); Range<const wr::BorderSide> wrsides(wrSide, 4);
aBuilder.PushBorder(roundedRect, roundedRect, aBuilder.PushBorder(r, r, aBorderParams.mBackfaceIsVisible, borderWidths,
aBorderParams.mBackfaceIsVisible, borderWidths, wrsides, wrsides, wr::EmptyBorderRadius());
wr::EmptyBorderRadius());
} }
void BCBlockDirSeg::CreateWebRenderCommands( void BCBlockDirSeg::CreateWebRenderCommands(

Просмотреть файл

@ -418,7 +418,6 @@ ImgDrawResult nsImageBoxFrame::CreateWebRenderCommands(
const int32_t appUnitsPerDevPixel = PresContext()->AppUnitsPerDevPixel(); const int32_t appUnitsPerDevPixel = PresContext()->AppUnitsPerDevPixel();
LayoutDeviceRect fillRect = LayoutDeviceRect fillRect =
LayoutDeviceRect::FromAppUnits(dest, appUnitsPerDevPixel); LayoutDeviceRect::FromAppUnits(dest, appUnitsPerDevPixel);
fillRect.Round();
Maybe<SVGImageContext> svgContext; Maybe<SVGImageContext> svgContext;
gfx::IntSize decodeSize = gfx::IntSize decodeSize =

Просмотреть файл

@ -3436,8 +3436,8 @@ bool nsNativeThemeCocoa::CreateWebRenderCommandsForWidget(
mozilla::layers::RenderRootStateManager* aManager, nsIFrame* aFrame, mozilla::layers::RenderRootStateManager* aManager, nsIFrame* aFrame,
StyleAppearance aAppearance, const nsRect& aRect) { StyleAppearance aAppearance, const nsRect& aRect) {
nsPresContext* presContext = aFrame->PresContext(); nsPresContext* presContext = aFrame->PresContext();
wr::LayoutRect bounds = wr::ToRoundedLayoutRect( wr::LayoutRect bounds =
LayoutDeviceRect::FromAppUnits(aRect, presContext->AppUnitsPerDevPixel())); wr::ToLayoutRect(LayoutDeviceRect::FromAppUnits(aRect, presContext->AppUnitsPerDevPixel()));
EventStates eventState = GetContentState(aFrame, aAppearance); EventStates eventState = GetContentState(aFrame, aAppearance);

Просмотреть файл

@ -1243,9 +1243,8 @@ bool nsNativeThemeGTK::CreateWebRenderCommandsForWidget(
mozilla::layers::RenderRootStateManager* aManager, nsIFrame* aFrame, mozilla::layers::RenderRootStateManager* aManager, nsIFrame* aFrame,
StyleAppearance aAppearance, const nsRect& aRect) { StyleAppearance aAppearance, const nsRect& aRect) {
nsPresContext* presContext = aFrame->PresContext(); nsPresContext* presContext = aFrame->PresContext();
wr::LayoutRect bounds = wr::LayoutRect bounds = wr::ToLayoutRect(LayoutDeviceRect::FromAppUnits(
wr::ToRoundedLayoutRect(LayoutDeviceRect::FromAppUnits( aRect, presContext->AppUnitsPerDevPixel()));
aRect, presContext->AppUnitsPerDevPixel()));
switch (aAppearance) { switch (aAppearance) {
case StyleAppearance::Window: case StyleAppearance::Window: