SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
Pablo Tesone
Martín Dias
Bloc for
Current State and Future Perspective
ESUG 2022 - Novi Sad
Consortium
What is Bloc?
a low-level UI
infrastructure &
framework for Pharo
geometry

(polygon)
a BlElement
background
border
transformation

(a matrix with

skew and translation)
Element's visual properties
Element's outskirts
aBlElement


outskirts:


BlOutskirts outside
aBlElement


outskirts:


BlOutskirts centered
aBlElement


outskirts:


BlOutskirts inside
Border's cap
vertices := { 50@150. 150@50}.


referenceLine := (BlPolylineGeometry vertices: vertices) asElement.


capLine := (BlPolylineGeometry vertices: vertices) asElement.


capLine border: (BlBorder builder


	
	
	
	
paint: Color pink;


	
	
	
	
width: 50;


	
	
	
	
lineCap: BlStrokeLineCap round;


	
	
	
	
build)
Border's join
elementA := BlElement new
size: 100 @ 100;
background: Color red;
relocate: 100 @ 100;
clipChildren: false;
yourself.
elementB := BlElement new
size: 100 @ 100;
background: Color green;
relocate: 50 @ 50;
clipChildren: true;
yourself.
elementA addChild: elementB.
elementC := BlElement new
size: 100 @ 100;
background: Color blue;
relocate: 50 @ 50;
yourself.
elementB addChild: elementC.
BlSpace new
addChild: elementA;
show
Elements Tree
& Clipping
clipped
Space and Host
SPACE = "window"

SPACE has a HOST

HOST provides a loop: 

- events (e.g. mouse move)

- layout elements

- draw elements

- etc
Morphic
Options:
SDL2
Canvas
INPUT: a tree of BlElements

OUTPUT: pixels
Sparta Sparta Alexandrie
Bloc options:
Element's layout & constraints
The layout of an Element
can determine the position
and size of its children.

See in next demo!
A clean library that may be included in Pharo

• Make it easier to understand

• Have a clear maintenance process

Our code retro
fi
ts a part of the development made by feenk
Bloc for Pharo
Objectives
Host & Canvas - Current Direction
Stay with simple FFI bindings to C libraries
• Works on all Pharo's platforms

• GPU acceleration

• Active gamer community

• Stable. Active gnome community (it's the way to
draw custom widgets in gtk 3 and 4).

• Not GPU-optimized but we can use bu
ff
ering, layer
composition and other techniques to mitigate.
We chose Cairo...


but Sparta-Cairo?
Sparta Sparta
25
frame/s
Boids Example: Bird Flock Simulation
5
frame/s!
Sparta
10.4k


FFI calls / frame
Sparta
5.6k


FFI calls / frame
200
boids x 200
=
vs.
Few and simple
geometries but

the whole surface is 

updated on each
frame
Too
Much?
Sparta Sparta
O(n)
stops here
change color


6 times per boid
new path


5 times per boid
Sparta Alexandrie
Call the C API smartly

Avoid redundant calls

Start by rendering Bloc elements faster,
then look for abstract API
Bloc + Alexandrie v1.0
• Support for most features of Sparta-Cairo, but fast.

• Doesn't depend on SurfacePlugin, like Sparta-Cairo,
unlike Athens-Cairo

• Bloc v1.0 comes with Alexandrie, plus Sparta-Cairo and
Sparta-Skia. 

• Check it: https://github.com/pharo-graphics/Bloc
Bloc + Alexandrie Next
• Optimize transformations (this is Bloc level)

• Cache more Cairo objects

• Layer composition and Bu
ff
er unchanged elements

• E
ff
ects (blur, shadow)

• Bug in SVG path geometry

• Clear API (still not stable)
Performance
10.4k


calls/frame
3k


calls/frame
Sparta Alexandrie
Can be
better, but
1/3 is good!
Sparta Sparta Alexandrie
30

frame/s
5

frame/s
25

frame/s
Still poor: Users need at least 60 FPS,
but this is one step. ?
About GPU
Explore last generation techniques (e.g. Chrome's RenderingNG,
Firefox's WebRender, GTK4) with SDL and Cairo:

• Layer composition

• bu
ff
er elements in GPU textures / tiles

• composite layers in GPU

• GPU rastering

• take advantage of GPU

• avoid bottleneck of transferring from CPU to GPU memory

• Dedicated thread to render and animate elements
Canvas FPS
Bloc Skia 18.3
Bloc Cairo 12.5
Bloc Alexandrie 40.3
Experimental (SDL2+Cairo)* 187.7 (Example based on "Box Windmill"

by Milton Mamani in RS3)
• 1600x1600 pixels to update
on every frame

• Elements only update their
transformation matrix

=> Having the elements in a
texture and operate with GPU
makes a good di
ff
erence
*: SDL2 w/OpenGL Renderer, on a MacbookPro 2018
FFI Call Logger
Monitor calls, live! https://github.com/tinchodias/FFICallLogger
Copy of the stack that
performed the selected call
Recorded calls

(in a circular collection)
Call
fi
lters
Plans as a User of Bloc
• Spec backend

• Create Examples

• Microdown editor

• Small game
Discord: Pharo server / #bloc channel

Mailing-list: lse-bloc@inria.fr 

Bloc Core: https://github.com/pharo-graphics/Bloc

Bloc Tutorial: https://github.com/pharo-graphics/Tutorials

Bloc Dev Ecosystem: https://github.com/pharo-graphics/
BlocBenchs
Bloc for Pharo
Consortium

Contenu connexe

Tendances

PharoJS: Pharo-Based TDD for Javascript Applications
PharoJS: Pharo-Based TDD for Javascript ApplicationsPharoJS: Pharo-Based TDD for Javascript Applications
PharoJS: Pharo-Based TDD for Javascript Applications
ESUG
 

Tendances (20)

PharoJS: Pharo-Based TDD for Javascript Applications
PharoJS: Pharo-Based TDD for Javascript ApplicationsPharoJS: Pharo-Based TDD for Javascript Applications
PharoJS: Pharo-Based TDD for Javascript Applications
 
re:mobidyc the overview
re:mobidyc the overviewre:mobidyc the overview
re:mobidyc the overview
 
Towards Object-centric Time-traveling Debuggers
 Towards Object-centric Time-traveling Debuggers Towards Object-centric Time-traveling Debuggers
Towards Object-centric Time-traveling Debuggers
 
Pharo foreign function interface (FFI) by example by Esteban Lorenzano
Pharo foreign function interface (FFI) by example by Esteban LorenzanoPharo foreign function interface (FFI) by example by Esteban Lorenzano
Pharo foreign function interface (FFI) by example by Esteban Lorenzano
 
Pharo 11: A stabilization release
Pharo 11: A stabilization releasePharo 11: A stabilization release
Pharo 11: A stabilization release
 
Lecture: Advanced Reflection. MetaLinks
Lecture: Advanced Reflection. MetaLinksLecture: Advanced Reflection. MetaLinks
Lecture: Advanced Reflection. MetaLinks
 
SonarQube - Should I Stay or Should I Go ?
SonarQube - Should I Stay or Should I Go ? SonarQube - Should I Stay or Should I Go ?
SonarQube - Should I Stay or Should I Go ?
 
Git vs SVN
Git vs SVNGit vs SVN
Git vs SVN
 
GemStone Update 2023
GemStone Update 2023GemStone Update 2023
GemStone Update 2023
 
Gitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement ContinueGitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement Continue
 
[C++ Korea] Effective Modern C++ Study, Item 11 - 13
[C++ Korea] Effective Modern C++ Study, Item 11 - 13[C++ Korea] Effective Modern C++ Study, Item 11 - 13
[C++ Korea] Effective Modern C++ Study, Item 11 - 13
 
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng NghĩaTech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
 
SonarQube
SonarQubeSonarQube
SonarQube
 
Python testing using mock and pytest
Python testing using mock and pytestPython testing using mock and pytest
Python testing using mock and pytest
 
The Evolution of Scala
The Evolution of ScalaThe Evolution of Scala
The Evolution of Scala
 
Clean Code
Clean CodeClean Code
Clean Code
 
Capabilities for Resources and Effects
Capabilities for Resources and EffectsCapabilities for Resources and Effects
Capabilities for Resources and Effects
 
CNIT 127: L9: Web Templates and .NET
CNIT 127: L9: Web Templates and .NETCNIT 127: L9: Web Templates and .NET
CNIT 127: L9: Web Templates and .NET
 
Effective CMake
Effective CMakeEffective CMake
Effective CMake
 
Janus workshop @ RTC2019 Beijing
Janus workshop @ RTC2019 BeijingJanus workshop @ RTC2019 Beijing
Janus workshop @ RTC2019 Beijing
 

Similaire à Bloc for Pharo: Current State and Future Perspective

Fortran & Link with Library & Brief Explanation of MKL BLAS
Fortran & Link with Library & Brief Explanation of MKL BLASFortran & Link with Library & Brief Explanation of MKL BLAS
Fortran & Link with Library & Brief Explanation of MKL BLAS
Jongsu "Liam" Kim
 
RailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMsRailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMs
Lourens Naudé
 

Similaire à Bloc for Pharo: Current State and Future Perspective (20)

News on Bloc for Pharo
News on Bloc for PharoNews on Bloc for Pharo
News on Bloc for Pharo
 
CSS and CSS3
CSS and CSS3CSS and CSS3
CSS and CSS3
 
Building a High-Performance Database with Scala, Akka, and Spark
Building a High-Performance Database with Scala, Akka, and SparkBuilding a High-Performance Database with Scala, Akka, and Spark
Building a High-Performance Database with Scala, Akka, and Spark
 
CSS 3 Overview
CSS 3 OverviewCSS 3 Overview
CSS 3 Overview
 
Inspecting Block Closures To Generate Shaders for GPU Execution
Inspecting Block Closures To Generate Shaders for GPU ExecutionInspecting Block Closures To Generate Shaders for GPU Execution
Inspecting Block Closures To Generate Shaders for GPU Execution
 
Fortran & Link with Library & Brief Explanation of MKL BLAS
Fortran & Link with Library & Brief Explanation of MKL BLASFortran & Link with Library & Brief Explanation of MKL BLAS
Fortran & Link with Library & Brief Explanation of MKL BLAS
 
Performance optimization in JS. Based on project experience, Алина Синявская ...
Performance optimization in JS. Based on project experience, Алина Синявская ...Performance optimization in JS. Based on project experience, Алина Синявская ...
Performance optimization in JS. Based on project experience, Алина Синявская ...
 
Performance optimization in JS. Based on project experience, Аліна Синявська ...
Performance optimization in JS. Based on project experience, Аліна Синявська ...Performance optimization in JS. Based on project experience, Аліна Синявська ...
Performance optimization in JS. Based on project experience, Аліна Синявська ...
 
RailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMsRailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMs
 
ECMAScript 6: A Better JavaScript for the Ambient Computing Era
ECMAScript 6: A Better JavaScript for the Ambient Computing EraECMAScript 6: A Better JavaScript for the Ambient Computing Era
ECMAScript 6: A Better JavaScript for the Ambient Computing Era
 
Let's talks about string operations in C++17
Let's talks about string operations in C++17Let's talks about string operations in C++17
Let's talks about string operations in C++17
 
GTC 2009 OpenGL Barthold
GTC 2009 OpenGL BartholdGTC 2009 OpenGL Barthold
GTC 2009 OpenGL Barthold
 
CSS 3
CSS 3CSS 3
CSS 3
 
CSS3
CSS3CSS3
CSS3
 
Scala can do this, too
Scala can do this, tooScala can do this, too
Scala can do this, too
 
The Future State of Layout
The Future State of LayoutThe Future State of Layout
The Future State of Layout
 
Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011
 
Front-end God Mode with Reagent and Figwheel
Front-end God Mode with Reagent and FigwheelFront-end God Mode with Reagent and Figwheel
Front-end God Mode with Reagent and Figwheel
 
RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014
 
Behavior driven oop
Behavior driven oopBehavior driven oop
Behavior driven oop
 

Plus de ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
ESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
ESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
ESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
ESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
ESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
ESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
ESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
ESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
ESUG
 

Plus de ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Dernier

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Dernier (20)

Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

Bloc for Pharo: Current State and Future Perspective

  • 1. Pablo Tesone Martín Dias Bloc for Current State and Future Perspective ESUG 2022 - Novi Sad Consortium
  • 2. What is Bloc? a low-level UI infrastructure & framework for Pharo
  • 3. geometry (polygon) a BlElement background border transformation (a matrix with skew and translation) Element's visual properties
  • 5. Border's cap vertices := { 50@150. 150@50}. referenceLine := (BlPolylineGeometry vertices: vertices) asElement. capLine := (BlPolylineGeometry vertices: vertices) asElement. capLine border: (BlBorder builder paint: Color pink; width: 50; lineCap: BlStrokeLineCap round; build)
  • 7. elementA := BlElement new size: 100 @ 100; background: Color red; relocate: 100 @ 100; clipChildren: false; yourself. elementB := BlElement new size: 100 @ 100; background: Color green; relocate: 50 @ 50; clipChildren: true; yourself. elementA addChild: elementB. elementC := BlElement new size: 100 @ 100; background: Color blue; relocate: 50 @ 50; yourself. elementB addChild: elementC. BlSpace new addChild: elementA; show Elements Tree & Clipping clipped
  • 8.
  • 9. Space and Host SPACE = "window" SPACE has a HOST HOST provides a loop: - events (e.g. mouse move) - layout elements - draw elements - etc Morphic Options: SDL2
  • 10. Canvas INPUT: a tree of BlElements OUTPUT: pixels Sparta Sparta Alexandrie Bloc options:
  • 11. Element's layout & constraints The layout of an Element can determine the position and size of its children. See in next demo!
  • 12.
  • 13. A clean library that may be included in Pharo • Make it easier to understand • Have a clear maintenance process Our code retro fi ts a part of the development made by feenk Bloc for Pharo Objectives
  • 14. Host & Canvas - Current Direction Stay with simple FFI bindings to C libraries • Works on all Pharo's platforms • GPU acceleration • Active gamer community • Stable. Active gnome community (it's the way to draw custom widgets in gtk 3 and 4). • Not GPU-optimized but we can use bu ff ering, layer composition and other techniques to mitigate.
  • 15. We chose Cairo... but Sparta-Cairo?
  • 16. Sparta Sparta 25 frame/s Boids Example: Bird Flock Simulation 5 frame/s!
  • 17. Sparta 10.4k FFI calls / frame Sparta 5.6k FFI calls / frame 200 boids x 200 = vs. Few and simple geometries but the whole surface is updated on each frame Too Much?
  • 18. Sparta Sparta O(n) stops here change color 6 times per boid new path 5 times per boid
  • 19. Sparta Alexandrie Call the C API smartly Avoid redundant calls Start by rendering Bloc elements faster, then look for abstract API
  • 20. Bloc + Alexandrie v1.0 • Support for most features of Sparta-Cairo, but fast. • Doesn't depend on SurfacePlugin, like Sparta-Cairo, unlike Athens-Cairo • Bloc v1.0 comes with Alexandrie, plus Sparta-Cairo and Sparta-Skia. • Check it: https://github.com/pharo-graphics/Bloc
  • 21. Bloc + Alexandrie Next • Optimize transformations (this is Bloc level) • Cache more Cairo objects • Layer composition and Bu ff er unchanged elements • E ff ects (blur, shadow) • Bug in SVG path geometry • Clear API (still not stable)
  • 22.
  • 25. Sparta Sparta Alexandrie 30 frame/s 5 frame/s 25 frame/s Still poor: Users need at least 60 FPS, but this is one step. ?
  • 26. About GPU Explore last generation techniques (e.g. Chrome's RenderingNG, Firefox's WebRender, GTK4) with SDL and Cairo: • Layer composition • bu ff er elements in GPU textures / tiles • composite layers in GPU • GPU rastering • take advantage of GPU • avoid bottleneck of transferring from CPU to GPU memory • Dedicated thread to render and animate elements
  • 27. Canvas FPS Bloc Skia 18.3 Bloc Cairo 12.5 Bloc Alexandrie 40.3 Experimental (SDL2+Cairo)* 187.7 (Example based on "Box Windmill" by Milton Mamani in RS3) • 1600x1600 pixels to update on every frame • Elements only update their transformation matrix => Having the elements in a texture and operate with GPU makes a good di ff erence *: SDL2 w/OpenGL Renderer, on a MacbookPro 2018
  • 28. FFI Call Logger Monitor calls, live! https://github.com/tinchodias/FFICallLogger Copy of the stack that performed the selected call Recorded calls (in a circular collection) Call fi lters
  • 29. Plans as a User of Bloc • Spec backend • Create Examples • Microdown editor • Small game
  • 30. Discord: Pharo server / #bloc channel Mailing-list: lse-bloc@inria.fr Bloc Core: https://github.com/pharo-graphics/Bloc Bloc Tutorial: https://github.com/pharo-graphics/Tutorials Bloc Dev Ecosystem: https://github.com/pharo-graphics/ BlocBenchs Bloc for Pharo Consortium