Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Skia and Skija, Skiko [ja]
Search
Daichi Furiya (Wasabeef)
December 21, 2020
Programming
2.1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Skia and Skija, Skiko [ja]
Daichi Furiya (Wasabeef)
December 21, 2020
More Decks by Daichi Furiya (Wasabeef)
See All by Daichi Furiya (Wasabeef)
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
6
2.9k
About Flutter Architecture
wasabeef
1
340
2023 Flutter/Dart Summary
wasabeef
0
140
I/O Extended 2023 - Dart と Flutter の新機能
wasabeef
0
250
I/O Extended 2023 - Flutter 活用事例
wasabeef
10
3.1k
What it Takes to be a Flutter Developer
wasabeef
0
270
FlutterKaigi 2022 Keynote
wasabeef
1
760
Flutter Hooks を使ったアプリ開発 / App Development with the Flutter Hooks
wasabeef
2
1.6k
Flutter 2021 の振り返りと今後のアプリ開発に向けて / Looking back on Flutter 2021 and for future app development.
wasabeef
4
2.3k
Other Decks in Programming
See All in Programming
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
7
5.1k
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
170
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
140
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.6k
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2.3k
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
100
巨大モノリシックアプリ モダン化大作戦
ktcryomm
1
1.2k
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
290
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
340
App Intentsのビルドプロセスを支える技術
kntkymt
0
470
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
142
7.7k
Automating Front-end Workflow
addyosmani
1369
210k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
510
The Language of Interfaces
destraynor
162
27k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
76k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
340
Game over? The fight for quality and originality in the time of robots
wayneb77
1
290
エンジニアに許された特別な時間の終わり
watany
109
250k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Utilizing Notion as your number one productivity tool
mfonobong
4
600
Transcript
Skia and Skija, Skiko Daichi Furiya #ca_flutter_kmm
About me Daichi Furiya (降矢 大地) Google Developers Expert CyberAgent,
Inc. @wasabeef_jp wasabeef
None
None
Skia? • グラフィックライブラリ(エンジン) • Chrome, Android, Flutter, Firefox, .NET, Compose
for Desktop などで採用されている • Android 9 以降、デフォルトのレンダラーは Skia に なっている(8 と 9 で UI が変わった)
Supported platforms •Windows 7, 8, 8.1, 10 •macOS 10.10.5 or
later •iOS 8 or later •Android 4.1 (JellyBean) or later •Ubuntu 14.04+, Debian 8+, openSUSE 13.3+, or Fedora Linux 24+
Case: Skia + Flutter
Showcase Shapes ベジェ曲線 平行移動と回転 テキストレンダリング シェーダー パス
SkCanvas + SkPaint sample void draw(SkCanvas* canvas) { SkPaint p;
p.setColor(SK_ColorRED); p.setAntiAlias(true); p.setStyle(SkPaint:::kStroke_Style); p.setStrokeWidth(150); canvas->-drawLine(75, 75, 175, 175, p); } Android 寄りだけど、よくある Canvas API
SkCanvas - Backends •Raster - CPU-only. •GPU - Skia's GPU-accelerated
backend. •SkPDF - PDF document creation. •SkPicture - Skia's display list format. •NullCanvas - Useful for testing only. •SkXPS - Experimental XPS backend. •SkSVG - Experimental SVG backend. SkCanvas には複数のバックエンドが用意されている
GPU GPU には Skia のビルド時に Webkit/Canvas、 OpenGL、OpenGL ES、Vulkan、Metal などのモード を選択することができる。
Skia のメリット •コード量の削減(例:LibreOffice は 12k → 4k) •一貫性のある API •クロスプラットフォームの対応
•複数のバックエンドサポート Webkit/Canvas、OpenGL (ES)、Vulkan、Metal
Flutter Web でのデメリット •Webkit/Canvas でテキストを描画しているので、文 字列の選択などができない
Compose for Desktop
Compose for Desktop
Desktop アプリを作るということどういうことか 前提:クロスプラットフォーム パフォーマンスが高くない WASM は高速だが、JS + DOM はJVM よりもはるかに低速
• JVM はパフォーマンスは高い が、AWT、Swing、JavaFX はメ モリ割り当てしすぎないように気 をつけないといけない。 • OpenGL は難しい
Compose for Desktop fun main() { overrideSchedulers(main = Dispatchers.Main:::asScheduler) val
lifecycle = LifecycleRegistry() lifecycle.resume() Window("Todo") { Surface(modifier = Modifier.fillMaxSize()) { MaterialTheme { DesktopTheme { Text(“Hello World!!!”) } } } } } ほぼ Jetpack Compose になっている
None
Skija • JetBrains 開発 • Skia for Java (Java bindings
to Skia) • Graphics2D、GraphicsContext は古い • 最新の Typography 対応 • Vulkan* や Metal 対応
Skija が目指すところ • 自動でメモリ管理、リークなし • Java のコードスタイルに準拠 • Integer constants
よりも enum • Fluent API • Skija から ネイティブ Skia を感じさせない設計
Skija - build.gradle repositories { maven { url 'https:///packages.jetbrains.team/maven/p/skija/maven' }
} dependencies { /// macOS, windows, linux api “org.jetbrains.skija:skija-${platform}:0.1.+” } ↑ 各 OS 毎に Artifacts が分かれているのでビルド時に切り替えて使う
Skiko
Skiko? • JetBrains 開発 • Skia for Kotlin (Kotlin MP
bindings to Skia)
Skiko - build.gradle repositories { maven { url 'https:///packages.jetbrains.team/maven/p/ui/dev' }
} dependencies { /// macOS, windows, linux implementation “org.jetbrains.skiko:skiko-jvm-runtime-${platform}:0.1.+” } ↑ 各 OS 毎に Artifacts が分かれているのでビルド時に切り替えて使う
Skiko - App.kt fun main(args: Array<String>) { SkiaWindow().apply { layer.renderer
= Renderer { renderer, w, h ->- val canvas = renderer.canvas!!! val paint1 = Paint().setColor(0xffff0000.toInt()) /// ARGB canvas.drawRRect(RRect.makeLTRB(10f, 10f, w - 10f, h - 10f, 5f), paint1) val paint2 = Paint().setColor(0xff00ff00.toInt()) /// ARGB canvas.drawRRect(RRect.makeLTRB(30f, 30f, w - 30f, h - 30f, 10f), paint2) } setVisible(true) setSize(800, 600) } } SkiaWindow が UI のコンテナ になるので、その上で描画する
Skiko - SkiaLayer open class SkiaWindow : JFrame() { val
layer = SkiaLayer() init { contentPane.add(layer) addComponentListener(object : ComponentAdapter() { override fun componentResized(e: ComponentEvent) { layer.reinit() } }) } fun display() = layer.display() } javax.swing.JFrame を実装して SkiaLayer を渡しているだけ
Skiko - SkiaLayer open class SkiaLayer() : HardwareLayer() { open
val api: GraphicsApi = GraphicsApi.OPENGL /// ..... override fun draw() { if (!inited) { if (skijaState.context === null) { skijaState.context = when (api) { GraphicsApi.OPENGL ->- makeGLContext() GraphicsApi.METAL ->- makeMetalContext() else ->- TODO("Unsupported yet") } } renderer??.onInit() inited = true renderer??.onReshape(width, height) } initSkija() /// ..... } /// ..... } HardwareLayer はただの awt.Canvas で api: GraphicApi でコンテキストを変えている。 Skija が Vulkan の対応はまだ追いついていない 実際に draw している先は Skija Canvas。 ここから Skija の世界へ。
CanvasKit
CanvasKit • Skia for WebAssembly • WebGL のサポート
CanvasKit + Skottie • Lottie Animation Support
SkiaSharp
SkiaSharp .NET Standard 1.3 .NET Core Tizen Xamarin.Android Xamarin.iOS Xamarin.tvOS
Xamarin.watchOS Xamarin.Mac Windows Classic Desktop(Windows.Forms / WPF) Windows UWP (Desktop / Mobile / Xbox / HoloLens) Web Assembly (WASM) • Microsoft 開発
None
Kotlin MP App Skiko Skija Flutter App Flutter engine •
Android • iOS • Windows • macOS • Linux Skia • Android • Windows • macOS • Linux Skia • iOS?
twitter.com/wasabeef_jp wasabeef.jp github.com/wasabeef Thanks