Commit 333f23ba authored by Lukáš Tvrdý's avatar Lukáš Tvrdý

Add missing benchmarks.

svn path=/trunk/koffice/; revision=1081531
parent 69bf2be5
......@@ -215,5 +215,26 @@ void KisRandomIteratorBenchmark::benchmarkTileByTileWrite()
}
void KisRandomIteratorBenchmark::benchmarkTwoIteratorsNoMemCpy()
{
KoColor c(m_colorSpace);
c.fromQColor(QColor(250,120,0));
KisPaintDevice dab(m_colorSpace);
dab.fill(0,0,TEST_IMAGE_WIDTH,TEST_IMAGE_HEIGHT, c.data());
KisRandomAccessor writeIterator = m_device->createRandomAccessor(0,0);
KisRandomConstAccessor constReadIterator = dab.createRandomConstAccessor(0,0);
QBENCHMARK{
for (int i = 0; i < TEST_IMAGE_HEIGHT; i++){
for (int j = 0; j < TEST_IMAGE_WIDTH; j++) {
writeIterator.moveTo(j,i);
constReadIterator.moveTo(j,i);
}
}
}
}
QTEST_KDEMAIN(KisRandomIteratorBenchmark, GUI)
#include "kis_random_iterator_benchmark.moc"
......@@ -57,7 +57,7 @@ private slots:
void benchmarkNoMemCpy();
void benchmarkConstNoMemCpy();
void benchmarkTwoIteratorsNoMemCpy();
};
#endif
......@@ -136,5 +136,25 @@ void KisRectIteratorBenchmark::benchmarkConstNoMemCpy()
void KisRectIteratorBenchmark::benchmarkTwoIteratorsNoMemCpy()
{
KoColor c(m_colorSpace);
c.fromQColor(QColor(250,120,0));
KisPaintDevice dab(m_colorSpace);
dab.fill(0,0,TEST_IMAGE_WIDTH,TEST_IMAGE_HEIGHT, c.data());
KisRectIteratorPixel writeIterator = m_device->createRectIterator(0, 0, TEST_IMAGE_WIDTH, TEST_IMAGE_HEIGHT);
KisRectConstIteratorPixel constReadIterator = dab.createRectConstIterator(0, 0, TEST_IMAGE_WIDTH, TEST_IMAGE_HEIGHT);
QBENCHMARK
{
while (!constReadIterator.isDone()) {
++constReadIterator;
++writeIterator;
}
}
}
QTEST_KDEMAIN(KisRectIteratorBenchmark, GUI)
#include "kis_rect_iterator_benchmark.moc"
......@@ -51,6 +51,7 @@ private slots:
void benchmarkNoMemCpy();
void benchmarkConstNoMemCpy();
void benchmarkTwoIteratorsNoMemCpy();
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment