SlideShare a Scribd company logo
Essential parts to implement own
Ozone backend
Web Engines Hackfest 2021
Maksim Sisov <msisov@iglaia.com>
What is Ozone (again)?
- Abstraction layer beneath the Aura window system.
- wrapper for the platform
- provides interfaces for everything
- Chosen at run time
- Many platforms in one binary
Example: Add Ozone/GTK
- Learn by implementing!
- Goal:
- Add Ozone/Gtk backend that Chromium can draw to.
- Steps:
- GN:
- Entry points: add Ozone/Gtk to GN
- Browser side. Implement
- OzonePlatform,
- PlatformWindow, PlatformScreen.
- GPU side. Implement
- SurfaceFactoryOzone,
- GLOzone (HW accelerated path), SurfaceOzoneCanvas (SW path).
- Stub gfx::ClientNativePixmapFactory.
The Entry Points
Ozone and GN
- Python script that generates constructor list
Essential parts to implement own Ozone backend
Ozone and GN
- Modify //build/config/ozone_extra.gni
- Create //ui/ozone/platform/gtk
Implement OzonePlatformGtk and ...
Browser side
Essential parts to implement own Ozone backend
OzonePlatformGtk
- Functions to implement:
- ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone();
- std::unique_ptr<PlatformWindow> CreatePlatformWindow(...);
- std::unique_ptr<PlatformScreen> CreateScreen();
- void InitializeUI(const InitParams& params);
- void InitializeGPU(const InitParams& params);
- const PlatformProperties& GetPlatformProperties();
- All the other virtual functions will return nullptr except:
- CursorFactory* GetCursorFactory(); - Will return default cursor factory.
- GpuPlatformSupportHost* GetGpuPlatformSupportHost(); - Will return stub.
- std::unique_ptr<InputMethod> CreateInputMethod(...); - Wll return default input method.
GtkOzoneWindow
- Important points:
- Create native window - gtk_window_new(GTK_WINDOW_TOPLEVEL).
- Initialize window and return gfx::AcceleratedWidget for that window
- gfx::AcceleratedWidget is a Chromium’s internal representation of widget aka handle for
a native window.
- X11 => XWindow
- Wayland => own counter
- Return widget by calling delegate_->OnAcceleratedWidgetAvailable(widget_);
- Also:
- Implement Show(), SetBounds(), GetBounds()
- And add event listeners to get events from server and send to delegate.
- All the other pure virtual methods can be left unimplemented.
GtkScreen
- Provide basic implementation that
- returns a display for a widget
- returns widget at screen point.
- For demo, a primary display was hardcoded with the parameters checked
from the display settings. The correct solution would be fetching the list of
displays as it is done in Ozone/X11/Wayland.
Are we done?
Essential parts to implement own Ozone backend
GPU side
- Implement SurfaceFactoryOzone
- returns supported GL implementations (HW acceleration or swiftshader)
- They can be -
GPU side
- For demo, we will use SW path instead.
GPU side - SurfaceOzoneCanvas
- Used when HW accelerated path is not available.
- Returns SkCanvas where Chromium draws to
- When canvas has data written, PresentCanvas is called
- When ResizeCanvas is called, SkCanvas becomes invalid.
- For GTK, gtk drawing area with cairo image surface was used -
- Create gtk frame,
- Create drawing area and add to frame
- Create cairo image surface
- Create SkSurface from cairo image surface
- Return SkCanvas from SkSurface
- Once PresentCanvas is called
- Create cairo region, get gdk drawing context
- get cairo context, paint from the cairo image surface into the cairo context
Are we done now?
Essential parts to implement own Ozone backend
A big picture
Essential parts to implement own Ozone backend
Essential parts to implement own Ozone backend
Essential parts to implement own Ozone backend
Demo
Essential parts to implement own Ozone backend
Essential parts to implement own Ozone backend
Thank you

More Related Content

PDF
Embedding Chromium into AGL demo platform with WAM
PDF
Chromium Ozone
PDF
Writing native Linux desktop apps with JavaScript
PDF
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
PDF
Overview of the open source Vulkan driver for Raspberry Pi 4 (XDC 2020)
PDF
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
PDF
About OpenGL and Vulkan interoperability (XDC 2020)
PDF
Fixing Gaps. Strengthening the Chromium platform for content blocking
Embedding Chromium into AGL demo platform with WAM
Chromium Ozone
Writing native Linux desktop apps with JavaScript
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
Overview of the open source Vulkan driver for Raspberry Pi 4 (XDC 2020)
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
About OpenGL and Vulkan interoperability (XDC 2020)
Fixing Gaps. Strengthening the Chromium platform for content blocking

What's hot (20)

PDF
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
PDF
Kiosk-mode browser using Chromium Embedded Framework (CEF)
PDF
Waylandifying Chromium: From downstream to shipping (ELCE 2020)
PDF
What's new with JavaScript in GNOME: The 2020 edition (GUADEC 2020)
PDF
Pairing WebKit and Wayland for Linux-Based Embedded Web Content Presentation ...
PDF
WebKit for Wayland (Web Engines Hackfest 2014)
PDF
Multimedia in WebKitGtk+, past/present/future
PDF
Serverless Preview Environments @ Boston DevOps
PDF
Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)
PDF
Petri Niemi Qt Web Kit
PDF
Ewebkit basic (Web rendering enging of EFL)
PDF
Efficient multimedia support in QtWebKit on Raspberry Pi (GStreamer Conferenc...
PDF
WebKit, HTML5 media and GStreamer on multiple platforms
PDF
Docker from a team perspective
PDF
Dockerize Spago Self Contained ML & NLP Library & Deploy on Okteto Cloud Usin...
PDF
OpenCms Days 2014 Keynote - Step up to OpenCms 9.5
PDF
Dev/Stage/Prod Parity with Vagrant
PDF
GStreamer support in WebKit. what’s new?
PDF
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
PDF
2013-03-07 indie developer toolkit
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
Kiosk-mode browser using Chromium Embedded Framework (CEF)
Waylandifying Chromium: From downstream to shipping (ELCE 2020)
What's new with JavaScript in GNOME: The 2020 edition (GUADEC 2020)
Pairing WebKit and Wayland for Linux-Based Embedded Web Content Presentation ...
WebKit for Wayland (Web Engines Hackfest 2014)
Multimedia in WebKitGtk+, past/present/future
Serverless Preview Environments @ Boston DevOps
Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)
Petri Niemi Qt Web Kit
Ewebkit basic (Web rendering enging of EFL)
Efficient multimedia support in QtWebKit on Raspberry Pi (GStreamer Conferenc...
WebKit, HTML5 media and GStreamer on multiple platforms
Docker from a team perspective
Dockerize Spago Self Contained ML & NLP Library & Deploy on Okteto Cloud Usin...
OpenCms Days 2014 Keynote - Step up to OpenCms 9.5
Dev/Stage/Prod Parity with Vagrant
GStreamer support in WebKit. what’s new?
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
2013-03-07 indie developer toolkit
Ad

Similar to Essential parts to implement own Ozone backend (20)

PDF
DevFest 2022 - Cloud Workstation Introduction TaiChung
PDF
Tensorflow in Docker
PDF
OpenMP-OpenACC-Offload-Cauldron2022-1.pdf
PDF
How to deploy a Java application on Google App engine Flexible environment
PDF
14 Years of Developing nCine - An Open Source 2D Game Framework
KEY
groovy & grails - lecture 9
ODP
Javascript in Linux Desktop
PDF
DIY: Computer Vision with GWT.
PDF
DIY- computer vision with GWT
PDF
Grunt & Front-end Workflow
PDF
Mobile development in 2020
PDF
Drone CI/CD 自動化測試及部署
PDF
Introduction to Google Compute Engine
PDF
Quick Review of Desktop and Native Apps using Javascript
PDF
GCE 上搭配 Cloud Storage 建置 Drone CI
PDF
Minko - Scripting 3D apps with Lua and C++
PDF
Porting Tizen-IVI 3.0 to an ARM based SoC Platform
PDF
App container rkt
PDF
Javascript, the GNOME way (JSConf EU 2011)
PPT
Advanced Graphics Workshop - GFX2011
DevFest 2022 - Cloud Workstation Introduction TaiChung
Tensorflow in Docker
OpenMP-OpenACC-Offload-Cauldron2022-1.pdf
How to deploy a Java application on Google App engine Flexible environment
14 Years of Developing nCine - An Open Source 2D Game Framework
groovy & grails - lecture 9
Javascript in Linux Desktop
DIY: Computer Vision with GWT.
DIY- computer vision with GWT
Grunt & Front-end Workflow
Mobile development in 2020
Drone CI/CD 自動化測試及部署
Introduction to Google Compute Engine
Quick Review of Desktop and Native Apps using Javascript
GCE 上搭配 Cloud Storage 建置 Drone CI
Minko - Scripting 3D apps with Lua and C++
Porting Tizen-IVI 3.0 to an ARM based SoC Platform
App container rkt
Javascript, the GNOME way (JSConf EU 2011)
Advanced Graphics Workshop - GFX2011
Ad

More from Igalia (20)

PDF
Life of a Kernel Bug Fix
PDF
Unlocking the Full Potential of WPE to Build a Successful Embedded Product
PDF
Advancing WebDriver BiDi support in WebKit
PDF
Jumping Over the Garden Wall - WPE WebKit on Android
PDF
Collective Funding, Governance and Prioritiation of Browser Engine Projects
PDF
Don't let your motivation go, save time with kworkflow
PDF
Solving the world’s (localization) problems
PDF
The Whippet Embeddable Garbage Collection Library
PDF
Nobody asks "How is JavaScript?"
PDF
Getting more juice out from your Raspberry Pi GPU
PDF
WebRTC support in WebKitGTK and WPEWebKit with GStreamer: Status update
PDF
Demystifying Temporal: A Deep Dive into JavaScript New Temporal API
PDF
CSS :has() Unlimited Power
PDF
Device-Generated Commands in Vulkan
PDF
Current state of Lavapipe: Mesa's software renderer for Vulkan
PDF
Vulkan Video is Open: Application showcase
PDF
Scheme on WebAssembly: It is happening!
PDF
EBC - A new backend compiler for etnaviv
PDF
RISC-V LLVM State of the Union
PDF
Device-Generated Commands in Vulkan
Life of a Kernel Bug Fix
Unlocking the Full Potential of WPE to Build a Successful Embedded Product
Advancing WebDriver BiDi support in WebKit
Jumping Over the Garden Wall - WPE WebKit on Android
Collective Funding, Governance and Prioritiation of Browser Engine Projects
Don't let your motivation go, save time with kworkflow
Solving the world’s (localization) problems
The Whippet Embeddable Garbage Collection Library
Nobody asks "How is JavaScript?"
Getting more juice out from your Raspberry Pi GPU
WebRTC support in WebKitGTK and WPEWebKit with GStreamer: Status update
Demystifying Temporal: A Deep Dive into JavaScript New Temporal API
CSS :has() Unlimited Power
Device-Generated Commands in Vulkan
Current state of Lavapipe: Mesa's software renderer for Vulkan
Vulkan Video is Open: Application showcase
Scheme on WebAssembly: It is happening!
EBC - A new backend compiler for etnaviv
RISC-V LLVM State of the Union
Device-Generated Commands in Vulkan

Recently uploaded (20)

PDF
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
PPTX
Internet___Basics___Styled_ presentation
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
DOCX
Unit-3 cyber security network security of internet system
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
PPTX
international classification of diseases ICD-10 review PPT.pptx
PPTX
Funds Management Learning Material for Beg
PDF
Introduction to the IoT system, how the IoT system works
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPTX
presentation_pfe-universite-molay-seltan.pptx
PPT
tcp ip networks nd ip layering assotred slides
PPTX
artificial intelligence overview of it and more
PPTX
innovation process that make everything different.pptx
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
Internet___Basics___Styled_ presentation
The New Creative Director: How AI Tools for Social Media Content Creation Are...
Unit-3 cyber security network security of internet system
An introduction to the IFRS (ISSB) Stndards.pdf
Job_Card_System_Styled_lorem_ipsum_.pptx
Decoding a Decade: 10 Years of Applied CTI Discipline
Cloud-Scale Log Monitoring _ Datadog.pdf
international classification of diseases ICD-10 review PPT.pptx
Funds Management Learning Material for Beg
Introduction to the IoT system, how the IoT system works
INTERNET------BASICS-------UPDATED PPT PRESENTATION
SASE Traffic Flow - ZTNA Connector-1.pdf
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
introduction about ICD -10 & ICD-11 ppt.pptx
presentation_pfe-universite-molay-seltan.pptx
tcp ip networks nd ip layering assotred slides
artificial intelligence overview of it and more
innovation process that make everything different.pptx

Essential parts to implement own Ozone backend

  • 1. Essential parts to implement own Ozone backend Web Engines Hackfest 2021 Maksim Sisov <msisov@iglaia.com>
  • 2. What is Ozone (again)? - Abstraction layer beneath the Aura window system. - wrapper for the platform - provides interfaces for everything - Chosen at run time - Many platforms in one binary
  • 3. Example: Add Ozone/GTK - Learn by implementing! - Goal: - Add Ozone/Gtk backend that Chromium can draw to. - Steps: - GN: - Entry points: add Ozone/Gtk to GN - Browser side. Implement - OzonePlatform, - PlatformWindow, PlatformScreen. - GPU side. Implement - SurfaceFactoryOzone, - GLOzone (HW accelerated path), SurfaceOzoneCanvas (SW path). - Stub gfx::ClientNativePixmapFactory.
  • 5. Ozone and GN - Python script that generates constructor list
  • 7. Ozone and GN - Modify //build/config/ozone_extra.gni - Create //ui/ozone/platform/gtk
  • 11. OzonePlatformGtk - Functions to implement: - ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone(); - std::unique_ptr<PlatformWindow> CreatePlatformWindow(...); - std::unique_ptr<PlatformScreen> CreateScreen(); - void InitializeUI(const InitParams& params); - void InitializeGPU(const InitParams& params); - const PlatformProperties& GetPlatformProperties(); - All the other virtual functions will return nullptr except: - CursorFactory* GetCursorFactory(); - Will return default cursor factory. - GpuPlatformSupportHost* GetGpuPlatformSupportHost(); - Will return stub. - std::unique_ptr<InputMethod> CreateInputMethod(...); - Wll return default input method.
  • 12. GtkOzoneWindow - Important points: - Create native window - gtk_window_new(GTK_WINDOW_TOPLEVEL). - Initialize window and return gfx::AcceleratedWidget for that window - gfx::AcceleratedWidget is a Chromium’s internal representation of widget aka handle for a native window. - X11 => XWindow - Wayland => own counter - Return widget by calling delegate_->OnAcceleratedWidgetAvailable(widget_); - Also: - Implement Show(), SetBounds(), GetBounds() - And add event listeners to get events from server and send to delegate. - All the other pure virtual methods can be left unimplemented.
  • 13. GtkScreen - Provide basic implementation that - returns a display for a widget - returns widget at screen point. - For demo, a primary display was hardcoded with the parameters checked from the display settings. The correct solution would be fetching the list of displays as it is done in Ozone/X11/Wayland.
  • 16. GPU side - Implement SurfaceFactoryOzone - returns supported GL implementations (HW acceleration or swiftshader) - They can be -
  • 17. GPU side - For demo, we will use SW path instead.
  • 18. GPU side - SurfaceOzoneCanvas - Used when HW accelerated path is not available. - Returns SkCanvas where Chromium draws to - When canvas has data written, PresentCanvas is called - When ResizeCanvas is called, SkCanvas becomes invalid. - For GTK, gtk drawing area with cairo image surface was used - - Create gtk frame, - Create drawing area and add to frame - Create cairo image surface - Create SkSurface from cairo image surface - Return SkCanvas from SkSurface - Once PresentCanvas is called - Create cairo region, get gdk drawing context - get cairo context, paint from the cairo image surface into the cairo context
  • 19. Are we done now?
  • 25. Demo