~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to krita/benchmarks/kis_floodfill_benchmark.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
void KisFloodFillBenchmark::initTestCase()
40
40
{
41
 
    m_colorSpace = KoColorSpaceRegistry::instance()->rgb8();    
 
41
    m_colorSpace = KoColorSpaceRegistry::instance()->rgb8();
42
42
    m_device = new KisPaintDevice(m_colorSpace);
43
43
    m_color = KoColor(m_colorSpace);
44
 
    
 
44
 
45
45
    QColor qcolor(Qt::red);
46
46
    srand(31524744);
47
 
    
 
47
 
48
48
    int tilew = 38;
49
49
    int tileh = 56;
50
 
    
 
50
 
51
51
    m_color.fromQColor(QColor(0,0,0,0)); // default pixel
52
52
    m_device->fill( 0,0,GMP_IMAGE_WIDTH, GMP_IMAGE_HEIGHT,m_color.data() );
53
53
 
63
63
        x = rand() % GMP_IMAGE_WIDTH;
64
64
        y = rand() % GMP_IMAGE_HEIGHT;
65
65
        // plus 10 so that we don't fill the ellipse
66
 
        painter.paintEllipse(x+ 10, y+ 10, tilew, tileh);    
 
66
        painter.paintEllipse(x+ 10, y+ 10, tilew, tileh);
67
67
    }
68
 
    
 
68
 
69
69
 
70
70
}
71
71
 
75
75
    KoColor bg(m_colorSpace);
76
76
    fg.fromQColor(Qt::blue);
77
77
    bg.fromQColor(Qt::black);
78
 
    
 
78
 
79
79
    QBENCHMARK
80
80
    {
81
81
        QRegion dirty;
98
98
        fillPainter.setHeight(GMP_IMAGE_HEIGHT);
99
99
 
100
100
        // fill twice
101
 
        fillPainter.fillColor(1, 1, false);
 
101
        fillPainter.fillColor(1, 1, 0);
102
102
 
103
 
        dirty = fillPainter.dirtyRegion();
104
 
        delete fillPainter.endTransaction();
 
103
        dirty = fillPainter.takeDirtyRegion();
 
104
        fillPainter.deleteTransaction();
105
105
    }
106
 
    
 
106
 
107
107
    // uncomment this to see the output
108
108
    //QImage out = m_device->convertToQImage(m_colorSpace->profile(),0,0,GMP_IMAGE_WIDTH,GMP_IMAGE_HEIGHT);
109
109
    //out.save("fill_output.png");