HiDPI support coming to Flash Player

The current state of Flash content on the new MacBook Pro Retina (HiDPI) display is certainly a little underwhelming compared to HTML content in Safari. I thought I’d share with you that we are actively working to support the new displays. What exactly that means in the end is still work in progress. But to illustrate here are a couple of comparison screenshots which show what we are working on:

flex

The second screenshot shows YouTube (other major video sites like Vimeo work great too):

youtube

What can you expect for your content? Here is the current state of affairs:

- Usually no changes to your SWFs are required. If you use vector graphics they will be transparently scaled up.
- Bitmap filters scale up transparently as do most other effects if your display list object is on the main display list.
- On the ActionScript side Flash pixel units remain in the unit space, i.e. an ActionScript pixel (or point in OSX) is actually 2×2 screen pixels on a Retina display. This works similarly of how OSX approaches this with CoreGraphics and CoreAnimation.
- You will be able to access a new property: Stage.contentsScaleFactor. This property tells you if the Stage is on a HiDPI display or not. You could for instance use this property to load higher resolution bitmaps if you’d like.
- Stage3D will work slightly differently. As a Retina display quadruples the number of pixels it could result in a huge performance loss. And of course your code might be highly dependent on actual back buffer sizes (for instance if you do render to texture, pixel effects and such). So the Flash Player will not change the back buffer size by default. To enable HiDPI displays we will add a new flag to Context3D.configureBackBuffer (the exact API is not fleshed out yet) which will allow you to buy into a higher resolution back buffer. Most 2D frameworks based on Stage3D will probably want to do this. Again this approach is similar to what is done on OSX, see documentation around setWantsBestResolutionOpenGLSurface.

Of course we expect a few issues here and there but from what we have tested so far most sites work great in this new mode, including big franchises like FarmVille and Angry Birds.

Leave a comment

3 Comments.

  1. Sorry for my ignorance, but wouldn’t this be like developing for mobile platforms with different dpis? And if so, why the different approach in both cases?

    [TU: It's not quite the same thing. On mobile you fill the entire screen and are not part of an existing web page. Depending on device type (especially on Android) and device rotation you already have to deal with different resolutions and Stage sizes. So it's almost mandatory that you deal with this today on mobile. In HTML land you want to deal with legacy content and without having to change any metrics.]

  2. Markus Stange

    Could browsers use the same capability to get sharp scaling for regular page zooming on non-HiDPI displays? At the moment, zooming youtube for example only extends the player size and doesn’t enlarge the controls.

Trackbacks and Pingbacks: