32
tizen.org 1 Tizen graphics core. The scene graph (Evas) Tizen native display layer – Architecture & Usage http://www.enlightenment.org Carsten Haitzler Principal Engineer Samsung Electronics, Enlightenment project lead & founder <[email protected]> <[email protected]>

Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org1

Tizen graphics core. The scene graph (Evas)Tizen native display layer – Architecture & Usagehttp://www.enlightenment.org

Carsten HaitzlerPrincipal Engineer Samsung Electronics, Enlightenment project lead & founder

<[email protected]> <[email protected]>

Page 2: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org2

Evas is part of EFL

● A collection of libraries● From the same team working on Enlightenment (E)● Built for the purpose of making E17 (Enlightenment 0.17)● Focused on staying lean and still providing fanciness● Almost all development focus on EFL vs E17● Cover a wide range of functionality

● 26% of code for E17 is E, rest is EFL.● E17+EFL make up only 50% of code in SVN though

Page 3: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org3

Where does it live

Elementary

Application, Library, Service

Edje

Ecore

Evas

Eet

Eina

Efreet EDbus

Embryo

EmotionEthumbEezeEio

Core OS (Kernel, libc, system libs, OpenGL, D-Bus, X11 etc.)

(Currently not in Tizen)

Page 4: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org4

Evas is part of EFL

EFL

KERNEL

libpng/jpeg etc.libc etc. X11, OpenGL, etc. D-Bus, Services

Enlightenment(Window Manager/Compositor)

HTML5 Apps

BrowserAnd HTML5

Runtime

Native Applicationsand Services

EFL

Page 5: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org5

Why Evas?

● Very fast software rendering● Solid accelerated OpenGL/OpenGL-ES2.0 support for years● 60fps+ on common phones with high quality (32bpp)● Memory footprint vs existing Linux toolkits & desktops

● Measured with full desktop environment (closest apples to apples comparison)

– Approx 60% less memory usage than Unity (Ubuntu 11.04)– Both have approximately equivalent features

Page 6: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org6

Why is this relevant?

● If you are building Tizen platforms, you'll run into Evas or need it● With OpenGL acceleration, overhead may not always be worth it

● Fast software rendering needed● Some uses (low end phones, mp3 players) may have no GPU● Texture Atlases expand memory needs of OpenGL

● Memory on phones and tablets is a fraction of PC's● 128Mb-512Mb common● No swap (limited write cycled to flash)

Page 7: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org7

Why is this relevant?

● High level abstraction allows for more optimizing in Evas● Easier app development● Means ports to other display systems (e.g. Wayland) are simpler

● Also more optimal

● Makes for easy prototyping without target devices● Use Evas on your desktop Linux as-is and get the same results● Fast write+test+debug cycles compared to cross-development

Page 8: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org8

Where do I look?

● Tizen itself – http://source.tizen.org● Emulator in SDK, git repositories

● Enlightenment based distributions & packages● http://www.enlightenment.org/p.php?p=download

● Upstream source – http://www.enlightenment.org● http://www.enlightenment.org/p.php?p=contribute

● Easy to use scripts● http://omicron.homeip.net/projects/easy_e17/easy_e17.sh

Page 9: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org9

How does this glue in

● Ecore is the core loop, event & marshaling library for EFL● Also provides glue to other subsystems

– Display system (X11, FB, Wayland, Win32, WinCE, etc.)– Networking & IPC– Threading & inter-thread communication– Evas input feeding and output driving– More...

Page 10: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org10

How does this glue in

ZZZ

WAKE UP

PROCESS TIMEOUTS

PROCESS EVENTS

PROCESS JOBS

GO TO SLEEP

SPIN INIDLERS

OR EVENT HANDLER

TIMER/ANIMATOR

IDLE EXITER

JOB

IDLE ENTERER

CALLBACK

EVAS RENDERS UPDATES HERE

Page 11: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org11

What is a scene graph?

● Tracks state of all display objects● Position, size, visibility, color, properties etc.

● Handles rendering of each object● Loading fonts, images, rendering glyphs, scaling, fading etc.

● Handles minimizing of rendering● Only update areas changed● If changes obscured, reduce to a NOP

● Optimize rendering● Abstract to OpenGL, software, or anything else

Page 12: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org12

What is a scene graph?

● Handles generation and caching of pre-scaled data for you● Saves adding such logic to your apps● Can parallelize such preparation silently for you

● Can “unload” data from memory and re-fetch from original source● Can minimize memory footprint when idle or in the background● Clear out unused data while running normally

● Tree setup with parent and child objects● Allows you to build entire object trees, not just flat.

Page 13: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org13

A traditional layout

Text Label Text Label Text Label Text Label Text Label Text Label

Text Label Text Label Text Label

OK

Page 14: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org14

Complex objects out of simple ones

Page 15: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org15

Complex objects out of simple ones

OK

Page 16: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org16

Complex objects out of simple ones

OK

Page 17: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org17

Complex objects out of simple ones

OK

Page 18: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org18

Complex objects out of simple ones

OK

Page 19: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org19

Mimics design closer

● Designers & artists work in objects and layers● Lets you just modify the elements you need to● With enough objects (layers) you can build almost anything● Libraries like Edje can load whole object trees from files on disk

● File contents pre-designed by designers and hold all content● Handles animation and event reaction for uyou

Page 20: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org20

Putting together objects

Page 21: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org21

Abstracting rendering

Canvas core

Hello out there

General Rendering

Software rendering API

Software core

OpenGL Rendering API

OpenGL core

OUTPUT(screen/window)

Input device events Canvas state changes

Select rendering engine at runtime

Rendering commandImage data, fonts etc.

Page 22: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org22

Slide Title

Hello out there

Page 23: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org23

Slide Title

Hello out there

Page 24: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org24

Slide Title

Hello out there

Page 25: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org25

Slide Title

Hello out there

Page 26: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org26

Slide Title

Hello out there

Page 27: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org27

Multiple output paths

● Pure software● Universal (works everywhere)● MMX, SSE, SSE3, NEON ASM (runtime detected)● High quality scaling (super-sampling + linear-interpolation)● Caching of scaled image data on the fly● Output rotation and down-convert

Page 28: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org28

Multiple output paths

● OpenGL/OpenGL-ES2● Uses texture atlases where possible● Defers texture upload and removes duplication where it can● Multi-pipeline out-of-order rendering optimizing● Batches up as much geometry as it can for best performance● Specialized shaders for performance● Pushes all rendering via GL (not just compositing surfaces)● Text, polygons too● Tries to remove texture uploads with zero-copy (if possible)

Page 29: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org29

Multiple output paths

● X11 (OpenGL, Xlib & XCB)● Wayland (OpenGL & SHM)● Raw Framebuffer● Memory buffers● PS3 Native● SDL (OpenGL)● Windows (32/64/CE) (GDI & DirectDraw)● … others too

Page 30: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org30

Input Data

● Images● CMP, EDB, EET, GIF (animated + still), ICO, JPEG,

PPM/PGM/PBM, PSD, SVG, TGA, TIFF, WBMP, XPM, XCF, PS, PDF, RAW, MOV/AVI/MPG/etc.

● Fonts● TTF, OpenType (anything Freetype 2 supports)

● Text● UTF-8 Unicode● Complex text formatting (LTR, RTL, Composition)

Page 31: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org31

Questions, Answers & Flames

http://www.samsung.comhttp://www.enlightenment.org

Carsten HaitzlerEnlightenment project lead & founder

[email protected]

Principal EngineerSamsung Electronics

[email protected]

Page 32: Tizen graphics core. The scene graph (Evas)download.tizen.org/misc/media/conference2012/wednesday/... · 2012. 5. 16. · Evas is part of EFL A collection of libraries From the same

tizen.org32