Bug 1656266 - Make the window client size atomic to avoid a read/write race. r=mstange

Differential Revision: https://phabricator.services.mozilla.com/D90582
This commit is contained in:
Alexis Beingessner 2020-09-17 19:30:53 +00:00
Родитель 66762b6cd1
Коммит b0d53f9f52
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -76,7 +76,15 @@ class GtkCompositorWidget : public CompositorWidget,
nsWindow* mWidget;
private:
LayoutDeviceIntSize mClientSize;
// Webrender can try to poll this while we're handling a window resize event.
// This read/write race is largely benign because it's fine if webrender and
// the window desync for a frame (leading to the page displaying
// larger/smaller than the window for a split second) -- nobody expects
// perfect rendering while resizing a window. This atomic doesn't change the
// fact that the window and content can display at different sizes, but it
// does make it Not Undefined Behaviour, and also ensures webrender only
// ever uses the old or new size, and not some weird synthesis of the two.
Atomic<LayoutDeviceIntSize> mClientSize;
WindowSurfaceProvider mProvider;