Closed Bug 1320817 Opened 3 years ago Closed 3 years ago

Move child process PAPZ initialization to InitRenderingState

Categories

(Core :: Graphics, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: rhunt, Assigned: rhunt)

Details

Attachments

(1 file)

Currently PAPZ is initialized in the child process in a callback IPDL message when a layer tree ID has been allocated [1]. This is confusing and not necessary to my knowledge. In addition it also is causing a race condition when the GPU process restarts.

It would be best to simplify this to follow the logic of how we initialize PAPZCTreeManager.

[1] http://searchfox.org/mozilla-central/rev/957458d8fa2328c2a760dbb30e7f1f1efa55b4d0/dom/ipc/ContentChild.cpp#1501
This patch moves the initialization of the content PAPZ from ContentChild::RecvNotifyLayerAllocated to TabChild::InitAPZState which is a new function used in TabChild::InitRenderingState and TabChild::ReinitRenderingState. This makes it have the same behavior as PAPZCTreeManager.
Attachment #8815159 - Flags: review?(bugmail)
Comment on attachment 8815159 [details] [diff] [review]
cleanup-apz-init.patch

Review of attachment 8815159 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM

::: dom/ipc/TabChild.h
@@ -787,5 @@
>  
>    RefPtr<layers::IAPZCTreeManager> mApzcTreeManager;
> -  // APZChild clears this pointer from its destructor, so it shouldn't be a
> -  // dangling pointer.
> -  layers::APZChild* mAPZChild;

Huh, thanks for taking this out.

::: gfx/layers/apz/util/ContentProcessController.h
@@ +35,5 @@
>  class ContentProcessController final
>        : public GeckoContentController
>  {
>  public:
> +  explicit ContentProcessController(RefPtr<dom::TabChild> aBrowser);

nit: Have this take a const RefPtr<dom::TabChild>&
Attachment #8815159 - Flags: review?(bugmail) → review+
Pushed by rhunt@eqrion.net:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1d9ec0ad1388
Move child process PAPZ initialization into TabChild::InitRenderingState. r=kats
https://hg.mozilla.org/mozilla-central/rev/1d9ec0ad1388
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.