From 01b3f327df2dc30d847bd335ccce12eaec2dfd39 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 29 Feb 2020 22:04:02 +0100 Subject: Move pixel buffer render code from Window to PixelBuffer for easier testing/benchmarking. --- test/uitests/benchmarktest.cc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test') diff --git a/test/uitests/benchmarktest.cc b/test/uitests/benchmarktest.cc index b240388..33defc6 100644 --- a/test/uitests/benchmarktest.cc +++ b/test/uitests/benchmarktest.cc @@ -115,6 +115,34 @@ int main() } } + { + GUI::PixelBuffer wpixbuf(800, 600); + std::vector children; + for(int i = 0; i < 100; ++i) + { + auto child = new GUI::PixelBufferAlpha(300, 300); + child->x = i * 2; + child->y = i * 2; + children.push_back(child); + } + + TimedScope timed("Buffer flattening", 100); + for(int i = 0; i < 100; ++i) + { + for(auto child : children) + { + child->dirty = true; + } + + wpixbuf.updateBuffer(children); + } + + for(auto child : children) + { + delete child; + } + } + { TimedScope timed("Scaled 1:1 no alpha", 1000); for(int i = 0; i < 1000; ++i) -- cgit v1.2.3