-
-
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
Consume memory primitives from SixLabors.Core #665
Conversation
Codecov Report
@@ Coverage Diff @@
## master #665 +/- ##
=========================================
- Coverage 89.67% 89.6% -0.07%
=========================================
Files 890 878 -12
Lines 37633 37229 -404
Branches 2472 2450 -22
=========================================
- Hits 33747 33359 -388
+ Misses 3182 3177 -5
+ Partials 704 693 -11
Continue to review full report at Codecov.
|
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.
Just some cleanup required to remove method duplication. Other that that this all looks great!
@@ -120,7 +123,7 @@ public BufferArea<T> GetSubArea(int x, int y, int width, int height) | |||
public BufferArea<T> GetSubArea(Rectangle rectangle) | |||
{ | |||
ImageSharp.DebugGuard.MustBeLessThanOrEqualTo(rectangle.Width, this.Rectangle.Width, nameof(rectangle)); | |||
DebugGuard.MustBeLessThanOrEqualTo(rectangle.Height, this.Rectangle.Height, nameof(rectangle)); | |||
SixLabors.DebugGuard.MustBeLessThanOrEqualTo(rectangle.Height, this.Rectangle.Height, nameof(rectangle)); | |||
|
|||
int x = this.Rectangle.X + rectangle.X; |
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're mixing two DebugGuard
methods now. We should ditch the ImageSharp one.
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! Having common internals is just too dangerous, we should probably drop [InternalsVisibleTo(...)]
in SL.Core to avoid these issues.
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.
Yeah, though I was wondering whether we should just make them public and avoid duplication? They're useful and well tested.
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.
One can accidentally include and use such internals with R# (been there). I would rather share them through submodules in the future. For now it's just safer to hide them IMO.
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.
Hide them then. We can investigate private packages like they use for ASP Core in the future
Consume memory primitives from SixLabors.Core
Prerequisites
Description
SixLabors.Core
package referenceSixLabors.Core
SixLabors.ImaSharp.Memory
namespaceFixes #619.