Bug 1891063 - Various clean-ups in windows widget code (no functional changes). r=win-reviewers,gfx-reviewers,bradwerth,rkraesig

Just some clean-ups that I accumulated while going over this code.

Depends on D207299

Differential Revision: https://phabricator.services.mozilla.com/D207300
This commit is contained in:
Emilio Cobos Álvarez 2024-04-16 01:49:32 +00:00
parent 7fa9ee5090
commit b3c66305ec
3 changed files with 13 additions and 26 deletions

View file

@ -36,8 +36,7 @@
#undef PW_RENDERFULLCONTENT
#define PW_RENDERFULLCONTENT 0x00000002
namespace mozilla {
namespace wr {
namespace mozilla::wr {
extern LazyLogModule gRenderThreadLog;
#define LOG(...) MOZ_LOG(gRenderThreadLog, LogLevel::Debug, (__VA_ARGS__))
@ -440,11 +439,9 @@ RenderedFrameId RenderCompositorANGLE::EndFrame(
if (!UseCompositor()) {
auto start = TimeStamp::Now();
if (mWidget->AsWindows()->HasFxrOutputHandler()) {
if (auto* fxrHandler = mWidget->AsWindows()->GetFxrOutputHandler()) {
// There is a Firefox Reality handler for this swapchain. Update this
// window's contents to the VR window.
FxROutputHandler* fxrHandler =
mWidget->AsWindows()->GetFxrOutputHandler();
if (fxrHandler->TryInitialize(mSwapChain, mDevice)) {
fxrHandler->UpdateOutput(mCtx);
}
@ -926,12 +923,9 @@ void RenderCompositorANGLE::InitializeUsePartialPresent() {
// Even when mSwapChain1 is null, we could enable WR partial present, since
// when mSwapChain1 is null, SwapChain is blit model swap chain with one
// buffer.
if (UseCompositor() || mWidget->AsWindows()->HasFxrOutputHandler() ||
gfx::gfxVars::WebRenderMaxPartialPresentRects() <= 0) {
mUsePartialPresent = false;
} else {
mUsePartialPresent = true;
}
mUsePartialPresent = !UseCompositor() &&
!mWidget->AsWindows()->HasFxrOutputHandler() &&
gfx::gfxVars::WebRenderMaxPartialPresentRects() > 0;
}
bool RenderCompositorANGLE::UsePartialPresent() { return mUsePartialPresent; }
@ -1021,5 +1015,4 @@ bool RenderCompositorANGLE::MaybeReadback(
return true;
}
} // namespace wr
} // namespace mozilla
} // namespace mozilla::wr

View file

@ -149,16 +149,12 @@ mozilla::ipc::IPCResult CompositorWidgetParent::RecvNotifyVisibilityUpdated(
return IPC_OK();
}
nsSizeMode CompositorWidgetParent::CompositorWidgetParent::GetWindowSizeMode()
const {
nsSizeMode sizeMode = mSizeMode;
return sizeMode;
nsSizeMode CompositorWidgetParent::GetWindowSizeMode() const {
return mSizeMode;
}
bool CompositorWidgetParent::CompositorWidgetParent::GetWindowIsFullyOccluded()
const {
bool isFullyOccluded = mIsFullyOccluded;
return isFullyOccluded;
bool CompositorWidgetParent::GetWindowIsFullyOccluded() const {
return mIsFullyOccluded;
}
mozilla::ipc::IPCResult CompositorWidgetParent::RecvClearTransparentWindow() {

View file

@ -18,8 +18,7 @@
class nsWindow;
namespace mozilla {
namespace widget {
namespace mozilla::widget {
class PlatformCompositorWidgetDelegate : public CompositorWidgetDelegate {
public:
@ -74,7 +73,7 @@ class WinCompositorWidget : public CompositorWidget {
void UpdateCompositorWndSizeIfNecessary();
void RequestFxrOutput();
bool HasFxrOutputHandler() const { return mFxrHandler != nullptr; }
bool HasFxrOutputHandler() const { return !!mFxrHandler; }
FxROutputHandler* GetFxrOutputHandler() const { return mFxrHandler.get(); }
virtual nsSizeMode GetWindowSizeMode() const = 0;
@ -97,7 +96,6 @@ class WinCompositorWidget : public CompositorWidget {
UniquePtr<FxROutputHandler> mFxrHandler;
};
} // namespace widget
} // namespace mozilla
} // namespace mozilla::widget
#endif // widget_windows_WinCompositorWidget_h