`

AdobeMax: Deep Dive into Flash Player Rendering

 
阅读更多

from http://www.developria.com/2010/10/adobemax-deep-dive-into-flash.html

 

AdobeMax: Deep Dive into Flash Player Rendering

Introduction

For those unable to attend, my first session is the Deep Dive into Flash Player Rendering. This seems to be an extremely misunderstood topic and likely will be a great thing to have a deeper understanding in. This is a very complex process and is worth taking some of the concepts mentioned below and doing some further research in. There apparently is a lighter IP ruling by Adobe behind their FlashPlayer and they are exposing more information about how their FlashPlayer code works.

The presenter is Lee Thomason and is a Flash Player Architect at Adobe. He is also a principle scientist at Adobe and architect for the Flash Player.

Topics of this class

Four stages of rendering for Flash Player

  1. Computation
  2. Edge and Color Creation
  3. Rasterization
  4. Presentation
Computation

During computation the display list has a retained renderer. The invalidated objects are walked to determine which ones are dirty. All objects are considered "SObjects" to the flash player and mutate based on the contents of the object. For example a object with a timeline will have more memory consumed than an object without a timeline.

Performance advice

  1. Balance
  2. Size - minimize the number of SObjects in memory
  3. Shape vs Sprite - Favor Shapes over Sprites
  4. Show Redraw Regions - Check the redraw regions regularly to check to make sure you are expecting what you see redrawing.


Edge and Color Creation

All edges in the player are represented as Bezier curves. There are some performance concerns around Edges. Edge to pixel ratio is the major concern when art is shrunken to a small pinhead or automatic conversion of art via a tool. The bottleneck in the player for edges is not in the Edge and Color creation, but during the Rasterization step.

After the computation step occurs but before the edge and color creation occurs there is a stroke that occurs as a seperate layer in the SObject. Stroke generation is extremely complicated and he is more or less sidestepping this portion of the explanation.

Color and Fill are represented as the same thing, they are defined on the same plane. Transforms are applied to edges and the fill independently of each other during a transform/animation.

The following are examples of color types

  1. Solid
  2. Bitmap
  3. 2.5D Bitmap
  4. Video
  5. Causes special timing
  6. Gradients
  7. Text
  8. PixelBender 2d
  9. Mask
  10. Special Color that clips other colors

Scale 9 is the Scale 9 Grid on Display object. It is a non-linear edge transformation. It can not be defined in a single Matrix to define its transformation, it is actually represented as 9 separate matrices. Color fills are represented as one matrix transformation.

All of the examples of Scale 9 will be posted by Lee and I will follow up with a comment later.

Rasterization

Rasterization is a back buffer operation and occurs once per dirty rectangle per scan line (or horizontal row of pixels). The best takeaway from this according to Lee is that the render occurs top to bottom left to right pixel by pixel.

Rasterization in general excludes hidden objects and each pixel is touched only once. Spans (which are the runs of pixels that have no change since the last resterization) are solid colors or opaque objects. There are occasions where sub pixel computations occur when edges are started/ended in the same pixel. There is nothing that can be done to optimize for this behavior as it is deep within the Flash Player. Basically the comment here seems to be that transparent bitmaps can significantly cause render problems since you are causing the rasterization step to do computation when it doesn't even display anything for the transparent pixels.

More pixels is of course more rasterization, however fullScreenSourceRect can improve performance by reducing quality due to the hardware scaling.

Presentation

The presentation approach is changing, because dirty rectangle calculation is changing. WMode is the setting that impacts presentation. There are three modes, normal where our own version software surface. WMode = transparent or opaque defeats dirty rectangles and forces full redraws. WMode = direct uses hardware surface and can dramatically increase performance. This seems like something worth trying, but one of the edge cases could be applications with lots of changing text that will not be impacted positively by this mode.

Tearing is primarily presentation sync. There are subtle cases, video updates and split blits. Tearing is going away with hardware compositing. As modern browsers expose the GPU stack of video cards a lot of these problems go away.

Surface Rendering

Surface happens when you use cacheAsBitmap, Filters, 2.5D and scroll rect with opaque backgrounds. This causes a different set of computations to occur during the presentation phase of the process. It adds a composition phase that occurs before presentation when pixels are written to the back buffer.

New Stuff

StageVideo and Stage3D are new features of the Flash Player that run behind the DisplayList. They have their own hardware surfaces and independent rendering planes. This allows the FlashPlayer to not impact DisplayList objects with 3d objects in either StageVideo or Stage3D. The StageVideo is the lowest level stage and the Stage3d sits atop it. The DisplayList we all know and love is on top of both of those.

GPU Rendering obeys all the rendering rules and does draw hidden objects and follows a different appraoch.

In conclusion here is a cheat sheet

Fundamental=Computation->Edges & colors -> Rasterization -> Presentation

  • Show redraw regison gives insights into display list
  • Edges and colors are primitives of rendering
  • Beware alpha and per pixel comutation
  • Presentation is changing
  • Surface=... -> Rasterization -> Processing -> Compositing
  • Remeber the cache!
  • Direct Mode Planes are fast but separate
  • GPU Rendering: same rules, different approach
  • These guys blog here http://www.bytearray.org/
  • Please follow me on twitter here: http://twitter.com/neosavvy
  • Check out my company's website here http:///www.neosavvy.com
分享到:
评论

相关推荐

    (179979052)基于MATLAB车牌识别系统【带界面GUI】.zip

    基于MATLAB车牌识别系统【带界面GUI】.zip。内容来源于网络分享,如有侵权请联系我删除。另外如果没有积分的同学需要下载,请私信我。

    DG储能选址定容模型matlab 程序采用改进粒子群算法,考虑时序性得到分布式和储能的选址定容模型,程序运行可靠 这段程序是一个改进的粒子群算法,主要用于解决电力系统中的优化问题 下面我将对程序进行详

    DG储能选址定容模型matlab 程序采用改进粒子群算法,考虑时序性得到分布式和储能的选址定容模型,程序运行可靠 这段程序是一个改进的粒子群算法,主要用于解决电力系统中的优化问题。下面我将对程序进行详细分析。 首先,程序开始时加载了一些数据文件,包括gfjl、fljl、fhjl1、cjgs和fhbl。这些文件可能包含了电力系统的各种参数和数据。 接下来是一些参数的设置,包括三种蓄电池的参数矩阵、迭代次数、种群大小、速度更新参数、惯性权重、储能动作策略和限制条件等。 然后,程序进行了一些初始化操作,包括初始化种群、速度和适应度等。 接下来是主要的迭代过程。程序使用粒子群算法的思想,通过更新粒子的位置和速度来寻找最优解。在每次迭代中,程序计算了每个粒子的适应度,并更新个体最佳位置和全局最佳位置。 在每次迭代中,程序还进行了一些额外的计算,如潮流计算、储能约束等。这些计算可能涉及到电力系统的潮流计算、功率平衡等知识点。 最后,程序输出了一些结果,包括最佳位置和适应度等。同时,程序还绘制了一些图形,如电压和损耗的变化等。 综上所述,这段程序主要是一个改进的粒子群算法,用于解决电力

    三保一评关系与区别分析

    三保一评关系与区别分析

    Day-05 Vue22222222222

    Day-05 Vue22222222222

    多功能知识付费源码下载实现流量互导多渠道变现+搭建教程

    多功能知识付费源码下载实现流量互导多渠道变现+搭建教程。资源变现类产品的许多优势,并剔除了那些无关紧要的元素,使得本产品在运营和变现能力 方面实现了质的飞跃。多领域素材资源知识变现营销裂变独立版本。 支持:视频、音频、图文、文档、会员、社群、用户发布、创作分成、任务裂变、流量主、在线下载等多种功能,更多功能 正在不断更新中... 支持流量主变现模式,付费下载付费古观看等变现模式。 实现流量互导,多渠道变现。可以独立部署,并绑定自有独立域名,没有域名限制。

    住家保姆的工作职责、照顾老人住家保姆服务内容.docx

    住家保姆的工作职责、照顾老人住家保姆服务内容.docx

    《高温中暑事件卫生》一级(红色),二级(橙色),三级(黄色),四级(蓝色).docx

    《高温中暑事件卫生》一级(红色),二级(橙色),三级(黄色),四级(蓝色).docx

    职业中专技工学校专业评估表.docx

    职业中专技工学校专业评估表.docx

    统计计算使用R一书的源代码Rcode.zip

    统计计算使用R一书的源代码Rcode.zip

    YOLO算法-火灾和人员探测数据集-850张图像带标签-人-烟-火.zip

    YOLO系列算法目标检测数据集,包含标签,可以直接训练模型和验证测试,数据集已经划分好,包含数据集配置文件data.yaml,适用yolov5,yolov8,yolov9,yolov7,yolov10,yolo11算法; 包含两种标签格:yolo格式(txt文件)和voc格式(xml文件),分别保存在两个文件夹中,文件名末尾是部分类别名称; yolo格式:<class> <x_center> <y_center> <width> <height>, 其中: <class> 是目标的类别索引(从0开始)。 <x_center> 和 <y_center> 是目标框中心点的x和y坐标,这些坐标是相对于图像宽度和高度的比例值,范围在0到1之间。 <width> 和 <height> 是目标框的宽度和高度,也是相对于图像宽度和高度的比例值; 【注】可以下拉页面,在资源详情处查看标签具体内容;

    社区居民诊疗健康-JAVA-基于SpringBoot的社区居民诊疗健康管理系统设计与实现(毕业论文)

    社区居民诊疗健康功能描述 社区居民诊疗健康系统是一个为社区居民提供健康管理、疾病预防、诊疗服务和健康教育的综合平台。该平台致力于提升居民的健康水平,通过智能化、便捷化的服务为居民提供高效的健康保障。以下是该系统的主要功能描述: 1. 用户注册与登录 居民注册:居民可以通过身份证、手机号或社交媒体账号进行注册,填写个人基本信息(如姓名、性别、年龄、联系方式等)并创建账户。 健康档案管理:每个居民注册后,系统会自动生成个性化健康档案,记录个人的健康历史、疾病记录、体检报告等。 2. 健康档案与记录管理 个人健康档案:包括居民的基础健康信息、既往病史、用药记录、免疫接种记录、体检报告等。 诊疗记录管理:记录每次诊疗信息,如诊断、治疗方案、用药情况及随访记录。 健康指标监测:定期记录和更新如血压、血糖、体重、体脂等常见健康指标,便于长期追踪和分析。 3. 在线问诊与诊疗服务 在线咨询:居民可以通过平台预约或直接向社区医生发起在线问诊,获取健康咨询、疾病预防建议、用药指导等服务。 远程诊疗:提供视频问诊功能,方便居民与医生进行实时面对面的远程交流,获得更加详细的诊疗建议。 预约就诊:居民可以

    面部、耳廓损伤损伤程度分级表.docx

    面部、耳廓损伤损伤程度分级表.docx

    java毕设项目之ssm校园美食交流系统+vue(完整前后端+说明文档+mysql+lw).zip

    项目包含完整前后端源码和数据库文件 环境说明: 开发语言:Java 框架:ssm,mybatis JDK版本:JDK1.8 数据库:mysql 5.7 数据库工具:Navicat11 开发软件:eclipse/idea Maven包:Maven3.3 服务器:tomcat7

    功能完善的小说CMS系统项目全套技术资料.zip

    功能完善的小说CMS系统项目全套技术资料.zip

    YOLO算法-回收站数据集-501张图像带标签-黑色垃圾箱-绿色垃圾桶-箱子-杯子-老鼠-蓝色垃圾桶.zip

    YOLO系列算法目标检测数据集,包含标签,可以直接训练模型和验证测试,数据集已经划分好,包含数据集配置文件data.yaml,适用yolov5,yolov8,yolov9,yolov7,yolov10,yolo11算法; 包含两种标签格:yolo格式(txt文件)和voc格式(xml文件),分别保存在两个文件夹中,文件名末尾是部分类别名称; yolo格式:<class> <x_center> <y_center> <width> <height>, 其中: <class> 是目标的类别索引(从0开始)。 <x_center> 和 <y_center> 是目标框中心点的x和y坐标,这些坐标是相对于图像宽度和高度的比例值,范围在0到1之间。 <width> 和 <height> 是目标框的宽度和高度,也是相对于图像宽度和高度的比例值; 【注】可以下拉页面,在资源详情处查看标签具体内容;

    java毕设项目之ssm助学贷款+jsp(完整前后端+说明文档+mysql+lw).zip

    项目包含完整前后端源码和数据库文件 环境说明: 开发语言:Java 框架:ssm,mybatis JDK版本:JDK1.8 数据库:mysql 5.7 数据库工具:Navicat11 开发软件:eclipse/idea Maven包:Maven3.3 服务器:tomcat7

    (3127654)超级玛丽游戏源码下载

    内容来源于网络分享,如有侵权请联系我删除。另外如果没有积分的同学需要下载,请私信我。

    hw06.zip

    hw06

    基于 C++和TCP和WebSocket的即时通信系统设计与实现(源码+文档)

    这个项目是使用C++实现的即时通信系统,具有高性能、高并发的特点,项目包括客户端和服务器,实现了以下功能:注册、登录、点对点聊、群聊、上下线通知、用户在线信息、拉取好友信息、拉取好友分组信息、拉取群信息、拉取群成员信息;使用到的语言包括C++、Node.js;开源库:Boost C++ Libraries、Openssl、Protobuf、Hiredis、Socket.io;相关开发工具:Redis、Sqlite、Nginx、Microsoft Visual Studio、Visio;

    医疗设备管理-JAVA-基于springboot的医疗设备管理系统设计与实现(毕业论文)

    医疗设备管理功能描述 医疗设备管理系统的主要目的是为医院和医疗机构提供高效的设备管理解决方案,确保医疗设备的安全、有效和高效使用。以下是该系统可能具备的功能描述: 1. 设备信息管理 设备登记:记录所有医疗设备的基本信息,包括设备名称、型号、序列号、生产厂家、购置日期等。 设备分类:将设备按类型(如影像设备、监护设备、实验室设备等)进行分类,方便查询和管理。 设备状态跟踪:实时更新设备的使用状态(如在用、维修中、闲置等),确保信息准确。 2. 设备维护管理 维护计划:制定设备的定期维护计划,设置维护周期和提醒通知。 维护记录:记录每次设备维护的详细信息,包括维护日期、维护内容、维护人员等。 故障报告:提供故障报告功能,用户可以快速记录设备故障并提交给维护人员。 3. 设备使用管理 使用申请:医务人员可以在线申请使用特定设备,系统自动记录申请信息。 使用记录:记录设备的使用情况,包括使用时间、使用人员、使用目的等,便于后续查询。 使用统计:生成设备使用统计报表,分析设备的使用频率和效率。 4. 库存管理 库存监控:实时监控医疗设备的库存情况,确保设备充足。 设备采购管理:记录设备采购

Global site tag (gtag.js) - Google Analytics