Krita Source Code Documentation
Loading...
Searching...
No Matches
KoCompositeOpsBenchmark.cpp File Reference
#include "KoCompositeOpsBenchmark.h"
#include "../compositeops/KoCompositeOpAlphaDarken.h"
#include "../compositeops/KoCompositeOpOver.h"
#include <KoOptimizedCompositeOpFactory.h>
#include <KoColorSpaceTraits.h>
#include <KoColorSpaceRegistry.h>
#include <QRandomGenerator>
#include <simpletest.h>

Go to the source code of this file.

Macros

#define COMPOSITE_BENCHMARK
 

Variables

const int IMG_HEIGHT = 2048
 
const int IMG_WIDTH = 2048
 
const qreal OPACITY_HALF = 0.5
 
const int TILE_HEIGHT = 64
 
const int TILE_WIDTH = 64
 
const int TILES_IN_HEIGHT = IMG_HEIGHT / TILE_HEIGHT
 
const int TILES_IN_WIDTH = IMG_WIDTH / TILE_WIDTH
 

Macro Definition Documentation

◆ COMPOSITE_BENCHMARK

#define COMPOSITE_BENCHMARK
Value:
for (int y = 0; y < TILES_IN_HEIGHT; y++){ \
for (int x = 0; x < TILES_IN_WIDTH; x++) { \
const int rowStride = IMG_WIDTH * KoBgrU8Traits::pixelSize; \
const int bufOffset = y * rowStride + x * TILE_WIDTH * KoBgrU8Traits::pixelSize; \
compositeOp->composite(m_dstBuffer + bufOffset, rowStride, \
m_srcBuffer + bufOffset, rowStride, \
m_mskBuffer + bufOffset, rowStride, \
} \
}
const int TILES_IN_WIDTH
const qreal OPACITY_HALF
const int TILE_HEIGHT
const int TILE_WIDTH
const int IMG_WIDTH
const int TILES_IN_HEIGHT
static const quint32 pixelSize

Definition at line 32 of file KoCompositeOpsBenchmark.cpp.

32#define COMPOSITE_BENCHMARK \
33 for (int y = 0; y < TILES_IN_HEIGHT; y++){ \
34 for (int x = 0; x < TILES_IN_WIDTH; x++) { \
35 const int rowStride = IMG_WIDTH * KoBgrU8Traits::pixelSize; \
36 const int bufOffset = y * rowStride + x * TILE_WIDTH * KoBgrU8Traits::pixelSize; \
37 compositeOp->composite(m_dstBuffer + bufOffset, rowStride, \
38 m_srcBuffer + bufOffset, rowStride, \
39 m_mskBuffer + bufOffset, rowStride, \
40 TILE_WIDTH, TILE_HEIGHT, \
41 OPACITY_HALF); \
42 } \
43 }

Variable Documentation

◆ IMG_HEIGHT

const int IMG_HEIGHT = 2048

Definition at line 24 of file KoCompositeOpsBenchmark.cpp.

◆ IMG_WIDTH

const int IMG_WIDTH = 2048

Definition at line 23 of file KoCompositeOpsBenchmark.cpp.

◆ OPACITY_HALF

const qreal OPACITY_HALF = 0.5

Definition at line 26 of file KoCompositeOpsBenchmark.cpp.

◆ TILE_HEIGHT

const int TILE_HEIGHT = 64

Definition at line 21 of file KoCompositeOpsBenchmark.cpp.

◆ TILE_WIDTH

const int TILE_WIDTH = 64

Definition at line 20 of file KoCompositeOpsBenchmark.cpp.

◆ TILES_IN_HEIGHT

const int TILES_IN_HEIGHT = IMG_HEIGHT / TILE_HEIGHT

Definition at line 29 of file KoCompositeOpsBenchmark.cpp.

◆ TILES_IN_WIDTH

const int TILES_IN_WIDTH = IMG_WIDTH / TILE_WIDTH

Definition at line 28 of file KoCompositeOpsBenchmark.cpp.