[cairo] [PATCH 3/3] win32: Allow gdi operations for argb32 surfaces (allowed by surface flags)
lrn1986 at gmail.com
Sun Apr 29 13:46:37 UTC 2018
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
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
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
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
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: OpenPGP digital signature
More information about the cairo