forked from mirrors/gecko-dev
This should make the optimization landed earlier in this bug apply for some of the NotifyThemeChanged() calls in nsWindow.cpp which are causing all the extra invalidations. If we know that system colors/fonts didn't change, we can avoid doing a bunch of reflow work and the patch from earlier in the bug can avoid re-rasterizing images too. Differential Revision: https://phabricator.services.mozilla.com/D94425
31 lines
1 KiB
C++
31 lines
1 KiB
C++
/* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*-
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef GeckoSystemStateListener_h
|
|
#define GeckoSystemStateListener_h
|
|
|
|
#include "mozilla/Assertions.h"
|
|
#include "mozilla/LookAndFeel.h"
|
|
#include "mozilla/java/GeckoSystemStateListenerNatives.h"
|
|
|
|
namespace mozilla {
|
|
|
|
class GeckoSystemStateListener final
|
|
: public java::GeckoSystemStateListener::Natives<GeckoSystemStateListener> {
|
|
GeckoSystemStateListener() = delete;
|
|
|
|
public:
|
|
static void OnDeviceChanged() {
|
|
MOZ_ASSERT(NS_IsMainThread());
|
|
// TODO(emilio, bug 1673318): This could become more granular and avoid work
|
|
// if we get whether these are layout/style-affecting from the caller.
|
|
mozilla::LookAndFeel::NotifyChangedAllWindows(
|
|
widget::ThemeChangeKind::StyleAndLayout);
|
|
}
|
|
};
|
|
|
|
} // namespace mozilla
|
|
|
|
#endif // GeckoSystemStateListener_h
|