| 36 | } |
| 37 | |
| 38 | HRESULT GlassFrameHandler::UpdateReflectionViewport(uDWM::CTopLevelWindow* window) |
| 39 | { |
| 40 | const auto active = window->TreatAsActiveWindow(); |
| 41 | const auto maximized = window->TreatAsMaximized(); |
| 42 | const auto desktop = window->GetTransformParent(); |
| 43 | const auto opacity = GlassKernel::GetAdjustedReflectionIntensity(active, maximized); |
| 44 | if ( |
| 45 | const auto legacyVisual = window->GetLegacyVisual(); |
| 46 | legacyVisual |
| 47 | ) |
| 48 | { |
| 49 | if ( |
| 50 | const auto brush = GlassReflectionBrush::GetOrCreate(window, 0); |
| 51 | brush && |
| 52 | !window->IsOffscreen() |
| 53 | ) |
| 54 | { |
| 55 | RETURN_IF_FAILED( |
| 56 | brush->Update( |
| 57 | (Shared::g_reflectionPolicy & Shared::ReflectionPolicy::NonClient) ? |
| 58 | opacity : |
| 59 | 0.f, |
| 60 | GlassReflectionBrush::CalculateTargetViewport( |
| 61 | legacyVisual->GetLocalToParentVisualOffset(desktop), |
| 62 | Shared::g_reflectionParallaxIntensity, |
| 63 | window->IsRTLMirrored(), |
| 64 | legacyVisual->GetWidth(), |
| 65 | legacyVisual->GetScale() |
| 66 | ), |
| 67 | D2D1::RectF(), |
| 68 | nullptr, |
| 69 | DWM::MilBrushMappingMode::Absolute, |
| 70 | DWM::MilBrushMappingMode::Absolute, |
| 71 | nullptr, |
| 72 | nullptr, |
| 73 | DWM::MilStretch::None, |
| 74 | DWM::MilTileMode::Extend, |
| 75 | DWM::MilHorizontalAlignment::Left, |
| 76 | DWM::MilVerticalAlignment::Top, |
| 77 | nullptr |
| 78 | ) |
| 79 | ); |
| 80 | } |
| 81 | } |
| 82 | if ( |
| 83 | const auto clientBlurVisual = window->GetClientBlurVisual(); |
| 84 | clientBlurVisual |
| 85 | ) |
| 86 | { |
| 87 | if ( |
| 88 | const auto brush = GlassReflectionBrush::GetOrCreate(window, 1); |
| 89 | brush && |
| 90 | !window->IsOffscreen() |
| 91 | ) |
| 92 | { |
| 93 | RETURN_IF_FAILED( |
| 94 | brush->Update( |
| 95 | (Shared::g_reflectionPolicy & Shared::ReflectionPolicy::NonClient) ? |
nothing calls this directly
no test coverage detected