Closed Bug 1351242 Opened 3 years ago Closed 3 years ago

Add wr support for nsDisplayBackgroundImage image type

Categories

(Core :: Graphics: WebRender, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: ethlin, Assigned: ethlin)

References

Details

Attachments

(1 file)

Bug 1341101 handle the gradient type for nsDisplayBackgroundImage. This bug is for image type.
WR doesn't support sub-image, so the display will be wrong if the background-position is not zero. I think we should push sub-image to WR for this case. I will create another bug for it.
Attachment #8855180 - Flags: review?(mchang)
Comment on attachment 8855180 [details] [diff] [review]
add wr for background image type

Review of attachment 8855180 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/painting/nsImageRenderer.cpp
@@ +616,5 @@
> +    case eStyleImageType_Image:
> +    {
> +      RefPtr<layers::ImageContainer> container = mImageContainer->GetImageContainer(aLayer->WrManager(),
> +                                                                                    ConvertImageRendererToDrawFlags(mFlags));
> +      if (!container) {

probably for now, we can add debug warnings that the container or external image container don't work.
Attachment #8855180 - Flags: review?(mchang) → review+
(In reply to Mason Chang [:mchang] from comment #2)
> Comment on attachment 8855180 [details] [diff] [review]
> add wr for background image type
> 
> Review of attachment 8855180 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: layout/painting/nsImageRenderer.cpp
> @@ +616,5 @@
> > +    case eStyleImageType_Image:
> > +    {
> > +      RefPtr<layers::ImageContainer> container = mImageContainer->GetImageContainer(aLayer->WrManager(),
> > +                                                                                    ConvertImageRendererToDrawFlags(mFlags));
> > +      if (!container) {
> 
> probably for now, we can add debug warnings that the container or external
> image container don't work.

Okay, I will add NS_WARNING here.
Pushed by ethlin@mozilla.com:
https://hg.mozilla.org/projects/graphics/rev/cff3cf898836
Add webrender support for nsDisplayBackgroundImage image type. r=mchang
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
This is great and seems to be the most impactful display item type for WR. From what I'm seeing, we often hit the this path [1] then this fast path [2]. Any idea what work needs to be done here to turn this on by default? Thanks!

[1] http://searchfox.org/mozilla-central/source/layout/painting/nsImageRenderer.cpp#515
[2] http://searchfox.org/mozilla-central/source/layout/base/nsLayoutUtils.cpp#6809
Flags: needinfo?(ethlin)
So far as I know, the background-position support should be necessary and I'll work on this. I suppose there will be some clipping/masking problems. We can have more discussions in bug 1359242.
Flags: needinfo?(ethlin)
Blocks: 1359320
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.