This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AcrylicBackdrop.hpp
526 lines (465 loc) · 19.1 KB
/
AcrylicBackdrop.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
#pragma once
#include "DCompBackdrop.hpp"
#include "CrossFadeEffect.hpp"
#include "GaussianBlurEffect.hpp"
#include "ColorSourceEffect.hpp"
#include "OpacityEffect.hpp"
#include "BorderEffect.hpp"
#include "BlendEffect.hpp"
namespace AcrylicEverywhere
{
struct CAcrylicResources : CDCompResources
{
float lightMode_Active_TintOpacity{};
float lightMode_Inactive_TintOpacity{};
float darkMode_Active_TintOpacity{};
float darkMode_Inactive_TintOpacity{};
std::optional<float> lightMode_Active_LuminosityOpacity{};
std::optional<float> lightMode_Inactive_LuminosityOpacity{};
std::optional<float> darkMode_Active_LuminosityOpacity{};
std::optional<float> darkMode_Inactive_LuminosityOpacity{};
float blurAmount{ 30.f };
bool hostBackdrop{ false };
static double GetTintOpacityModifier(winrt::Windows::UI::Color tintColor)
{
// This method supresses the maximum allowable tint opacity depending on the luminosity and saturation of a color by
// compressing the range of allowable values - for example, a user-defined value of 100% will be mapped to 45% for pure
// white (100% luminosity), 85% for pure black (0% luminosity), and 90% for pure gray (50% luminosity). The intensity of
// the effect increases linearly as luminosity deviates from 50%. After this effect is calculated, we cancel it out
// linearly as saturation increases from zero.
constexpr double midPoint{ 0.50 }; // Mid point of HsvV range that these calculations are based on. This is here for easy tuning.
constexpr double whiteMaxOpacity{ 0.45 }; // 100% luminosity
constexpr double midPointMaxOpacity{ 0.90 }; // 50% luminosity
constexpr double blackMaxOpacity{ 0.85 }; // 0% luminosity
const auto rgb{ RgbFromColor(tintColor) };
const auto hsv{ RgbToHsv(rgb) };
double opacityModifier{ midPointMaxOpacity };
if (hsv.v != midPoint)
{
// Determine maximum suppression amount
double lowestMaxOpacity = midPointMaxOpacity;
double maxDeviation = midPoint;
if (hsv.v > midPoint)
{
lowestMaxOpacity = whiteMaxOpacity; // At white (100% hsvV)
maxDeviation = 1 - maxDeviation;
}
else if (hsv.v < midPoint)
{
lowestMaxOpacity = blackMaxOpacity; // At black (0% hsvV)
}
double maxOpacitySuppression = midPointMaxOpacity - lowestMaxOpacity;
// Determine normalized deviation from the midpoint
const double deviation = std::abs(hsv.v - midPoint);
const double normalizedDeviation = deviation / maxDeviation;
// If we have saturation, reduce opacity suppression to allow that color to come through more
if (hsv.s > 0)
{
// Dampen opacity suppression based on how much saturation there is
#pragma push_macro("max")
#undef max
maxOpacitySuppression *= std::max(1 - (hsv.s * 2), 0.0);
#pragma pop_macro("max")
}
const double opacitySuppression = maxOpacitySuppression * normalizedDeviation;
opacityModifier = midPointMaxOpacity - opacitySuppression;
}
return opacityModifier;
}
static winrt::Windows::UI::Color GetEffectiveTintColor(winrt::Windows::UI::Color tintColor, float tintOpacity, std::optional<float> luminosityOpacity)
{
const double tintOpacityModifier{ GetTintOpacityModifier(tintColor) };
if (luminosityOpacity)
{
tintColor.A = static_cast<BYTE>(round(tintColor.A * tintOpacity));
}
else
{
const double tintOpacityModifier{ GetTintOpacityModifier(tintColor) };
tintColor.A = static_cast<BYTE>(round(tintColor.A * tintOpacity * tintOpacityModifier));
}
return tintColor;
}
// The tintColor passed into this method should be the original, unmodified color created using user values for TintColor + TintOpacity
static winrt::Windows::UI::Color GetLuminosityColor(winrt::Windows::UI::Color tintColor, std::optional<double> luminosityOpacity)
{
const Rgb rgbTintColor = RgbFromColor(tintColor);
// If luminosity opacity is specified, just use the values as is
if (luminosityOpacity)
{
return ColorFromRgba(rgbTintColor, std::clamp(luminosityOpacity.value(), 0.0, 1.0));
}
else
{
// To create the Luminosity blend input color without luminosity opacity,
// we're taking the TintColor input, converting to HSV, and clamping the V between these values
const double minHsvV = 0.125;
const double maxHsvV = 0.965;
const Hsv hsvTintColor = RgbToHsv(rgbTintColor);
const auto clampedHsvV = std::clamp(hsvTintColor.v, minHsvV, maxHsvV);
const Hsv hsvLuminosityColor = Hsv(hsvTintColor.h, hsvTintColor.s, clampedHsvV);
const Rgb rgbLuminosityColor = HsvToRgb(hsvLuminosityColor);
// Now figure out luminosity opacity
// Map original *tint* opacity to this range
const double minLuminosityOpacity = 0.15;
const double maxLuminosityOpacity = 1.03;
const double luminosityOpacityRangeMax = maxLuminosityOpacity - minLuminosityOpacity;
const double mappedTintOpacity = ((tintColor.A / 255.0) * luminosityOpacityRangeMax) + minLuminosityOpacity;
// Finally, combine the luminosity opacity and the HsvV-clamped tint color
#pragma push_macro("min")
#undef min
return ColorFromRgba(rgbLuminosityColor, std::min(mappedTintOpacity, 1.0));
#pragma pop_macro("min")
}
}
static winrt::Windows::UI::Color GetEffectiveLuminosityColor(winrt::Windows::UI::Color tintColor, float tintOpacity, std::optional<float> luminosityOpacity)
{
// Purposely leaving out tint opacity modifier here because GetLuminosityColor needs the *original* tint opacity set by the user.
tintColor.A = static_cast<uint8_t>(round(tintColor.A * tintOpacity));
return GetLuminosityColor(tintColor, luminosityOpacity);
}
static winrt::Windows::UI::Composition::CompositionBrush CreateBrush(
const winrt::Windows::UI::Composition::Compositor& compositor,
const winrt::Windows::UI::Composition::CompositionSurfaceBrush& noiceBrush,
const winrt::Windows::UI::Color& tintColor,
const winrt::Windows::UI::Color& luminosityColor,
float blurAmount,
bool hostBackdrop
) try
{
if (tintColor.A == 255)
{
return compositor.CreateColorBrush(tintColor);
}
auto tintColorEffect{ winrt::make_self<ColorSourceEffect>() };
tintColorEffect->SetName(L"TintColor");
tintColorEffect->SetColor(tintColor);
auto luminosityColorEffect{ winrt::make_self<ColorSourceEffect>() };
luminosityColorEffect->SetName(L"LuminosityColor");
luminosityColorEffect->SetColor(luminosityColor);
auto luminosityBlendEffect{ winrt::make_self<BlendEffect>() };
// NOTE: There is currently a bug where the names of BlendEffectMode::Luminosity and BlendEffectMode::Color are flipped->
// This should be changed to Luminosity when/if the bug is fixed->
luminosityBlendEffect->SetBlendMode(D2D1_BLEND_MODE_COLOR);
if (hostBackdrop)
{
luminosityBlendEffect->SetBackground(winrt::Windows::UI::Composition::CompositionEffectSourceParameter{ L"Backdrop" });
}
else
{
auto gaussianBlurEffect{ winrt::make_self<GaussianBlurEffect>() };
gaussianBlurEffect->SetName(L"Blur");
gaussianBlurEffect->SetBorderMode(D2D1_BORDER_MODE_HARD);
gaussianBlurEffect->SetBlurAmount(blurAmount);
gaussianBlurEffect->SetInput(winrt::Windows::UI::Composition::CompositionEffectSourceParameter{ L"Backdrop" });
luminosityBlendEffect->SetBackground(*gaussianBlurEffect);
}
luminosityBlendEffect->SetForeground(*luminosityColorEffect);
auto colorBlendEffect{ winrt::make_self<BlendEffect>() };
// NOTE: There is currently a bug where the names of BlendEffectMode::Luminosity and BlendEffectMode::Color are flipped->
// This should be changed to Color when/if the bug is fixed->
colorBlendEffect->SetBlendMode(D2D1_BLEND_MODE_LUMINOSITY);
colorBlendEffect->SetBackground(*luminosityBlendEffect);
colorBlendEffect->SetForeground(*tintColorEffect);
auto noiseBorderEffect{ winrt::make_self<BorderEffect>() };
noiseBorderEffect->SetExtendX(D2D1_BORDER_EDGE_MODE_WRAP);
noiseBorderEffect->SetExtendY(D2D1_BORDER_EDGE_MODE_WRAP);
winrt::Windows::UI::Composition::CompositionEffectSourceParameter noiseEffectSourceParameter{ L"Noise" };
noiseBorderEffect->SetInput(noiseEffectSourceParameter);
auto noiseOpacityEffect{ winrt::make_self<OpacityEffect>() };
noiseOpacityEffect->SetName(L"NoiseOpacity");
noiseOpacityEffect->SetOpacity(0.02f);
noiseOpacityEffect->SetInput(*noiseBorderEffect);
auto blendEffectOuter{ winrt::make_self<BlendEffect>() };
blendEffectOuter->SetBlendMode(D2D1_BLEND_MODE_MULTIPLY);
blendEffectOuter->SetBackground(*colorBlendEffect);
blendEffectOuter->SetForeground(*noiseOpacityEffect);
auto effectBrush{ compositor.CreateEffectFactory(*blendEffectOuter).CreateBrush() };
effectBrush.SetSourceParameter(L"Noise", noiceBrush);
if (hostBackdrop)
{
effectBrush.SetSourceParameter(L"Backdrop", compositor.CreateHostBackdropBrush());
}
else
{
effectBrush.SetSourceParameter(L"Backdrop", compositor.CreateBackdropBrush());
}
return effectBrush;
}
catch (...) { return nullptr; }
static winrt::Windows::UI::Composition::CompositionSurfaceBrush CreateNoiceSurfaceBrush(
const winrt::Windows::UI::Composition::Compositor& compositor,
ID2D1Device* d2dDevice
) try
{
winrt::Windows::UI::Composition::CompositionGraphicsDevice graphicsDevice{ nullptr };
THROW_IF_FAILED(
compositor.as<ABI::Windows::UI::Composition::ICompositorInterop>()->CreateGraphicsDevice(
d2dDevice,
reinterpret_cast<ABI::Windows::UI::Composition::ICompositionGraphicsDevice**>(winrt::put_abi(graphicsDevice))
)
);
auto compositionSurface
{
graphicsDevice.CreateDrawingSurface(
{ 256.f, 256.f },
winrt::Windows::Graphics::DirectX::DirectXPixelFormat::R16G16B16A16Float,
winrt::Windows::Graphics::DirectX::DirectXAlphaMode::Premultiplied
)
};
auto noiceBrush{ compositor.CreateSurfaceBrush(compositionSurface) };
wil::unique_hmodule wuxcModule{ LoadLibraryExW(L"Windows.UI.Xaml.Controls.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32 | LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE) };
THROW_LAST_ERROR_IF_NULL(wuxcModule);
auto resourceHandle{ FindResourceW(wuxcModule.get(), MAKEINTRESOURCE(2000), RT_RCDATA) };
THROW_LAST_ERROR_IF_NULL(resourceHandle);
auto globalHandle{ LoadResource(wuxcModule.get(), resourceHandle) };
THROW_LAST_ERROR_IF_NULL(globalHandle);
auto cleanUp = wil::scope_exit([&]
{
if (globalHandle)
{
UnlockResource(globalHandle);
FreeResource(globalHandle);
}
});
DWORD resourceSize{ SizeofResource(wuxcModule.get(), resourceHandle) };
THROW_LAST_ERROR_IF(resourceSize == 0);
auto resourceAddress{ reinterpret_cast<PBYTE>(LockResource(globalHandle)) };
winrt::com_ptr<IStream> stream{ SHCreateMemStream(resourceAddress, resourceSize), winrt::take_ownership_from_abi };
THROW_LAST_ERROR_IF_NULL(stream);
winrt::com_ptr<IWICImagingFactory2> wicFactory{ nullptr };
wicFactory.copy_from(uDwmPrivates::CDesktopManager::s_pDesktopManagerInstance->GetWICFactory());
winrt::com_ptr<IWICBitmapDecoder> wicDecoder{ nullptr };
THROW_IF_FAILED(wicFactory->CreateDecoderFromStream(stream.get(), &GUID_VendorMicrosoft, WICDecodeMetadataCacheOnDemand, wicDecoder.put()));
winrt::com_ptr<IWICBitmapFrameDecode> wicFrame{ nullptr };
THROW_IF_FAILED(wicDecoder->GetFrame(0, wicFrame.put()));
winrt::com_ptr<IWICFormatConverter> wicConverter{ nullptr };
THROW_IF_FAILED(wicFactory->CreateFormatConverter(wicConverter.put()));
winrt::com_ptr<IWICPalette> wicPalette{ nullptr };
THROW_IF_FAILED(
wicConverter->Initialize(
wicFrame.get(),
GUID_WICPixelFormat32bppPBGRA,
WICBitmapDitherTypeNone,
wicPalette.get(),
0, WICBitmapPaletteTypeCustom
)
);
winrt::com_ptr<IWICBitmap> wicBitmap{ nullptr };
THROW_IF_FAILED(wicFactory->CreateBitmapFromSource(wicConverter.get(), WICBitmapCreateCacheOption::WICBitmapNoCache, wicBitmap.put()));
auto drawingSurfaceInterop{ compositionSurface.as<ABI::Windows::UI::Composition::ICompositionDrawingSurfaceInterop>() };
POINT offset = { 0, 0 };
winrt::com_ptr<ID2D1DeviceContext> d2dContext{ nullptr };
THROW_IF_FAILED(
drawingSurfaceInterop->BeginDraw(nullptr, IID_PPV_ARGS(d2dContext.put()), &offset)
);
d2dContext->Clear();
winrt::com_ptr<ID2D1Bitmap1> d2dBitmap{ nullptr };
d2dContext->CreateBitmapFromWicBitmap(
wicBitmap.get(),
D2D1::BitmapProperties1(
D2D1_BITMAP_OPTIONS_NONE,
D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED)
),
d2dBitmap.put()
);
d2dContext->DrawBitmap(d2dBitmap.get());
THROW_IF_FAILED(
drawingSurfaceInterop->EndDraw()
);
return noiceBrush;
}
catch (...) { return nullptr; }
void STDMETHODCALLTYPE ReloadParameters()
{
darkMode_Active_Color = { 255, 44, 44, 44 };
darkMode_Inactive_Color = { 255, 44, 44, 44 };
lightMode_Active_Color = { 255, 252, 252, 252 };
lightMode_Inactive_Color = { 255, 252, 252, 252 };
lightMode_Active_TintOpacity = 0.f;
lightMode_Inactive_TintOpacity = 0.f;
darkMode_Active_TintOpacity = 0.5f;
darkMode_Inactive_TintOpacity = 0.5f;
lightMode_Active_LuminosityOpacity = 0.9f;
lightMode_Inactive_LuminosityOpacity = 0.9f;
darkMode_Active_LuminosityOpacity = 0.96f;
darkMode_Inactive_LuminosityOpacity = 0.96f;
}
winrt::Windows::UI::Composition::CompositionBrush STDMETHODCALLTYPE GetBrush(bool useDarkMode, bool windowActivated) override try
{
auto is_device_valid = [&]()
{
if (!interopDCompDevice) return false;
BOOL valid{ FALSE };
THROW_IF_FAILED(
interopDCompDevice.as<IDCompositionDevice>()->CheckDeviceState(
&valid
)
);
return valid == TRUE;
};
if (!is_device_valid())
{
interopDCompDevice.copy_from(
uDwmPrivates::CDesktopManager::s_pDesktopManagerInstance->GetDCompositionInteropDevice()
);
ReloadParameters();
auto compositor{ interopDCompDevice.as<winrt::Windows::UI::Composition::Compositor>() };
auto noiceBrush{ CreateNoiceSurfaceBrush(compositor, uDwmPrivates::CDesktopManager::s_pDesktopManagerInstance->GetD2DDevice()) };
lightMode_Active_Brush = CreateBrush(
compositor,
noiceBrush,
GetEffectiveTintColor(lightMode_Active_Color, lightMode_Active_TintOpacity, lightMode_Active_LuminosityOpacity),
GetEffectiveLuminosityColor(lightMode_Active_Color, lightMode_Active_TintOpacity, lightMode_Active_LuminosityOpacity),
blurAmount,
hostBackdrop
);
lightMode_Inactive_Brush = CreateBrush(
compositor,
noiceBrush,
GetEffectiveTintColor(lightMode_Inactive_Color, lightMode_Inactive_TintOpacity, lightMode_Inactive_LuminosityOpacity),
GetEffectiveLuminosityColor(lightMode_Inactive_Color, lightMode_Inactive_TintOpacity, lightMode_Inactive_LuminosityOpacity),
blurAmount,
hostBackdrop
);
darkMode_Active_Brush = CreateBrush(
compositor,
noiceBrush,
GetEffectiveTintColor(darkMode_Active_Color, darkMode_Active_TintOpacity, darkMode_Active_LuminosityOpacity),
GetEffectiveLuminosityColor(darkMode_Active_Color, darkMode_Active_TintOpacity, darkMode_Active_LuminosityOpacity),
blurAmount,
hostBackdrop
);
darkMode_Inactive_Brush = CreateBrush(
compositor,
noiceBrush,
GetEffectiveTintColor(darkMode_Inactive_Color, darkMode_Inactive_TintOpacity, darkMode_Inactive_LuminosityOpacity),
GetEffectiveLuminosityColor(darkMode_Inactive_Color, darkMode_Inactive_TintOpacity, darkMode_Inactive_LuminosityOpacity),
blurAmount,
hostBackdrop
);
}
return CDCompResources::GetBrush(useDarkMode, windowActivated);
}
catch (...) { return nullptr; }
};
struct CAcrylicBackdrop : CDCompBackdrop
{
inline static CAcrylicResources s_sharedResources{};
STDMETHOD(UpdateColorizationColor)(
bool useDarkMode,
bool windowActivated
) override
{
if (useDarkMode)
{
if (windowActivated) { currentColor = s_sharedResources.darkMode_Active_Color; }
else { currentColor = s_sharedResources.darkMode_Inactive_Color; }
}
else
{
if (windowActivated) { currentColor = s_sharedResources.lightMode_Active_Color; }
else { currentColor = s_sharedResources.lightMode_Inactive_Color; }
}
return S_OK;
}
HRESULT STDMETHODCALLTYPE Update(
bool useDarkMode,
bool windowActivated
) try
{
THROW_IF_FAILED(UpdateColorizationColor(useDarkMode, windowActivated));
THROW_IF_FAILED(
TryCrossFadeToNewBrush(
spriteVisual.Compositor(),
s_sharedResources.GetBrush(useDarkMode, windowActivated)
)
);
return S_OK;
}
CATCH_RETURN()
};
struct CAccentAcrylicResources : CDCompResourcesBase
{
winrt::com_ptr<DCompPrivates::IDCompositionDesktopDevicePartner> interopDCompDevice{ nullptr };
winrt::Windows::UI::Composition::CompositionSurfaceBrush noiceBrush{ nullptr };
HRESULT STDMETHODCALLTYPE EnsureNoiceSurfaceBrush() try
{
auto is_device_valid = [&]()
{
if (!interopDCompDevice) return false;
BOOL valid{ FALSE };
THROW_IF_FAILED(
interopDCompDevice.as<IDCompositionDevice>()->CheckDeviceState(
&valid
)
);
return valid == TRUE;
};
if (!is_device_valid())
{
interopDCompDevice.copy_from(
uDwmPrivates::CDesktopManager::s_pDesktopManagerInstance->GetDCompositionInteropDevice()
);
noiceBrush = CAcrylicResources::CreateNoiceSurfaceBrush(
interopDCompDevice.as<winrt::Windows::UI::Composition::Compositor>(),
uDwmPrivates::CDesktopManager::s_pDesktopManagerInstance->GetD2DDevice()
);
}
return S_OK;
}
CATCH_RETURN()
};
struct CAccentAcrylicBackdrop : CAccentDCompBackdrop
{
inline static CAccentAcrylicResources s_sharedResources{};
bool usingLuminosity{ false };
bool firstTimeUpdated{ false };
winrt::Windows::UI::Color currenTintColor{};
HRESULT STDMETHODCALLTYPE UpdateBrush(const uDwmPrivates::ACCENT_POLICY& policy) try
{
THROW_IF_FAILED(s_sharedResources.EnsureNoiceSurfaceBrush());
auto compositor{ spriteVisual.Compositor() };
auto useLuminosity
{
SystemHelper::g_buildNumber >= 22000 &&
(policy.AccentFlags & 2) != 0 &&
(
(policy.AccentState == 3 && SystemHelper::g_buildNumber > 22000) ||
(policy.AccentState == 4)
)
};
auto tintColor{ FromAbgr(policy.dwGradientColor) };
if (
usingLuminosity != useLuminosity ||
currenTintColor != tintColor ||
firstTimeUpdated == false
)
{
firstTimeUpdated = true;
usingLuminosity = useLuminosity;
currenTintColor = tintColor;
auto tintOpacity{ static_cast<float>(tintColor.A) / 255.f };
tintColor.A = 255;
spriteVisual.Brush(
CAcrylicResources::CreateBrush(
compositor,
s_sharedResources.noiceBrush,
CAcrylicResources::GetEffectiveTintColor(tintColor, tintOpacity, useLuminosity ? std::optional{ 1.03f } : std::nullopt),
CAcrylicResources::GetEffectiveLuminosityColor(tintColor, tintOpacity, useLuminosity ? std::optional{ 1.03f } : std::nullopt),
CAcrylicBackdrop::s_sharedResources.blurAmount,
CAcrylicBackdrop::s_sharedResources.hostBackdrop
)
);
}
return S_OK;
}
CATCH_RETURN()
HRESULT STDMETHODCALLTYPE Update(const uDwmPrivates::ACCENT_POLICY& policy) override try
{
THROW_IF_FAILED(UpdateBrush(policy));
return S_OK;
}
CATCH_RETURN()
};
}