-
Notifications
You must be signed in to change notification settings - Fork 123
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
update to skia m126 #969
update to skia m126 #969
Conversation
c66d97d
to
9cbf641
Compare
The tests passed. |
#include "ganesh/mtl/GrMtlBackendContext.h" | ||
#include "ganesh/mtl/GrMtlDirectContext.h" | ||
#include "ganesh/mtl/GrMtlBackendSurface.h" | ||
#include "ganesh/mtl/GrMtlTypes.h" |
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.
TODO for later: try to switch from Ganesh to Graphite
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.
Is it up to us?
I mean we should use what skia provides, no?
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.
Skia provides a few render backends. Yes, it's up to us what to use
@@ -10,8 +10,9 @@ | |||
|
|||
#import <GrBackendSurface.h> | |||
#import <GrDirectContext.h> | |||
#import <mtl/GrMtlBackendContext.h> | |||
#import <mtl/GrMtlTypes.h> | |||
#include "ganesh/mtl/GrMtlBackendContext.h" |
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.
Please align header importing style
<>
- for system and library headers
""
- for local files, sometimes does recursive search
#include
- C++ one
#import
- Objective-C 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.
fixed
@@ -25,7 +31,8 @@ extern "C" JNIEXPORT jlong JNICALL Java_org_jetbrains_skia_BackendRenderTargetKt | |||
GrMTLHandle texture = reinterpret_cast<GrMTLHandle>(static_cast<uintptr_t>(texturePtr)); | |||
GrMtlTextureInfo fbInfo; | |||
fbInfo.fTexture.retain(texture); | |||
GrBackendRenderTarget* instance = new GrBackendRenderTarget(width, height, fbInfo); | |||
GrBackendRenderTarget obj = GrBackendRenderTargets::MakeMtl(width, height, fbInfo); | |||
auto instance = new GrBackendRenderTarget(obj); |
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.
Inconsistent auto
usage. I'm ok to use it, but it's better to align the approach because now it uses both ways in similar situations
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.
fixed. Using explicit types in this PR now.
} | ||
|
||
SKIKO_EXPORT KNativePointer org_jetbrains_skia_shaper_Shaper__1nMakeCoreText() { | ||
#ifdef SK_SHAPER_CORETEXT_AVAILABLE | ||
return reinterpret_cast<KNativePointer>(SkShaper::MakeCoreText().release()); | ||
return nullptr; | ||
// TODO: build skia with `skia_use_fonthost_mac=true` to have SkShaper::MakeCoreText |
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.
Isn't it a regression?
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.
skia_use_fonthost_mac
used to be not needed. So the compilation error was noticed only after skia was built (>3h).
The method was not used anywhere, so I added a TODO in case someone has an issue with it.
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.
nvm, I'll rebuild skia. We postponed alpha03 and we have time now.
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.
Fixed
8a6f7bd
to
9102e5b
Compare
Published skiko 0.8.11 with the above suggestions/improvements/fixes. |
It's based on skia m126 Skiko update PR: JetBrains/skiko#969 ## Testing <!-- Optional --> - The demo runs on all platforms - The tests passed <!-- Optional --> This should be tested by QA ## Release Notes ### Highlights - Multiple Platforms - Skiko version was updated to 0.8.11 (It is based on skia m126 release)
It's based on skia m126 Skiko update PR: JetBrains/skiko#969 ## Testing <!-- Optional --> - The demo runs on all platforms - The tests passed <!-- Optional --> This should be tested by QA ## Release Notes ### Highlights - Multiple Platforms - Skiko version was updated to 0.8.11 (It is based on skia m126 release)
@@ -84,7 +93,7 @@ extern "C" JNIEXPORT jlong JNICALL Java_org_jetbrains_skia_shaper_ShaperKt__1nSh | |||
text.c_str(), | |||
text.size(), | |||
*font, | |||
SkFontMgr::RefDefault(), | |||
SkFontMgrSkikoDefault(), |
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.
I've noticed that this call might be quite costly. And it's performed on every TextLine.make
which makes every call last for ~15ms even for short strings.
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.
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.
@eymar wdyt should we cache the fontMgr
here? Other option may be just getting rid of this Shaper
API.
Skia-pack used in this skiko: https://github.com/JetBrains/skia-pack/releases/tag/m126-1d69d9b-1