MCPcopy Create free account
hub / github.com/ALTaleX531/OpenGlass / UpdateReflectionViewport

Method UpdateReflectionViewport

OpenGlass/GlassFrameHandler.cpp:38–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38HRESULT 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) ?

Callers

nothing calls this directly

Calls 12

TreatAsActiveWindowMethod · 0.80
TreatAsMaximizedMethod · 0.80
GetTransformParentMethod · 0.80
GetLegacyVisualMethod · 0.80
IsOffscreenMethod · 0.80
GetWidthMethod · 0.80
GetScaleMethod · 0.80
GetClientBlurVisualMethod · 0.80
GetAccentMethod · 0.80
UpdateMethod · 0.45
IsRTLMirroredMethod · 0.45

Tested by

no test coverage detected