>
> How does this handles accelerated graphics?

Nice question :)

There are 3 ways to create a canvas:

1) canvas for offscreen rendering. In this case it must be rasterized in
order to be displayed on the screen. (requres pixel copying)
2) canvas for existing pixel buffer. In this case every draw operation
directly manipulates pixels. For example there is a way to get a pointer to
pixel buffer of SDL Window and create sparta canvas that would wrap it (no
pixel copying required, very fast).
3) canvas for GL context. For example we could create an SDL window with
OpenGL support, get GLContext and create canvas that would operate on it.
(fast but a bit complicated).

First way can result in either software or hardware rendering. For example
on Mac users can choose one of the following backends: CoreGraphics CPU or
CoreGraphics GPU, Skia CPU or Skia GPU and even Cairo.

Second way does not allow to use GPU Accelerated backends, since canvas is
created for pixel buffer. On Mac it is CoreGraphics CPU, Skia CPU or Cairo.

Third way actually allows to create GPU accelerated canvas. For example
Skia GPU renders everything using OpenGL. It is supported on all platforms:
windows, linux, mac, android, iOS.

The most simple way to create a new canvas is:

> canvas := MozCanvas extent: 500@400.


Behind the scenes it chooses the best backend for current platform: D2D1 on
Windows, CoreGraphics on Mac and Skia+X11 mixture on Linux.

Important to mention that Sparta allows developers to manually select which
backend to use.

Cheers,
Alex

On 5 September 2016 at 14:51, philippe.b...@highoctane.be <
philippe.b...@gmail.com> wrote:

> Sweet.
>
> How does this handles accelerated graphics?
>
> Phil
>
> Le 5 sept. 2016 11:52, "Aliaksei Syrel" <alex.sy...@gmail.com> a écrit :
>
>> Hi
>>
>> I am happy to announce the release of Sparta v1.0 for Pharo 5 and Pharo 6.
>> https://github.com/syrel/Sparta/tree/v1.0
>> For a moment only Linux and Mac are supported.
>>
>> It can be bootstrapped with the following script:
>>
>> Metacello new
>>   baseline: 'Sparta';
>>   repository: 'github://syrel/sparta:v1.0/src';
>>   load: #file:core
>>
>>
>> (on linux install 32bit libgtk-2, lingtk-3 and libstdc++)
>> (script for ubuntu http://ws.stfx.eu/IEAWCUC18BH)
>>
>> Sparta is an almost stateless vector graphics API for Pharo that provides
>> bindings to the Moz2D rendering backend. Moz2D is the extracted graphical
>> engine from Mozilla Firefox compiled as standalone shared library together
>> with the extern C bindings required to call the engine from Pharo.
>>
>> - developed with the help of Iceberg
>> <https://github.com/npasserini/iceberg> (thanks!) on Github.
>> - integrated into travis-ci <https://travis-ci.org/syrel/Sparta> using
>> smalltalkCI <https://github.com/hpi-swa/smalltalkCI> (great job!).
>> - documented using Pillar <https://github.com/pillar-markup/pillar> (so
>> better!) syntax.
>>
>> Cheers,
>> Alex
>>
>

Reply via email to