Closed Bug 1343979 Opened 3 years ago Closed 3 years ago

Add webrender support for ButtonBorderBackground

Categories

(Core :: Graphics: WebRender, enhancement)

51 Branch
enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla55

People

(Reporter: mchang, Assigned: mchang)

References

Details

Attachments

(1 file)

No description provided.
Is there a test that fails, or do we need to create one?
(In reply to Milan Sreckovic [:milan] from comment #1)
> Is there a test that fails, or do we need to create one?

I think there are already reftests, it's just support to start rendering more things in WR from bug 1342343.
Summary: Enable webrender support for ButtonBorderBackground → Add webrender support for ButtonBorderBackground
Essentially breaks down nsDisplayButtonBorder into an inset box shadow + paint of a border [1]. Since lots of code for borders was done in the WebRenderBorderLayer::renderLayer / nsDisplayBoxShadowInner::CreateWebRenderCommands, I had to extract those methods out into public methods so nsDisplayButtonBorder could call into those methods. I still need to deal with the paint flags which I'll do in a follow up. 

[1] http://searchfox.org/mozilla-central/source/layout/forms/nsButtonFrameRenderer.cpp#324
Attachment #8843446 - Flags: review?(ethlin)
Depending on the outcome of https://bugzilla.mozilla.org/show_bug.cgi?id=1343450#c5, I can delete WebRenderBorderLayer in a follow up patch.
Comment on attachment 8843446 [details] [diff] [review]
Add support for nsDisplayButtonBorder

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

::: gfx/layers/wr/WebRenderBorderLayer.cpp
@@ +82,4 @@
>  
>    Rect overflow(0, 0, relBounds.width, relBounds.height);
>  
> +  if (gfxPrefs::LayersDump() && aLayer->IsBorderLayer()) {

It's a little bit weird to just dump data for border layer, especially after deleting WebRenderBorderLayer. Maybe we can just remove this code or pass the display item name for dumping.
Attachment #8843446 - Flags: review?(ethlin) → review+
Blocks: 1344622
(In reply to Ethan Lin[:ethlin] from comment #5)
> Comment on attachment 8843446 [details] [diff] [review]
> Add support for nsDisplayButtonBorder
> 
> Review of attachment 8843446 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: gfx/layers/wr/WebRenderBorderLayer.cpp
> @@ +82,4 @@
> >  
> >    Rect overflow(0, 0, relBounds.width, relBounds.height);
> >  
> > +  if (gfxPrefs::LayersDump() && aLayer->IsBorderLayer()) {
> 
> It's a little bit weird to just dump data for border layer, especially after
> deleting WebRenderBorderLayer. Maybe we can just remove this code or pass
> the display item name for dumping.

I'm going to fix this in general in a follow up bug.
Pushed by mchang@mozilla.com:
https://hg.mozilla.org/projects/graphics/rev/683fbabdfd8f
Add webrender support for ButtonBorderBackground. r=ethlin
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.