-
Notifications
You must be signed in to change notification settings - Fork 806
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
Implementation of CGPattern via runtime base #2374
Implementation of CGPattern via runtime base #2374
Conversation
d968617
to
98f2cc6
Compare
Frameworks/UIKit/UIColor.mm
Outdated
@@ -518,12 +518,12 @@ - (UIColor*)initWithPatternImage:(UIImage*)image { | |||
callbacks.releaseInfo = 0; | |||
callbacks.drawPattern = __UIColorPatternFill; | |||
|
|||
_pattern = (id) CGPatternCreateColorspace(self, bounds, m, bounds.size.width, bounds.size.height, 0, NO, &callbacks, pImg->_has32BitAlpha ? _ColorABGR : _ColorBGR); | |||
_pattern = _CGPatternCreateColorspace(self, bounds, m, bounds.size.width, bounds.size.height, 0, NO, &callbacks, pImg->_has32BitAlpha ? _ColorABGR : _ColorBGR); |
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.
Lets remove the code in #if 0. #Resolved
Frameworks/UIKit/UIColor.mm
Outdated
@@ -224,7 +224,7 @@ @implementation UIColor { | |||
@public | |||
enum BrushType _type; | |||
UIImage* _image; |
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.
nit: while we are at this, could this be StrongId<>? #Resolved
Frameworks/CoreGraphics/CGPattern.mm
Outdated
- (void)dealloc { | ||
if (generatedImage) { | ||
CGImageRelease(generatedImage); | ||
inline CGAffineTransform TransformMatrix() const { |
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.
Nit: The name sounds like a verb. Adding a Get will clarify the intent. #Resolved
Frameworks/CoreGraphics/CGPattern.mm
Outdated
|
||
if (generatedImage) { | ||
CGImageRelease(generatedImage); | ||
inline CGRect Bounds() const { |
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.
nit: could return const ref. #Resolved
Frameworks/CoreGraphics/CGPattern.mm
Outdated
} else { | ||
bitmapInfo = kCGImageAlphaNone; | ||
colorSpace = CGColorSpaceCreateDeviceGray(); | ||
inline CGAffineTransform PatternTransform() { |
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.
nit: GetPatternTransform() const #Resolved
Frameworks/CoreGraphics/CGPattern.mm
Outdated
|
||
return generatedImage; | ||
} | ||
inline CGPatternCallbacks Callbacks() const { |
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.
This is unused. Either use it or delete IssuePatternCallback
#Resolved
@@ -58,5 +42,14 @@ CGRect _CGPatternGetFinalPatternSize(CGPatternRef pattern); | |||
*/ | |||
bool _CGPatternIsColored(CGPatternRef pattern); | |||
|
|||
COREGRAPHICS_EXPORT CGPatternRef _CGPatternCreateColorspace(void* info, |
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.
this doesn't actually take or create a color space? #Resolved
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.
@@ -450,6 +450,7 @@ LIBRARY CoreGraphics | |||
|
|||
; private exports below | |||
_CGPatternCreateFromImage | |||
_CGPatternCreateColorspace |
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.
this is only used internally, why is it exported? #Resolved
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.
actually it was in UIColor but now that's being removed. taking it out.
In reply to: 109017192 [](ancestors = 109017192)
@DHowett-MSFT @rajsesh-msft updated :) |
Frameworks/CoreGraphics/CGPattern.mm
Outdated
|
||
return ret; | ||
} | ||
static const wchar_t* TAG = L"CGPattern"; |
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.
Seems unused with LoggingNative? #Resolved
void* _info; | ||
CGRect _bounds; | ||
CGAffineTransform _transformMatrix; | ||
CGFloat _xStep; |
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.
xstep and ystep could be CGSize for simplicity. #WontFix
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.
Also removed dependency on foundation as we removed usage and removal of NSObjects.
…fines it as void *, it should be struct __CGPattern*
…o better manage it's life time
e0f2870
to
fa7f2ec
Compare
Awaiting ARM test verification. |
fixes #2353