Faster 2D graphics on Windows 8 Frame Rate 95.79 6040 Windows 8 Windows 7 0 Text Rendering.
Download ReportTranscript Faster 2D graphics on Windows 8 Frame Rate 95.79 6040 Windows 8 Windows 7 0 Text Rendering.
Faster 2D graphics on Windows 8
120 100 80 60 40 95,79 46 20 0 Text Rendering Windows 8 Windows 7
30 20 10 0 70 60 50 40 512 2048 Number of Primitives 8192 Windows 8 Windows 7
Your app will run faster on Windows 8
How to write the fastest Direct2D app
• • • • • • Animate complex content fast Clip content to an arbitrary shape fast Draw text fast Render Direct2D effects fast Scale performance on multiple cores Draw mixed 2D/3D content fast
// create a bitmap size nullptr 0 dpiX dpiY // preserve pre-existing target ComPtr
// render to the sceneBitmap // render sceneBitmap to oldTarget
// create an opacity bitmap size nullptr 0 dpiX dpiY // preserve pre-existing target ComPtr
// render to the opacityBitmap // call FillOpacityBitmap()
// enables rasterizing only the changed content DXGI_PRESENT_PARAMETERS
Use bitmaps for caching display output Use command list for caching print output.
• • • • • • Animate complex content fast Clip content to an arbitrary shape fast Draw text fast Render Direct2D effects fast Scale performance on multiple cores Draw mixed 2D/3D content fast
// create the layer resource // render to the layer with the clipping geometry boundsRect geometricMask
// create opacity bitmap and render content // create opacity brush from the opacity bitmap // call FillGeometry() by passing in the clip geometry and the opacity brush to
• • • • • • Animate complex content fast Clip content to an arbitrary shape fast Draw text fast Render Direct2D effects fast Scale performance on multiple cores Draw mixed 2D/3D content fast
Draw text fast
// Create text layout once text length maxWidth maxHeight // draw the text layout repeatedly origin
GrayScale text rendering mode
• • Set the rendering mode to grayscale explicitly SetTextAntiAliasMode(D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE)
• • • • • • Animate complex content fast Clip content to an arbitrary shape fast Draw text fast Render Direct2D effects fast Scale performance on multiple cores Draw mixed 2D/3D content fast
Render Direct2D effects fast
• • • • • • Animate complex content fast Clip content to an arbitrary shape fast Draw text fast Render Direct2D effects fast Scale performance on multiple cores Draw mixed 2D/3D content fast
• • • • • • Animate complex content fast Clip content to an arbitrary shape fast Draw text fast Render Direct2D effects fast Scale performance on multiple cores Draw mixed 2D/3D content fast
Mixing 2D and 3D content
• • • • • • Animate complex content fast Clip content to an arbitrary shape fast Draw text fast Render Direct2D effects fast Scale performance on multiple cores Draw mixed 2D/3D content fast
• Channel 9 PDC’10 talk: Adopting D2D and Dwrite for hardware acceleration in Native Windows Applications • Channel 9 PDC=09 talk: Advanced graphics functionality using DirectX
http://forums.dev.windows.com
http://bldw.in/SessionFeedback