mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
.benchmarks
git-svn-id: svn://ultimatepp.org/upp/trunk@14476 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
756079d205
commit
f842c6672b
1 changed files with 18 additions and 0 deletions
|
|
@ -2,6 +2,20 @@
|
|||
|
||||
using namespace Upp;
|
||||
|
||||
void CoFill(RGBA *t, RGBA c, int len)
|
||||
{
|
||||
const int CHUNK = 1024;
|
||||
std::atomic<int> ii(0);
|
||||
CoDo([&] {
|
||||
for(;;) {
|
||||
int pos = CHUNK * ii++;
|
||||
if(pos >= len)
|
||||
break;
|
||||
Fill(t + pos, c, min(CHUNK, len - pos));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
Color c = Red();
|
||||
|
|
@ -19,5 +33,9 @@ GUI_APP_MAIN
|
|||
RTIMING("Fill");
|
||||
Fill(b, c, len);
|
||||
}
|
||||
{
|
||||
RTIMING("CoFill");
|
||||
CoFill(b, c, len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue