-
-
Notifications
You must be signed in to change notification settings - Fork 852
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
Split PixelBlendMode into PixelColorBlendingMode and PixelAlphaCompositionMode #679
Conversation
…lAlphaCompositionMode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Happy to merge if @tocsoft doesn't spot anything funky.
return false; | ||
} | ||
|
||
if (this.options.ColorBlendingMode != PixelColorBlendingMode.Normal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much more readable! 👍
Codecov Report
@@ Coverage Diff @@
## master #679 +/- ##
==========================================
+ Coverage 85.29% 89.24% +3.95%
==========================================
Files 878 878
Lines 39092 39209 +117
Branches 2538 2557 +19
==========================================
+ Hits 33342 34994 +1652
+ Misses 5055 3489 -1566
- Partials 695 726 +31
Continue to review full report at Codecov.
|
@@ -32,7 +32,7 @@ public struct TextGraphicsOptions | |||
|
|||
private float? dpiY; | |||
|
|||
private PixelBlenderMode blenderMode; | |||
private PixelColorBlendingMode blenderMode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should add the alpha blending option in here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tocsoft I'll take a look
@JimBobSquarePants @tocsoft Some of the coverage tests are failing because the DrawImageProcessor methods I added are not being called from anywere because there were some missing methods in DrawImageExtensions. And looking at DrawImageExtensions I've noticed the arguments ordering is a bit of a mess.... Some methods have opacity before blending, and others the opposite way. Should I rearrange the arguments so location is always first and opacity is always the last?
|
the re-arranged arguments look good to me. |
…mbinations, reference images not in place yet
… be called from more places, and also allows for specific tests.
Nice coverage! |
Split PixelBlendMode into PixelColorBlendingMode and PixelAlphaCompositionMode
Prerequisites
Description
This continues the process started with #535
As described in the issue, GraphicsOptions now has two separated modes for configuring Color Blending and Alpha Composition.
PixelAlphaCompositionMode has "SrcOver" as first value to ensure that a default GraphicsOptions structure will always be SrcOver-Normal which is the mode everybody expects by default.
Now there's a lot more possible combinations, so creating tests for all of them might take a while. Specially considering the test images are in a separate repository.