Closed Bug 1315621 Opened 8 years ago Closed 7 years ago

Support external image buffer in Webrender API

Categories

(Core :: Graphics: WebRender, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
firefox52 --- affected

People

(Reporter: jerry, Assigned: jerry)

References

Details

https://github.com/servo/webrender/issues/524

There are some copies in the path from add_image() interface to the final gpu texture uploading in WR texture_cache module.
If we use the original add_image() path for video playback, there will be a big performance impact for frame's copy-op.

So, I will try to export 2 new interface
register_get_external_image_callback() and
register_release_external_image_callback()
in WR.

Then, we could get/release the external image buffer directly using these two callbacks registered from gecko. There will be no additional copy for the buffer passing.


The function prototype will like:
--
typedef WRExternalImage (*GetExternalImageCallback)(WRExternalImageKey);
typedef void (*ReleaseExternalImageCallback)(WRExternalImageKey);

void register_get_external_image_callback(GetExternalImageCallback)
void register_release_external_image_callback(ReleaseExternalImageCallback)

struct WRExternalImageKey {
  uint32_t a;
  uint32_t b;
};

struct WRExternalImage {
  ImageType type; // external texture or shmem/mem buffer

  // external buffer handle
  int32_t handle;

  // shmem or memory buffer
  uint8_t* buff;
  size_t size;
};
Status: NEW → ASSIGNED
Blocks: 1312316
No longer blocks: 1312316
Blocks: 1317935
No longer blocks: 1317935
See Also: → 1317935
https://github.com/servo/webrender/pull/554
https://github.com/servo/webrender/pull/776

Are merged in WR. WR is able to use external image now.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.