summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2020-02-29 22:04:02 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2020-03-01 16:12:55 +0100
commita9ee71d8f1ccc634acdd9f0205855af1527c4bb9 (patch)
treeea0d288e59b9d4fa8f9679f063883afd9ae1d8fd /test
parent15e9d38d36573ba0e1ec6e0cc2768b12ca01bff0 (diff)
WIP: Move pixel buffer render code from Window to PixelBuffer for easier testing/benchmarking.
Diffstat (limited to 'test')
-rw-r--r--test/uitests/benchmarktest.cc28
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)
{