Jump to content

Search the Community

Showing results for tags 'direct2d canvas'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management


  • Community Calendar

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Found 1 result

  1. I had an application (A UI in front of an image SQLite database) using Direct2D 1.0 thru Delphi provided TDirect2DCanvas (VCL). This work well and it is fast. To be able to use recent features of Direct2D, I wrote a modified version of TDirect2DCanvas to support Direct2D 1.1 and later. For the changes, I followed this guide. It works nicely except it is ten times slower now! Measuring performance was easy: Simple with Direct2D 1.0 it is almost instantly (less than one second for 49 images as shown in the screen dump below while Direct2D 1.1 take roughly ten seconds. The code for rendering the bitmap is the same for both Direct2D 1.0 and 1.0 and is the following: BeginPaint(Handle, PaintStruct); RenderTarget.BeginDraw; RenderTarget.Clear(D2D1ColorF(FBackColor)); if FBitmapToPaint <> nil then begin RenderTarget.SetTransform(FTransform); RenderTarget.DrawBitmap(FBitmapToPaint, nil, 1.0, D2D1_BITMAP_INTERPOLATION_MODE_LINEAR, nil); end; RenderTarget.EndDraw; // Next line only for Direct2D 1.1 version DXGISwapChain.Present1(SyncInterval, PresentFlags, PresentParams); EndPaint(Handle, PaintStruct); RenderTarget is a ID2D1RenderTarget for Direct2D 1.0 and an ID2D1DeviceContext for Direct2D 1.1. FBitmapToPaint is a ID2D1Bitmap. PresentFlags and SyncInterval are always zero. PresentParams is a zeroed TDXGIPresentParameters structure. The code to initialize all the interfaces are inspired by the code shown on the guide I mentioned above. In the application, there are as much such small windows as fit on the application window (49 in the screen dump). The application currently does only image rendering: Loading JPG small files, scaling and rotating to fit the small window used for rendering. Those are thumbnails, so there are maybe 50 or 100 such small window on screen. No geometry, no text, no other drawing. Only a single bitmaps per window. I have not yet used anything specific to Direct2D 1.1. If can switch from one version to the other just by using Delphi provide Vcl.Direct2D unit in the uses clause, or using my own modified version for Direct2D V1.1 and later. My question are: 1) Is Direct2D 1.1 really slower than 1.0? (I suppose not) 2) Which tool (free if possible) can I use to measure everything involved in the creation of the window and the rendering so that I can find out what is slower exactly, hoping to find why it is slower. BTW: I am using Windows 10 1909.