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
This commit is contained in:
@@ -381,7 +381,7 @@ void AsyncImagePipelineManager::ApplyAsyncImageForPipeline(
|
||||
params.mix_blend_mode = aPipeline->mMixBlendMode;
|
||||
|
||||
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.
|
||||
wr::RasterSpace::Screen());
|
||||
|
||||
@@ -402,14 +402,13 @@ void AsyncImagePipelineManager::ApplyAsyncImageForPipeline(
|
||||
MOZ_ASSERT(aPipeline->mCurrentTexture->AsWebRenderTextureHost());
|
||||
Range<wr::ImageKey> range_keys(&keys[0], keys.Length());
|
||||
aPipeline->mCurrentTexture->PushDisplayItems(
|
||||
builder, wr::ToRoundedLayoutRect(rect), wr::ToRoundedLayoutRect(rect),
|
||||
builder, wr::ToLayoutRect(rect), wr::ToLayoutRect(rect),
|
||||
aPipeline->mFilter, range_keys);
|
||||
HoldExternalImage(aPipelineId, aEpoch, aPipeline->mCurrentTexture);
|
||||
} else {
|
||||
MOZ_ASSERT(keys.Length() == 1);
|
||||
builder.PushImage(wr::ToRoundedLayoutRect(rect),
|
||||
wr::ToRoundedLayoutRect(rect), true, aPipeline->mFilter,
|
||||
keys[0]);
|
||||
builder.PushImage(wr::ToLayoutRect(rect), wr::ToLayoutRect(rect), true,
|
||||
aPipeline->mFilter, keys[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user