Plugins/Async Drawing: Difference between revisions

(adding telemetry links)
 
(18 intermediate revisions by 2 users not shown)
Line 7: Line 7:
= Current WMODE Handling =
= Current WMODE Handling =


Flash wmode definitions for Windows and Linux:
== Linux ==


{| class="wikitable" style="width:300px"
{| class="wikitable" style="width:300px"
Line 24: Line 24:
|}
|}


On OSX, Flash always uses a hybrid windowless mode.
== OSX ==
Flash always uses a hybrid windowless mode.


Post Adobe Flash version 24, Flash internally switches to wmode opaque for windowed mode and makes use of a new [https://wiki.mozilla.org/NPAPI:AsyncDrawing async rendering API] developed by Mozilla and Adobe.
== Windows ==


{| class="wikitable" style="width:50%"
Windows supports three modes, none of which involve window-backed surfaces:
* '''direct''': Post Adobe Flash version 24, Flash offers a new [https://wiki.mozilla.org/NPAPI:AsyncDrawing async rendering API] developed by Mozilla and Adobe.  This mode handles that behavior.  If <code>dom.ipc.plugins.allow_dxgi_surface=true</code> (the default) and the DirectX device supports it then hardware accelerated surfaces are used.  Otherwise, this mode uses in-memory (unaccelerated) surfaces.
* '''opaque''': This mode always uses unaccelerated surfaces.  It is intended for plugins that opaquely cover any HTML elements.
* '''transparent''': This mode always uses unaccelerated surfaces.  It is intended to blend with HTML elements.  For that reason, this mode is slower than opaque mode.
 
Some wmode values are rewritten by Firefox to promote certain modes to more performant and stable modes.
 
When <code>dom.ipc.plugins.forcedirect.enabled=true</code> (the default) [1] and <code>dom.ipc.plugins.asyncdrawing.enabled=true</code> (also the default) we use:
 
{| class="wikitable" style="width:75%"
|-
|-
! Platform !! WMODE !! Mode (Accelerated) !! Mode (Non-accelerated)
! Requested WMODE !! Resulting WMODE !! Rendering Mode (GPU supports acceleration) !! Rendering Mode (GPU does not support acceleration)
|-
|-
| Windows || unspecified || async (bitmap) || async (bitmap)
| window || direct || async (GPU accelerated) || async (in-memory bitmap) [2]
|-
|-
| Windows || window || async (bitmap) || async (bitmap)
| gpu || direct || async (GPU accelerated) || async (in-memory bitmap) [3]
|-
|-
| Windows || direct || async (accelerated) || window [1]
| unspecified || direct || async (GPU accelerated) || async (in-memory bitmap) [2]
|-
|-
| Windows || opaque || async (bitmap) || async (bitmap)
| opaque || opaque || not async (in-memory bitmap) || not async (in-memory bitmap)
|-
|-
| Windows || transparent || windowless (bitmap) || windowless (bitmap)
| transparent || transparent || not async (in-memory bitmap) || not async (in-memory bitmap)
|-
| Linux || na || na || na
|}
|}


In addition to these changes in Flash, some wmode values are rewritten by Firefox to redirect certain modes to more performant and stable modes. Specifically:
When <code>dom.ipc.plugins.asyncdrawing.enabled=false</code> we use [4]:


{| class="wikitable" style="width:50%"
{| class="wikitable" style="width:50%"
|-
|-
! Platform !! WMODE !! Mode (Accelerated) !! Mode (Non-accelerated)
! Requested WMODE !! Resulting WMODE !! Rendering Mode
|-
| window || opaque || not async (in-memory bitmap)
|-
| gpu || opaque || not async (in-memory bitmap)
|-
|-
| Windows || unspecified || direct || no change (opaque) [2]
| unspecified || opaque || not async (in-memory bitmap)
|-
|-
| Windows || window || direct || no change (opaque) [2]
| opaque || opaque || not async (in-memory bitmap)
|-
|-
| Linux || all modes || windowless || windowless
| transparent || transparent || not async (in-memory bitmap)
|}
|}


[1] To be deprecated<br/>
[1] {{bug|1620461}}<br/>
[2] {{bug|1340276}}, {{bug|1359450}}
[2] {{bug|1340276}}, {{bug|1359450}}<br/>
[3] {{bug|1565980}}<br/>
[4] {{bug|1620466}}


= Telemetry Links =
= Telemetry Links =


[https://telemetry.mozilla.org/new-pipeline/evo.html#!aggregates=bucket-0!bucket-1!bucket-2!bucket-3!bucket-4!bucket-5!bucket-6!bucket-7!bucket-8!bucket-9&arch=x86-64&cumulative=0&end_date=2017-04-22&keys=!__none__!__none__&max_channel_version=nightly%252F55&measure=PLUGIN_DRAWING_MODEL&min_channel_version=nightly%252F53&os=Windows_NT&processType=*&product=Firefox&sanitize=1&sort_keys=submissions&start_date=2017-03-08&trim=1&use_submission_date=0 PLUGIN_DRAWING_MODEL Nightly Evolution]
 
{| class="wikitable" style="width:50%"
|-
! Telemetry Value !! Platform !! Type
|-
| 0 || Windows, Linux || child window
|-
| 1 || OSX || NPDrawingModelQuickDraw
|-
| 2 || OSX || NPDrawingModelCoreGraphics
|-
| 3 || OSX || NPDrawingModelOpenGL
|-
| 4 || OSX || NPDrawingModelCoreAnimation
|-
| 5 || OSX || NPDrawingModelInvalidatingCoreAnimation
|-
| 6 || Windows || NPDrawingModelSyncWin
|-
| 7 || Linux || NPDrawingModelSyncX
|-
| 8 || Windows || NPDrawingModelAsyncBitmapSurface
|-
| 9 || Windows || NPDrawingModelAsyncWindowsDXGISurface
|}
 
[https://mzl.la/2px2SZ5 PLUGIN_DRAWING_MODEL Nightly Evolution]


= Testing =
= Testing =
Line 69: Line 109:
To enable:
To enable:


* set dom.ipc.plugins.asyncdrawing.enabled=true
* dom.ipc.plugins.asyncdrawing.enabled=true
* dom.ipc.plugins.forcedirect.enabled=true (see {{bug|1620461}})
* make sure you are running Flash version >= 23
* make sure you are running Flash version >= 23
* set your sandbox level to 2 or less (security.sandbox.content.level <= 2)
Async drawing is current <strong>disabled</strong> via a pref in Beta and Release. Nightly and Aurora have the feature <strong>enabled by default</strong>.


= Main Bug List =
= Main Bug List =
7

edits