diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-02-29 22:04:02 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-03-07 19:22:47 +0100 |
commit | 01b3f327df2dc30d847bd335ccce12eaec2dfd39 (patch) | |
tree | b78689ed59c6a5b4438e9f6f8e21d395c78061e1 /test | |
parent | a65278c7bc9c0dbca8a74db09fd0aebf1c26ef28 (diff) |
Move pixel buffer render code from Window to PixelBuffer for easier testing/benchmarking.
Diffstat (limited to 'test')
-rw-r--r-- | test/uitests/benchmarktest.cc | 28 |
1 files changed, 28 insertions, 0 deletions
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 @@ -116,6 +116,34 @@ int main() } { + GUI::PixelBuffer wpixbuf(800, 600); + std::vector<GUI::PixelBufferAlpha*> 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) { |