Updates

Hi everyone-

A few more Direct2D updates:

  • RGB images can now be cached in the GPU and accessed using Image::BitmapData
  • Image background is now only cleared when the image is created or when calling Image::clear
  • Change Image initialization order so the DirectX resources are created first
  • Allow multiple instances of BitmapData per Image to support ImageConvolutionKernel
  • Fixed more issues with scaling cached stroked paths
  • Changed the Path internal unique ID to avoid false positive cache hits
  • Changed drawing rectangles to more closely match the software renderer
  • Added missing error checks for DirectX factory creation

Matt

10 Likes

My apologies, everyone; I didn’t check the last commits carefully enough and that’s causing exceptions. I should have it sorted out soon.

Matt

Just posted several updates that should resolve the exceptions. My apologies again.

Matt

1 Like

Great work!

Regarding this change mentioned, I have seen that in the relevant commit the rectangles are being reduced by half their stroke thickness to mimic the software renderer.

I seem to remember that the software renderer was doing this only for Rectangle <int>, whereas with Rectangle <float> it was up to the caller to align the rectangle “in the middle of the pixels” in order for a thickness of 1 px to appear sharp and not blurred between at the boundary of two pixels.

I haven’t had time to check this with Direct2D, but have you checked that the Direct2D workaround you have implemented is consistent with the software renderer both in the case of Rectangle <int> and Rectangle <float>?

Keep up the good work! :clap:

1 Like

Thanks for the kind words!

And thanks for the note on drawRect; I’ll double-check float vs int as you suggest.

Matt