-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement CachedBitmap #39245
Implement CachedBitmap #39245
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @safern, @tannergooding |
src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/CachedBitmap.Unix.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Drawing.Common/src/System/Drawing/Graphics.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/CachedBitmap.Unix.cs
Show resolved
Hide resolved
src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/CachedBitmap.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/CachedBitmap.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/CachedBitmap.cs
Show resolved
Hide resolved
This, in general, looks good to me (minus the test failures). |
We should presumably wait to merge this until the Mono change is merged and we can be certain it will be in 6.1. |
Agreed. Added NO MERGE in the meantime. |
src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/CachedBitmap.Unix.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/CachedBitmap.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Drawing.Common/tests/Imaging/CachedBitmapTests.cs
Outdated
Show resolved
Hide resolved
Not a problem, it happens from time to time! |
FYI, the runtime assets version of the package has been updated today in the morning. |
84a19dd
to
9b3cbc4
Compare
Well, that wasn't supposed to happen. Looks like I now have 0 commits in this PR... |
@reflectronic why is this PR closed now? I thinks it's a valuable addition. |
Because next time, I should ask a professional before I do anything with Git 😅 I'm working on fixing what happened |
Update reference assembly Add tests Add doc comments Fix tests Initial support for CachedBitmap on Unix Enable tests on Unix Improve version detection mechanism Fix build Fix version detection Improve test suite Respond to API review feedback Update reference assembly Fix formatting Add license headers Fix test failure on .NET Framework Update src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/CachedBitmap.cs Co-authored-by: Günther Foidl <[email protected]> Update src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/CachedBitmap.Unix.cs Co-authored-by: Günther Foidl <[email protected]> Make exception messages clearer Improve error message again Address PR feedback Update src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/CachedBitmap.Windows.cs Co-authored-by: Santiago Fernandez Madero <[email protected]>
Thankfully, this does at least consume the new changes to the runtime-assets package. However, it still isn't picking up the new CachedBitmap test assets. Even if I do a local build of It looks like this is won't to make it into .NET 5, which is slightly unfortunate. I didn't really have control over how quickly the libgdiplus PR would progress, though, so that was probably to be expected. However, this does give me the opportunity to batch up some related changes in .NET 6, which should be pretty neat. |
@reflectronic is this ready to go now? |
The libgdiplus change still needs to be merged, so this isn't really good to go yet. I can't really see anything needing to change in this PR specifically, though, unless someone comes up with some feedback. |
@reflectronic ah of course. I poked that PR. I'm going to close this PR until the libgdiplus change is merged and deployed. We are trying to reduce the huge number of active PRs in this repo so that it becomes easier to reason about them. You can easily reopen the PR when it's ready - it just gets it off the list we're looking at for now. Sound good? |
Closes dotnet/winforms#8822
This functionality did not exist in libgdiplus prior to my implementation of it, which can be reviewed at mono/libgdiplus#654. It is not merged yet, but it will be available in libgdiplus 6.1.
Since this functionality has not yet been published in a released version of libgdiplus, and since it is likely that people using CachedBitmap could be running an older version, there is a version check that lets us fail gracefully in case CachedBitmap is not present.
Because 6.1 isn't released, testing these changes for non-Windows platforms will be tough. Right now, the CachedBitmap tests would just be skipped in CI until the released version gets upstreamed into all of the right places. I can at least promise you that they work when running on my local machine 😉. The tests are mostly the same as the ones present in my PR to libgdiplus, and they are passing on Windows as well.
This PR depends on dotnet/runtime-assets#80