图形和性能的展示

  • 格式:pdf
  • 大小:1.31 MB
  • 文档页数:55

4x
© 2012 Adobe Systems Incorporated. All Rights Reserved.
直接位图映射 (FP 10.1 和 AIR 2.0)
4x x 4x 用作缩略图 x
资源图片
在内存中使用直接映射的方式 以及动态位图卸载 x x
© 2012 Adobe Systems Incorporated. All Rights Reserved.
19
原生JSON支持 (FP 11 和AIR 3.0)

高性能地解析和产生JSON数据

内部测试数据Demo

Tamarin native C++ Tamarin pure AS3 Chambers AS3 ActionJSON Alchemy

推荐使用原生的JSON API
© 2012 Adobe Systems Incorporated. All Rights Reserved.

支持原生 JPEG/PNG/JPEG-XR 编码
PNG
BitmapData
Encode
JPGXR
JPG

内部压力测试结果显示,使用BitmapData.encode可以比使用AS core lib里 的位图编码功能性能提高2-5倍。
© 2012 Adobe Systems Incorporated. All Rights Reserved.

长时计算

解析: XML,AMF 对象图的构造: XML或AMF的序列化

高延迟的操作

数据库的访问 文件I/O

Workers是比较重的对象,几乎和主Worker开销一样大 有限的Flash API 访问 目前只支持桌面
Context3D.CreateTexture(…, Context3D.CreateTexture(…) streamingLevels)
Array of bitmaps 4
Level 2
Bitmap level 0 Bitmap level 1
3
© 2012 Adobe Systems Incorporated. All Rights Reserved.
24
扩大GPU覆盖 (Stage3D constrained mode) (FP 11.4 和 AIR 3.4)

支持2006年1月1日之后的显卡驱动 Stage3D constrained mode使Stage3D能运行在诸如Intel GMA 900/950的老 显卡上
stage.stage3Ds[0].requestContext3D( Context3DRenderMode.AUTO, Context3DProfile.BASELINE_CONSTRAINED);

© 2012 Adobe Systems Incorporated. All Rights Reserved.
21
异步位图解码 (FP 11 和 AIR 2.6)

允许位图在单独的线程中完成解码
var loaderContext:LoaderContext = new LoaderContext(); loaderContext.imageDecodingPolicy = ImageDecodingPolicy.ON_LOAD; var loader:Loader = new Loader(); loader.load(new URLRequest("/myimage.png"), loaderContext); addChild(loader);
6
流式贴图 (FP 11.3 和 AIR 3.3)

实现先加载粗糙、低分辨率的材质,然后逐步加载高精度的图片。

这种先加载小图,然后加载大图的机制可以给用户一个快速的响应。
© 2012 Adobe Systems Incorporated. All Rights Reserved.
流式贴图 (FP 11.3 和 AIR 3.3)
动态位图卸载 (FP 10.1 和 AIR 2.0)
Time = y Time = z Time = z + t
访问/渲染
带有最近访问时间 的位图列表
© 2012 Adobe Systems Incorporated. All Rights Reserved.
直接位图映射 (FP 10.1 和 AIR 2.0)
3,921,994 bytes 2,779,142 bytes
3,754,181 bytes 2,735,930 bytes
-4.3% -1.6%
/?p=124
© 2012 Adobe Systems Incorporated. All Rights Reserved.

Demo link: /?p=2931
© 2012 Adobe Systems Incorporated. All Rights Reserved.

硬件加速的Stage Video (AIR Mobile 3.0) H.264/AAC视频硬件解码 (AIR 3.0 for iOS)


© 2012 Adobe Systems Incorporated. All Rights Reserved.
26
ActionScript Workers (FP 11.4 and AIR 3.4)

Flash开发者现在可以将高延迟的操作及长时的计算任务交给“Background Workers”

BitmapData 对象不再受限于最大16M( 16,777,215 像素)的精度 位图最大的宽度和高度也不再受限于8191像素 位图的最大尺寸现在依赖于操作体统
// swf-version = 12 error // swf-version = 13+ good var bitmapData:BitmapData = new BitmapData(8192, 2049);
BitmapData.drawWithQuality (FP 11.3 和 AIR 3.3)
BitmapData.draw BitmapData.drawWithQuality
Quality
不要更改舞台的渲染精度,这会拖慢GPU
© 2012 Adobe Systems Incorporated. All Rights Reserved.
性能相关的新特性
© 2012 Adobe Systems Incorporated. All Rights Reserved.
18
SWF的高效率压缩 (FP 11 和 AIR 3.0)

LZMA压缩能将SWF尺寸减少最高可达40% 缩短了下载时间并降低了带宽消耗,更好的用户体验 Flex SDK目前还不能产生LZMA压缩过的SWF,可以用Tinic放出的工具
现在不需要这样做了!
© 2012 Adobe Systems Incorporated. All Rights Reserved.
BitmapData.drawWithQuality (FP 11.3 和 AIR 3.3)
LOW
HIGH
Redraw
© 2012 Adobe Systems Incorporated. All Rights Reserved.

利用Stage Video实现流畅的高清视频渲染 在iOS上通过StageVideo实现H.264/AAC视频硬件解码及硬件渲染!
© 2012 Adobe Systems Incorporated. All Rights Reserved.
23
BitmapData.encode (FP 11.3 和 AIR 3.3)
流式贴图 (FP 11.3 和 AIR 3.3)
上传
Array of Bitmap Level bitmaps 4 2 level 0
GPU贴图
© 2012 Adobe Systems Incorporated. All Rights Reserved.
流式贴图 (FP 11.3 和 AIR 3.3)
20
垃圾回收提示 (FP 11 和 AIR 3.0)

为优化垃圾回收调度提供提示信息
pauseForGCIfCollectionImminent(imminence:Number = 0.75):void

传入较小的值(虽然还是大于0.25)很可能强制回收并导致应用程序停止 传入较大的值告诉垃圾回收器自己随意
zlib LZMA 8,892,786 bytes 2,357,002 bytes 4,890,509 bytes Gain/Loss -37.8% -23.8% -11.6% 14,296,699 bytes 3,091,229 bytes 5,530,215 bytes
Mandreel NyxQuest Flex 4.5 RSLs (combined) CopperCube Molehill Backyard Demo Away3D LoaderOBJTest Mario Forever Flash
© 2012 Adobe Systems Incorporated. All Rights Reserved.
5
三次贝塞尔曲线 (FP 11 和 AIR 3.0)

Flash Player会将三次曲线转成一个或多个二次曲线,然后再绘制。 这种转换是近似的,因此是不精确的。
© 2012 Adobe Systems Incorporated. All Rights Reserved.
© 2012 Adobe Systems Incorporated. All Rights Reserved.