Re: [PATCH 3/3] win32: Allow gdi operations for argb32 surfaces (allowed by surface flags)

LRN <[email protected]> Sun, 29 Apr 2018 16:46:37 +0300
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On 28.04.2018 22:27, Vasily Galkin wrote:
> gtk's speedup is near 1.7x,
2.3-2.5x for me

> not such huge as pure cairo ~7-8x on results above
> It looks that gtk has some problems in caching cairo surfaces
> and recreates them every frame with initial black fill.

Not exactly. Here's FPS data for GTK-3.22 fishbowl with old and new cairo:

old and busted:
Layered mode - 35.2 fps
Normal mode - 21.2 fps
Normal mode (optimized double-buffering) - 21.2 fps
Normal mode (generic double-buffering) - 20.0 fps

new hotness:
Layered mode - 35.0 fps
Normal mode - 21.2 fps
Normal mode (optimized double-buffering) - 53 fps (x2.5 faster than normal)
Normal mode (generic double-buffering) - 49 fps (x2.3 faster than normal)

Layered mode doen't blit anything, so has no improvements (the 0.2 change is
likely due to measurement error).

Normal mode doesn't seem to be covered with the "draw everything into a buffer
then blit once" case that you've optimized for, so it also has no visible
improvements.

Double-buffered mode with GDK built-in double-buffering (where GDK creates a
new double-buffer on every redraw) is x2.3 faster, and optimized backend
double-buffering (where DB surface is not re-created on every redraw) is x2.5
faster.

Note that in either case GDK will erase the painted region (well, in case of
generic DB it likely re-creates the new DB surface in a clear state) before
drawing anything, which is required for correct alpha-transparency - otherwise
semi-transparent regions will "stack up" on every redraw. If i deliberately
disable that eraser code, optimized double-buffering fps increases to 55 fps
(i.e. very little), but alpha-transparent regions are screwed.

FPS values are for the GTK fishbowl benchmark window maximized on my 4K
desktop, so, taking into account the taskbar, that makes it 3591x2160, and the
fishbowl widget itself is a bit smaller vertically.

Anyway, i'm pretty sure that GTK is drawing as best as it can, and there's no
x7 speedup anywhere in sight (that said, i was also pretty sure that cairo was
drawing as best as it can; shows what i know...).

As for the x1.7 vs x2.3, it could be attributed to you [presumably] having
smaller test windows, in which case the time spent on actual blitting is
smaller, and thus the speedup, only affecting that time, doesn't have as much
impact.

-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE4MWzR43wYaAzEA49ja3pJ2dZunQFAlrlzMMACgkQja3pJ2dZ
unThihAApg71P7C4e7FggC0jhwmKbaONysXvq4NUtxCn8INpl9IlDnIlfWioikdV
AIj6p4svi2plRhif0BQKvpqs1g4KYWN+8atYMoPRmE7Qvgp05KyVIevMf3KWhOTm
cz2MYUUnT4HIbxGFPYWi44PVS+Y2CKFk4IdGyUSr5A2JItTb71T/pfrNeyP5WCKJ
24N9PDc8eloo6ZJFZrO02wCGEJyBW1mYOp0MWTY9sD0I3L8KcIM6Dq+0UC4DNgtU
jX1qXp1uNmX8vJ4jlqVfHWzcah3m7sjfF7+FIm5iiugfL6bbHvWzA2zXke2nBClE
DTIXAumhgGaO9c+8ak5wobvpjES9Yzmp09nglNp8NSfKKkGhP7MlIgpJWF0Sz2+r
aia5tKRkeI92ugVVgHc+qpBVhsFJcgGt2HXGunOB8YOdo8U32tPixNA7Sn2LrRmv
Vw82Mf40+C+gacBgP9rtmELR/K7ouYm/CbSoqwWjdo10TtgHjBYcJtn0XZ6Oto5r
AsHk4WQKeux0z0ngHuQnYE213dyzKTwRd9VvN/9AhxBvDIAW35BRZFm9ogpU2da3
OmFDlKDY6L9hGZzVxB0g0JaQeBH15JoQnG/v9aQ31w23COVe5vHhAYmnQzeGvuvt
mlZQuqXDGUS2p1AbkMRLNpun1CU+KsiAttGZzHPbHlMcA5KahnM=
=8Ycd
-----END PGP SIGNATURE-----