Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Implementation of CGPattern via runtime base#2374

Merged
msft-Jeyaram merged 4 commits into
microsoft:developfrom
msft-Jeyaram:CGPattern_CPPBased_29_3
Mar 31, 2017
Merged

Implementation of CGPattern via runtime base#2374
msft-Jeyaram merged 4 commits into
microsoft:developfrom
msft-Jeyaram:CGPattern_CPPBased_29_3

Conversation

@msft-Jeyaram

Copy link
Copy Markdown

fixes #2353

Comment thread Frameworks/UIKit/UIColor.mm Outdated
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);

@rajsesh rajsesh Mar 30, 2017

Copy link
Copy Markdown
Contributor

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

Comment thread Frameworks/UIKit/UIColor.mm Outdated
@@ -224,7 +224,7 @@ @implementation UIColor {
@public
enum BrushType _type;
UIImage* _image;

@rajsesh rajsesh Mar 30, 2017

Copy link
Copy Markdown
Contributor

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

Comment thread Frameworks/CoreGraphics/CGPattern.mm Outdated
- (void)dealloc {
if (generatedImage) {
CGImageRelease(generatedImage);
inline CGAffineTransform TransformMatrix() const {

@rajsesh rajsesh Mar 30, 2017

Copy link
Copy Markdown
Contributor

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

Comment thread Frameworks/CoreGraphics/CGPattern.mm Outdated

if (generatedImage) {
CGImageRelease(generatedImage);
inline CGRect Bounds() const {

@rajsesh rajsesh Mar 30, 2017

Copy link
Copy Markdown
Contributor

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

Comment thread Frameworks/CoreGraphics/CGPattern.mm Outdated
} else {
bitmapInfo = kCGImageAlphaNone;
colorSpace = CGColorSpaceCreateDeviceGray();
inline CGAffineTransform PatternTransform() {

@rajsesh rajsesh Mar 30, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: GetPatternTransform() const #Resolved

Comment thread Frameworks/CoreGraphics/CGPattern.mm Outdated

return generatedImage;
}
inline CGPatternCallbacks Callbacks() const {

@DHowett-MSFT DHowett-MSFT Mar 30, 2017

Copy link
Copy Markdown

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

Comment thread Frameworks/include/CGPatternInternal.h Outdated
*/
bool _CGPatternIsColored(CGPatternRef pattern);

COREGRAPHICS_EXPORT CGPatternRef _CGPatternCreateColorspace(void* info,

@DHowett-MSFT DHowett-MSFT Mar 30, 2017

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer needed.


In reply to: 109017103 [](ancestors = 109017103)

Comment thread build/CoreGraphics/dll/CoreGraphics.def Outdated

; private exports below
_CGPatternCreateFromImage
_CGPatternCreateColorspace

@DHowett-MSFT DHowett-MSFT Mar 30, 2017

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Author

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)

@msft-Jeyaram

Copy link
Copy Markdown
Author

@DHowett-MSFT @rajsesh-msft updated :)

Comment thread Frameworks/CoreGraphics/CGPattern.mm Outdated

return ret;
}
static const wchar_t* TAG = L"CGPattern";

@MSFTFox MSFTFox Mar 30, 2017

Copy link
Copy Markdown
Member

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;

@MSFTFox MSFTFox Mar 30, 2017

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's much more implicit this way.


In reply to: 109041128 [](ancestors = 109041128)

Jeyaram Jeyaraj added 4 commits March 31, 2017 08:42
Also removed dependency on foundation as we removed usage and removal of  NSObjects.
…fines it as void *,

it should be struct __CGPattern*
@msft-Jeyaram msft-Jeyaram force-pushed the CGPattern_CPPBased_29_3 branch from e0f2870 to fa7f2ec Compare March 31, 2017 16:16
@msft-Jeyaram

Copy link
Copy Markdown
Author

Awaiting ARM test verification.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Foundation Dependency Removal] CGPattern should be implemented via CFRuntimeBase

5 participants