Page MenuHomePhabricator

Bug 1610738 - Add primitive flag to specify a compositor surface is preferred
ClosedPublic

Authored by gw on Jan 22 2020, 7:02 AM.

Details

Summary

This allows calling code to specify whether a primitive would prefer
to be promoted to a compositor surface and/or picture cache slice.

This is a performance hint that can be used for large external
primitives, such as videos and canvas elements.

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

gw created this revision.Jan 22 2020, 7:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 22 2020, 7:02 AM
phab-bot requested review of this revision.Jan 22 2020, 7:02 AM
phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: Restricted Project.

Previously, this flag was specified as part of the ImageDescriptor when adding an (external) image.

However, this is not ideal as the scene building thread doesn't have access to the resource cache
to query the image descriptor flags.

With this patch, the caller would supply the performance hint as part of api.add_image() or
api.add_yuv_image instead of during the resource update.

Is it easy enough in Gecko to route this information via the add primitive APIs, instead of in the resource update?

gw added a comment.Jan 22 2020, 7:05 AM

(If this API does work OK for Gecko, in a follow up patch we can remove the prefer_compositor_surface bool in the image descriptor, and associated Gecko code, as we switch Gecko to use the modified API).

sotaro accepted this revision.Jan 22 2020, 8:03 AM
This revision is now accepted and ready to land.Jan 22 2020, 8:03 AM