Add new functions to Opal#7
Conversation
In CGContext.m we had CGContextDrawShading()'s definition repeated from the header; we did not, however, have an actual stub for this function, which caused linking errors with Opal clients. This turns this still unimplemented function into an actual stub.
Add an actual implementation for CGContextAddEllipseInRect() which makes use of CGPath APIs. Implement CGContextFillEllipseInRect() and CGContextStrokeEllipseInRect() as well.
CoreGraphics posesses the private getter counterparts for some setter functions, such as antialiasing and font smoothing. This implements those getters.
Define the private CoreGraphics CGContextGetType() API, which determines the type of a CGContextRef (a bitmap context, PostScript context, PDF context etc.).
Implement the private function CGContextSetCTM(), which allows clients to set the current transformation matrix of a context.
ivucica
left a comment
There was a problem hiding this comment.
I can merge as is, but I'd really like private stuff slightly more ... distinct.
| bool CGContextPathContainsPoint(CGContextRef c, | ||
| CGPoint point, CGPathDrawingMode mode); | ||
|
|
||
| /* CoreGraphics Private APIs */ |
There was a problem hiding this comment.
Since these are not part of the public API, I propose we move them into a separate header + implementation file.
There was a problem hiding this comment.
This function gets exported by the Apple implementation as well. Having it here is fine.
There was a problem hiding this comment.
Well, I selected line 584 when I was creating the commit, not my fault that GitHub has... flaws. 😄
I was referring to all the APIs below that were marked as private. I did not check any to be private except CGContextSetCTM()
|
|
||
| CGContextType CGContextGetType(CGContextRef ctx); | ||
|
|
||
| void CGContextSetCTM(CGContextRef ctx, CGAffineTransform m); |
There was a problem hiding this comment.
The last two are the one functions I cannot find in the Apple header, these should be moved away.
There was a problem hiding this comment.
Out of these, it looks like only CGContextGetShouldAntialias() is public.
| }; | ||
| typedef int CGTextEncoding; | ||
|
|
||
| // NOTE: This `typedef enum` in opposition to defining enum constants and |
There was a problem hiding this comment.
Where did you find these values? As WebKit has its own definitions of these values we should kept them private within Opal.
fredkiefer
left a comment
There was a problem hiding this comment.
I agree with Ivan that we should keep the private functions and types within Opal and not export them. Please changes this and the code could be merged from my side.
Create stubs for yet unimplemented private CoreGraphics functions, for increased compatibility with CG.
Create a stub for the private function CGFontGetGlyphAdvancesForStyle for increased compatibility.
Add private constant and function stubs for CGImageSource for increased compatibility.
Add stubs for some private functions and constants in CTFont for compatibility purposes.
Create a stub for the CTFontDescriptorIsSystemUIFont() private function for increased compatibility.
Add a stub for the CTLineCreateWithUniCharProvider() private function for increased compatibility purposes.
Add stubs for private functions in CTRun for increased compatibility.
…tions() Add stub for CTTypesetterCreateWithUniCharProviderAndOptions(), a private function, for increased compatibility.
|
Please move all the private functions out of the public headers. Otherwise we won't be able to merge this. |
|
Will there be more progress on this? :) @theiostream |
|
@ivucica I suggest we just merge this pull request. I am not totally happy with it, but there won't be any future progress and at least there isn't anything fundamentally wrong in this code. |
|
Marking this as something to review one of the evenings this week. I see the old comments about not making some internal API public, and we should at least do that when merging, otherwise we'll never do it. |
Add some new functions to Opal which are required by WebKit.
This change is