Improved Resolution of Stage3D Content on Browser Zoom

Authored by Channey Park

Flash Player version 15 (FP 15) introduced a feature whereby the loss of sharpness of Stage3D content upon browser zoom can be avoided.  With prior versions of FP, upon the user’s changing of the browser zoom factor, content that is rendered to a statically sized Stage3D buffer is scaled to match the browser zoom.  As the browser zoom factor increases, the sharpness of the Stage3D content is increasingly lost due to the scaling content. A new functionality introduced in FP 15 provides an event notification to the content when the browser zoom changes, and allows the content an opportunity to change the size of the Stag3D back buffer and re-render the stage3D content.

Browser Zoom Factor for NPAPI, PPAPI, and Active-x Plugins

This feature is extended to support the Firefox browser with Flash Player Version 21 (FP21).

The following new ActionScript features were introduced in FP 15 to facilitate the above described functionality:

  • Event.BROWSER_ZOOM_CHANGE

The Event. BROWSER_ZOOM_CHANGE event fires when the browser zoom factor changes.

  • Stage.browserZoomFactor

The Stage.browserZoomFactor property returns the current browser zoom factor setting.  A return value of 1.0 indicates no zoom.

  • Context3D.backBufferWidth, Context3D.backBufferHeight methods

The above properties return the width and height, respectively, of the Stage3D back buffer.

  • wantsBestResolutionOnBrowserZoom parameter 

The above Boolean parameter is added to the Context3D.configureBackBuffer method to allow the FP content developer to indicate whether the Stage3D back buffer size should be automatically resized to match the browser zoom factor. After this parameter is set to true, the size of the Stage3D back buffer changes by a multiple of the browser zoom factor whenever the browser zoom factor changes. The setting of the parameter is persistent across multiple changes in browser zoom factor and the Content3D.configureBackBuffer method must be called again to reset the value. The value of the parameter is false by default.

Note: The above Stage3D back buffer is distinct from the Flash Player back buffer.  The Flash Player back buffer normally changes in size when the browser zoom factor changes, regardless of the value of wantsBestResolutionOnBrowserZoom.  In the context of this feature, Stage3D back buffer changes in size, in response to change in browser zoom factor, only when the wantsBestResolutionOnBrowserZoom is set to true.

  • Context3D.maxBackBufferWidth, Context3D.maxBackBufferHeight properties

A larger Stage3D back buffer will require more system resources to render to (e.g., more pixels are processed by shader programs for a larger Stage3D back buffer) and, thus, performance degradation may result from the Stage3D back buffer being too large.

The maxBackBufferWidth/Height integer properties can be set to limit the increase in the size of the Stage3D back buffer.  The automatic resizing of the Stage3D back buffer through the wantsBestResolutionOnBrowserZoom parameter being set to true is upwardly bound by this limit. Also, a call to Context3D.configureBackBuffer method with the width or height parameter values greater than this limit will raise a Bad Input Exception.

The default values for the properties are set to the system limit and cannot be increased beyond the system limit.

An increase in the browser zoom factor after the Stage3D back buffer has been increased to the maxBackBufferWidth/Height limit will be satisfied through scaling of the Stage3D content.

  • Considerations on Scissor Rectangle

Scissor rectangle areas are automatically scaled when the size of the Stage3D back buffer changes automatically due to the wantsBestResolutionOnBrowserZoom parameter being set to true.

  • Feature Availability by Platform

The version of Firefox that supports this feature will be provided when available.

This table describes the support for Browser Zoom factor feature on different browsers:

BrowserFlash Player 15 - Flash Player 17Flash Player 18 - Flash Player 20Flash Player 21 and above
Win 8.x Internet Explorertickticktick
Non-Win 8.x Internet Explorercrossticktick
Operacrossticktick
Chromecrossticktick
Firefoxcrosscrosstick
Safaricrosscrosscross

Control of scaling behavior upon zoom value

Browser Zoom Factor Feature (BZFF) allows automatic scaling of flash content in response to web page zoom for StageScaleMode.NoScale mode can now be enabled or disabled optionally by the developer. BZFF is turned on by default and can be turned on or off by setting a new attribute browserzoom to two possible values scale or noscale in HTML EMBEDSWF and OBJECT tag.

This table describes the use of new attributes introduced to enable/disable BZFF feature:

BZFF turn on/offAttribute descriptionAttribute name and value in HTMLZoom change behavior
If BZFF needs to be turned offAdd a new attribute browserzoom
in a list of params for both the HTML OBJECT tags i.e with attribute ‘classid’ and ‘type’
Flash content does not gets scaled on changing the browser zoom factor
Add a new attribute browserzoom
in a list of params for HTML EMBEDSWF tag
params.browserzoom=
"noscale"
If BZFF needs to be turned onAdd a new attribute browserzoom
in a list of params for both the OBJECT tags i.e with attribute ‘classid’ and ‘type’
Flash content is scaled on changing the browser zoom factor
Add a new attribute browserzoom
in a list of params for HTML EMBEDSWF tag
params.browserzoom=
"scale"

One Response to Improved Resolution of Stage3D Content on Browser Zoom

  1. Bloglovin says:

    Good news guys.