File indexing completed on 2025-02-16 04:05:07
0001 /* 0002 * SPDX-FileCopyrightText: 2010 Lukáš Tvrdý lukast.dev @gmail.com 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 #include <simpletest.h> 0007 0008 #include "kis_projection_benchmark.h" 0009 #include "kis_benchmark_values.h" 0010 0011 #include <KoColor.h> 0012 0013 #include <kis_group_layer.h> 0014 #include <kis_paint_device.h> 0015 #include <KisDocument.h> 0016 #include <kis_image.h> 0017 #include <KisPart.h> 0018 0019 void KisProjectionBenchmark::initTestCase() 0020 { 0021 0022 } 0023 0024 void KisProjectionBenchmark::cleanupTestCase() 0025 { 0026 } 0027 0028 0029 void KisProjectionBenchmark::benchmarkProjection() 0030 { 0031 QBENCHMARK{ 0032 KisDocument *doc = KisPart::instance()->createDocument(); 0033 doc->loadNativeFormat(QString(FILES_DATA_DIR) + '/' + "load_test.kra"); 0034 doc->image()->refreshGraph(); 0035 doc->exportDocumentSync(QString(FILES_OUTPUT_DIR) + '/' + "save_test.kra", doc->mimeType()); 0036 delete doc; 0037 } 0038 } 0039 0040 void KisProjectionBenchmark::benchmarkLoading() 0041 { 0042 QBENCHMARK{ 0043 KisDocument *doc2 = KisPart::instance()->createDocument(); 0044 doc2->loadNativeFormat(QString(FILES_DATA_DIR) + '/' + "load_test.kra"); 0045 delete doc2; 0046 } 0047 } 0048 0049 0050 SIMPLE_TEST_MAIN(KisProjectionBenchmark)