Open Bug 1630428 Opened 4 years ago Updated 3 months ago

Tons of boilerplate for updating WR resources

Categories

(Core :: Graphics: WebRender, defect, P3)

defect

Tracking

()

People

(Reporter: kvark, Unassigned)

References

(Blocks 1 open bug)

Details

Was just adding a new method to request an external image update from the content side, and I'm looking at many different source files essentially expressing the same logic:

  • IpcResourceUpdateQueue::UpdatePrivateExternalImage (h + cpp)
  • WebRenderMessages.ipdlh
  • WebRenderBridgeParent::UpdateResources switch case
  • WebRenderBridgeParent::UpdatePrivateExternalImage (h + cpp signature)

Then it goes into WR land with a more generic update_external_image function. It's not nearly as bad, since in Rust at least you don't have to repeat the signature (h/cpp separation). But there is some (necessary?) repetition still:

  • TransactionBuilder::UpdateExternalImageWithDirtyRect (h + cpp)
  • wr_resource_updates_update_external_image_with_dirty_rect (bindings.rs)
  • Transaction::update_image
  • enum ResourceUpdate::UpdateImage variant

Did anything jump as you as a good thing to get rid of/fix?

Flags: needinfo?(dmalyshau)
Severity: -- → normal

Nothing jumped at me as an easy target to address.

Flags: needinfo?(dmalyshau)
Severity: normal → S3
Blocks: wr-todos
No longer blocks: gfx-complexity
You need to log in before you can comment on or make changes to this bug.