SlideShare a Scribd company logo
1 of 30
Download to read offline
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

More Related Content

What's hot

Applications in Pharo
Applications in PharoApplications in Pharo
Applications in PharoESUG
 
GemStone Update
GemStone Update GemStone Update
GemStone Update ESUG
 
How Fast is AI in Pharo? Benchmarking Linear Regression
How Fast is AI in Pharo? Benchmarking Linear RegressionHow Fast is AI in Pharo? Benchmarking Linear Regression
How Fast is AI in Pharo? Benchmarking Linear RegressionESUG
 
PharoJS: Hijack the JavaScript Ecosystem
PharoJS: Hijack the JavaScript EcosystemPharoJS: Hijack the JavaScript Ecosystem
PharoJS: Hijack the JavaScript EcosystemESUG
 
Dive into Fluentd plugin v0.12
Dive into Fluentd plugin v0.12Dive into Fluentd plugin v0.12
Dive into Fluentd plugin v0.12N Masahiro
 
Introduction to GitHub
Introduction to GitHubIntroduction to GitHub
Introduction to GitHubNishan Bose
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHubVikram SV
 
Music With Pharo
Music With PharoMusic With Pharo
Music With PharoESUG
 
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 LorenzanoFAST
 
Intro to the Alfresco Public API
Intro to the Alfresco Public APIIntro to the Alfresco Public API
Intro to the Alfresco Public APIJeff Potts
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction TutorialThomas Rausch
 

What's hot (20)

Applications in Pharo
Applications in PharoApplications in Pharo
Applications in Pharo
 
GemStone Update
GemStone Update GemStone Update
GemStone Update
 
How Fast is AI in Pharo? Benchmarking Linear Regression
How Fast is AI in Pharo? Benchmarking Linear RegressionHow Fast is AI in Pharo? Benchmarking Linear Regression
How Fast is AI in Pharo? Benchmarking Linear Regression
 
Git basics
Git basicsGit basics
Git basics
 
PharoJS: Hijack the JavaScript Ecosystem
PharoJS: Hijack the JavaScript EcosystemPharoJS: Hijack the JavaScript Ecosystem
PharoJS: Hijack the JavaScript Ecosystem
 
Dive into Fluentd plugin v0.12
Dive into Fluentd plugin v0.12Dive into Fluentd plugin v0.12
Dive into Fluentd plugin v0.12
 
Github basics
Github basicsGithub basics
Github basics
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Introduction to GitHub
Introduction to GitHubIntroduction to GitHub
Introduction to GitHub
 
Git - Level 2
Git - Level 2Git - Level 2
Git - Level 2
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Music With Pharo
Music With PharoMusic With Pharo
Music With Pharo
 
Git and Github Session
Git and Github SessionGit and Github Session
Git and Github Session
 
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
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Intro to the Alfresco Public API
Intro to the Alfresco Public APIIntro to the Alfresco Public API
Intro to the Alfresco Public API
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Git flow
Git flowGit flow
Git flow
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
 

Similar to Bloc for Pharo: Current State and Future Perspective

News on Bloc for Pharo
News on Bloc for PharoNews on Bloc for Pharo
News on Bloc for PharoESUG
 
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 SparkEvan Chan
 
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 ExecutionESUG
 
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 BLASJongsu "Liam" Kim
 
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, Алина Синявская ...Sigma Software
 
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, Аліна Синявська ...Sigma Software
 
RailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMsRailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMsLourens Naudé
 
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 EraAllen Wirfs-Brock
 
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++17Bartlomiej Filipek
 
GTC 2009 OpenGL Barthold
GTC 2009 OpenGL BartholdGTC 2009 OpenGL Barthold
GTC 2009 OpenGL BartholdMark Kilgard
 
Scala can do this, too
Scala can do this, tooScala can do this, too
Scala can do this, tooHairy Fotr
 
The Future State of Layout
The Future State of LayoutThe Future State of Layout
The Future State of LayoutStephen Hay
 
Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011Prabindh Sundareson
 
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 FigwheelDavid Kay
 
RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014Henry Van Styn
 
Behavior driven oop
Behavior driven oopBehavior driven oop
Behavior driven oopPiyush Verma
 

Similar to 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
 

More from 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 programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
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 RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
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 resultsESUG
 
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 6ESUG
 
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 GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
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 ModesESUG
 
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 ReportESUG
 
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 APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
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 CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
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 JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
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 TransformationsESUG
 

More from 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
 

Recently uploaded

Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
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 CCTVshikhaohhpro
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
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.jsAndolasoft Inc
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
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.docxComplianceQuest1
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
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 ...harshavardhanraghave
 
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.pdfWave PLM
 

Recently uploaded (20)

Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
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
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
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
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
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
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
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 ...
 
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
 
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
 

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