From c93b638ac0bd6c1a2fc06ffce5fd4b2f84ad89bf Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 2 Apr 2026 16:50:51 +0300 Subject: [PATCH] [thanos] Added debug logging to effect capture and render pipeline. --- Telegram/SourceFiles/history/history_inner_widget.cpp | 10 ++++++++-- Telegram/SourceFiles/ui/effects/thanos_effect.cpp | 7 ++++++- .../SourceFiles/ui/effects/thanos_effect_renderer.cpp | 4 ++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 5e9bfa3780..84260f5f89 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -4208,11 +4208,17 @@ void HistoryInner::captureViewForThanosEffect( auto context = preparePaintContext(clip); context.clip = clip; context.outbg = view->hasOutLayout(); - context.translate(0, -top); - p.translate(0, top); view->draw(p, context); } + LOG(("ThanosEffect: captured view %1x%2, screenTop=%3, " + "image null=%4, allTransparent=%5") + .arg(viewWidth) + .arg(viewHeight) + .arg(screenTop) + .arg(image.isNull()) + .arg(image.pixelColor(viewWidth / 2, viewHeight / 2).alpha() == 0)); + if (!_thanosEffect) { _thanosEffect = std::make_unique( _scroll.get()); diff --git a/Telegram/SourceFiles/ui/effects/thanos_effect.cpp b/Telegram/SourceFiles/ui/effects/thanos_effect.cpp index 6f4041c061..0b795f493e 100644 --- a/Telegram/SourceFiles/ui/effects/thanos_effect.cpp +++ b/Telegram/SourceFiles/ui/effects/thanos_effect.cpp @@ -71,10 +71,15 @@ void ThanosEffect::ensureSurface() { void ThanosEffect::showSurface() { if (const auto w = _surface ? _surface->rpWidget() : nullptr) { - w->setGeometry(_parent->rect()); + const auto r = _parent->rect(); + LOG(("ThanosEffect: showSurface, parent rect=%1,%2 %3x%4") + .arg(r.x()).arg(r.y()).arg(r.width()).arg(r.height())); + w->setGeometry(r); w->show(); w->raise(); startUpdateTimer(); + } else { + LOG(("ThanosEffect: showSurface FAILED, no widget")); } } diff --git a/Telegram/SourceFiles/ui/effects/thanos_effect_renderer.cpp b/Telegram/SourceFiles/ui/effects/thanos_effect_renderer.cpp index 9bf24c1b70..301507153f 100644 --- a/Telegram/SourceFiles/ui/effects/thanos_effect_renderer.cpp +++ b/Telegram/SourceFiles/ui/effects/thanos_effect_renderer.cpp @@ -257,6 +257,10 @@ void ThanosEffectRenderer::render( return; } + LOG(("ThanosEffect render: %1 items, phase=%2") + .arg(_items.size()) + .arg(_items.front().phase)); + const auto pixelSize = rt->pixelSize(); const auto factor = style::DevicePixelRatio(); const auto viewW = float(pixelSize.width()) / factor;