Electrolysis/Meetings/2009-08-26-macplugins

From MozillaWiki
Jump to: navigation, search

Multi-process plugins on mac: architecture questions

  • support CoreGraphics
    • invisible carbon window of the appropriate size
    • bitmap context in shared memory
    • CGBitmapContext
    • Plugin may only draw while it's processing an update event.
  • hope to have something similar for quickdraw (quicktime)
  • but it's not working correctly

Chrome supports asynchronous drawing model for plugins:

  • drawing is synchronous from the plugin POV
  • but asynchronous from the renderer point of view (saved backing store)

Patching over carbon APIs:

  • detect when native windows are opened/active/closed/modal window management

Testing:

  • currently Chromium has some tests against real plugins (Flash)
  • but no tests with custom-purpose test plugins which exercize these features

Future:

  • new CoreAnimation drawing model
    • plugin creates CALayer
    • host has CARenderer
    • uses SPI (system private interface)

In 10.6:

shared IOSurface (GL context) which can be attached to a CARenderer

In leopard (and earlier):

  • CGSxxxSurface APIs let you share an opengl drawable across process
  • But it's a hidden API
  • And there are locking/fragility issues

But since we have IOSurface on 10.6 and <=10.5 aren't actually going to change, it may be safe to use these APIs only when IOSurface is not available.