| 353 | } |
| 354 | |
| 355 | static QImage PrepareOverlayImage(const BenchmarkOptions& options, const RenderLayout& layout, const QImage& overlay_base) { |
| 356 | QImage scaled = overlay_base.scaled( |
| 357 | layout.overlay_width, |
| 358 | layout.overlay_height, |
| 359 | Qt::IgnoreAspectRatio, |
| 360 | Qt::SmoothTransformation); |
| 361 | |
| 362 | QTransform rotation; |
| 363 | rotation.rotate(layout.overlay_rotation); |
| 364 | QImage rgba = scaled.transformed(rotation, Qt::SmoothTransformation).convertToFormat(QImage::Format_RGBA8888); |
| 365 | QPainter alpha_painter(&rgba); |
| 366 | alpha_painter.setCompositionMode(QPainter::CompositionMode_DestinationIn); |
| 367 | alpha_painter.fillRect(rgba.rect(), QColor(255, 255, 255, |
| 368 | static_cast<int>(std::clamp(options.overlay_alpha, 0.0, 1.0) * 255.0))); |
| 369 | alpha_painter.end(); |
| 370 | return rgba; |
| 371 | } |
| 372 | |
| 373 | static TimingStats RunCpuBenchmark(const BenchmarkOptions& options, const QImage& overlay_image) { |
| 374 | TimingStats stats; |
no outgoing calls
no test coverage detected