Skip to content

Commit

Permalink
Bug 1656266 - Make the window client size atomic to avoid a read/writ…
Browse files Browse the repository at this point in the history
…e race. r=mstange

Differential Revision: https://phabricator.services.mozilla.com/D90582
  • Loading branch information
Gankra committed Sep 17, 2020
1 parent 73186d6 commit 486c097
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion widget/gtk/GtkCompositorWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 486c097

Please sign in to comment.