Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[coretext] Update for Xcode 11 beta 1-3#6562

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
spouliot merged 3 commits intodotnet:xcode11fromspouliot:xcode11-coretext-b1-3
Jul 15, 2019

Conversation

@spouliot
Copy link
Contributor

includes unit tests

@spouliotspouliot added this to thexcode11 milestoneJul 11, 2019
@spouliotspouliot added the enhancementThe issue or pull request is an enhancement labelJul 11, 2019
@monojenkins
Copy link
Collaborator

Build failure
Build succeeded
API Diff (from stable)
⚠️API Diff (from PR only) (🔥 breaking changes 🔥)
ℹ️Generator Diff (please review changes)
🔥Test run failed 🔥

Test results

14 tests failed, 77 tests passed.

Failed tests

  • xammac tests/Mac Modern/Debug: Failed (Test run failed.)
  • xammac tests/Mac Modern/Release: Failed (Test run failed.)
  • xammac tests/Mac Modern/Release: Failed (Test run failed.)
  • Xtro/Mac: Failed (Test run failed.)
  • monotouch-test/iOS Unified 32-bits - simulator/Debug: Failed
  • monotouch-test/iOS Unified 32-bits - simulator/Debug (static registrar): Failed
  • monotouch-test/iOS Unified 32-bits - simulator/Release (all optimizations): Failed
  • monotouch-test/iOS Unified 64-bits - simulator/Release (all optimizations): Failed
  • monotouch-test/tvOS - simulator/Debug: TimedOut
  • monotouch-test/tvOS - simulator/Debug (static registrar): TimedOut
  • monotouch-test/tvOS - simulator/Release (all optimizations): TimedOut
  • monotouch-test/watchOS 32-bits - simulator/Debug: Crashed
  • monotouch-test/watchOS 32-bits - simulator/Debug (static registrar): Crashed
  • monotouch-test/watchOS 32-bits - simulator/Release (all optimizations): Crashed

vardescriptor=(BlockLiteral*)block;
vardel=(CTFontManagerRequestFontsHandler)(descriptor->Target);
if(del!=null)
del(NSArray.ArrayFromHandle<CTFontDescriptor>(fontDescriptors));
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we would like to clean (release) theCTFontDescriptors individually after callingdel with them, at least it is not aCMSampleBuffer [] :P

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

code can keep reference to them, e.g in fields
CMSampleBuffer is not a good example and requires extra care from callers (no nice way to handle it)

dalexsoto reacted with thumbs up emoji
staticexternunsafevoidCTFontManagerRegisterFontURLs(/* CFArrayRef */IntPtrfontUrls,CTFontManagerScopescope,boolenabled,void*registrationHandler);

[Watch(6,0),TV(13,0),Mac(10,15,onlyOn64:true),iOS(13,0)]
publicstaticvoidRegisterFonts(NSUrl[]fontUrls,CTFontManagerScopescope,boolenabled,CTFontRegistrationHandlerregistrationHandler)
Copy link
Member

Choose a reason for hiding this comment

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

The block code can be simplified somewhat with this pattern:https://github.com/xamarin/xamarin-macios/blob/c99ad292b2e357f4f2acb083e03281a323da44a2/src/CoreFoundation/DispatchIO.cs#L56-L84

Here it would become something like this:

[MonoPInvokeCallback(typeof(InnerRegistrationHandler))]staticboolTrampolineRegistrationHandler(IntPtrblock,/* NSArray */IntPtrerrors,booldone){vardel=BlockLiteral.GetTarget<CTFontRegistrationHandler>(block);returndel!=null?del(NSArray.ArrayFromHandle<NSError>(errors),done):true;}[Watch(6,0),TV(13,0),Mac(10,15,onlyOn64:true),iOS(13,0)][DllImport(Constants.CoreTextLibrary)]staticexternvoidCTFontManagerRegisterFontURLs(/* CFArrayRef */IntPtrfontUrls,CTFontManagerScopescope,boolenabled,refBlockLiteralregistrationHandler);[Watch(6,0),TV(13,0),Mac(10,15,onlyOn64:true),iOS(13,0)]publicstaticvoidRegisterFonts(NSUrl[]fontUrls,CTFontManagerScopescope,boolenabled,CTFontRegistrationHandlerregistrationHandler){using(vararr=EnsureNonNullArray(fontUrls,nameof(fontUrls))){if(registrationHandler==null){CTFontManagerRegisterFontURLs(arr.Handle,scope,enabled,null);return;}BlockLiteralblock_handler=newBlockLiteral();block_handler.SetupBlockUnsafe(callback,registrationHandler);CTFontManagerRegisterFontURLs(arr.Handle,scope,enabled,refblock_handler);block_ptr.CleanupBlock();}}

No unsafe code needed, and it's shorter, so easier to review and fewer lines to make mistakes in.

spouliot reacted with thumbs up emoji
}
finally{
// Copy/Create rule - we must release the CFArrayRef
CFObject.CFRelease(p);
Copy link
Member

Choose a reason for hiding this comment

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

IIRC this will crash ifp is IntPtr.Zero.

spouliot reacted with thumbs up emoji
if(p==IntPtr.Zero)
returnnull;
// Copy/Create rule - dont't retain it inside the .ctor
returnnewCTFontDescriptor(p,owns:false);
Copy link
Member

Choose a reason for hiding this comment

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

If you don't want to retain it inside the .ctor, you must passowns: true

spouliot reacted with thumbs up emoji
}
finally{
// Copy/Create rule - we must release the CFArrayRef
CFObject.CFRelease(p);
Copy link
Member

Choose a reason for hiding this comment

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

Crash ifp == IntPtr.Zero.

spouliot reacted with thumbs up emoji
@monojenkins
Copy link
Collaborator

Build failure
Build succeeded
API Diff (from stable)
⚠️API Diff (from PR only) (🔥 breaking changes 🔥)
ℹ️Generator Diff (please review changes)
🔥Test run failed 🔥

Test results

9 tests failed, 82 tests passed.

Failed tests

  • xammac tests/Mac Modern/Debug: Failed (Test run failed.)
  • xammac tests/Mac Modern/Release: Failed (Test run failed.)
  • xammac tests/Mac Modern/Release: Failed (Test run failed.)
  • monotouch-test/tvOS - simulator/Debug: TimedOut
  • monotouch-test/tvOS - simulator/Debug (static registrar): TimedOut
  • monotouch-test/tvOS - simulator/Release (all optimizations): TimedOut
  • monotouch-test/watchOS 32-bits - simulator/Debug: Crashed
  • monotouch-test/watchOS 32-bits - simulator/Debug (static registrar): Crashed
  • monotouch-test/watchOS 32-bits - simulator/Release (all optimizations): Crashed

<ContentInclude="..\monotouch-test\Resources\fragmentShader.metal">
<Link>Resources\fragmentShader.metal</Link>
</Content>
<ContentInclude="..\monotouch-test\Pacifico.ttf">
Copy link
Member

Choose a reason for hiding this comment

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

These two files are already in the csproj, so this looks redundant.

spouliot reacted with thumbs up emoji
- some (old) differences on macOS where not tested properly- tvOS and watchOS crash/hangs with `CTFontManagerRegisterFontDescriptors` (works on iOS)```The operation couldn’t be completed. (com.apple.CoreText.CTFontManagerErrorDomain error 500.```
@monojenkins
Copy link
Collaborator

Build success
Build succeeded
API Diff (from stable)
⚠️API Diff (from PR only) (🔥 breaking changes 🔥)
ℹ️Generator Diff (please review changes)
Test run succeeded

@spouliotspouliot merged commite6e4283 intodotnet:xcode11Jul 15, 2019
@spouliotspouliot deleted the xcode11-coretext-b1-3 branchJuly 15, 2019 17:07
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dalexsotodalexsotodalexsoto approved these changes

@rolfbjarnerolfbjarnerolfbjarne approved these changes

@VincentDondainVincentDondainAwaiting requested review from VincentDondain

Assignees

No one assigned

Labels

enhancementThe issue or pull request is an enhancement

Projects

None yet

Milestone

xcode11

Development

Successfully merging this pull request may close these issues.

4 participants

@spouliot@monojenkins@dalexsoto@rolfbjarne

[8]ページ先頭

©2009-2025 Movatter.jp