Bug 1347710 Comment 43 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I spent a fair amount of time this week looking through the GPU compositing code to try and understand how it all fits together so I could understand where the right places are to "borrow" the buffer and then present the buffer in the UI process before GPU compositing starts.

I believe now that the right places to do this are right before the `ClientLayerManager` calls [ShadowLayerForwarder::EndTransaction](https://searchfox.org/mozilla-central/rev/250f5cc9fb8bdcbb6b23d2a06acfd48addb2f99b/gfx/layers/client/ClientLayerManager.cpp#741) to begin the process of sending the layer tree updates to the GPU process for compositing with a "transaction id" it generates above and stores in `mLatestTransactionId`. Then the buffer should be presented when the UI process receives the `LayerManager::DidComposite` message from the GPU process, specifically [this function](https://searchfox.org/mozilla-central/rev/250f5cc9fb8bdcbb6b23d2a06acfd48addb2f99b/gfx/layers/client/ClientLayerManager.cpp#494) where the same `ClientLayerManager` from above is invoked with the same "transaction id" as above, letting it know that it's fine to retire the buffer.

I am currently writing up code to test this. I should be ready to test soon, and hopefully it works! *fingers crossed*
I spent a fair amount of time this week looking through the GPU compositing code to try and understand how it all fits together so I could understand where the right places are to "borrow" the buffer in the UI process before GPU compositing starts, and then where to present the buffer after compositing ends.

I believe now that the right places to do this are right before the `ClientLayerManager` calls [ShadowLayerForwarder::EndTransaction](https://searchfox.org/mozilla-central/rev/250f5cc9fb8bdcbb6b23d2a06acfd48addb2f99b/gfx/layers/client/ClientLayerManager.cpp#741) to begin the process of sending the layer tree updates to the GPU process for compositing with a "transaction id" it generates above and stores in `mLatestTransactionId`. Then the buffer should be presented when the UI process receives the `LayerManager::DidComposite` message from the GPU process, specifically [this function](https://searchfox.org/mozilla-central/rev/250f5cc9fb8bdcbb6b23d2a06acfd48addb2f99b/gfx/layers/client/ClientLayerManager.cpp#494) where the same `ClientLayerManager` from above is invoked with the same "transaction id" as above, letting it know that it's fine to retire the buffer.

I am currently writing up code to test this. I should be ready to test soon, and hopefully it works! *fingers crossed*
I spent a fair amount of time this week looking through the GPU compositing code to try and understand how it all fits together so I could understand where the right places are to "borrow" the buffer in the UI process before GPU compositing starts, and then where to present the buffer after compositing ends.

I believe now that the right places to do this are: right before the `ClientLayerManager` calls [ShadowLayerForwarder::EndTransaction](https://searchfox.org/mozilla-central/rev/250f5cc9fb8bdcbb6b23d2a06acfd48addb2f99b/gfx/layers/client/ClientLayerManager.cpp#741) to begin the process of sending the layer tree updates to the GPU process for compositing with a "transaction id" it generates above and stores in `mLatestTransactionId`. Then the buffer should be presented when the UI process receives the `LayerManager::DidComposite` message from the GPU process, specifically [this function](https://searchfox.org/mozilla-central/rev/250f5cc9fb8bdcbb6b23d2a06acfd48addb2f99b/gfx/layers/client/ClientLayerManager.cpp#494) where the same `ClientLayerManager` from above is invoked with the same "transaction id" as above, letting it know that it's fine to retire the buffer.

I am currently writing up code to test this. I should be ready to test soon, and hopefully it works! *fingers crossed*
I spent a fair amount of time this week looking through the GPU compositing code to try and understand how it all fits together so I could understand where the right places are to "borrow" the buffer in the UI process before GPU compositing starts, and then where to present the buffer after compositing ends.

I believe now that the right places to do this are: 
- Right before the `ClientLayerManager` calls [ShadowLayerForwarder::EndTransaction](https://searchfox.org/mozilla-central/rev/250f5cc9fb8bdcbb6b23d2a06acfd48addb2f99b/gfx/layers/client/ClientLayerManager.cpp#741) to begin the process of sending the layer tree updates to the GPU process for compositing with a "transaction id" it generates above and stores in `mLatestTransactionId`.
- After the UI process receives the `LayerManager::DidComposite` message from the GPU process, specifically [this function](https://searchfox.org/mozilla-central/rev/250f5cc9fb8bdcbb6b23d2a06acfd48addb2f99b/gfx/layers/client/ClientLayerManager.cpp#494) where the same `ClientLayerManager` from above is invoked with the same "transaction id" as above, letting it know that it's fine to retire the buffer.

I am currently writing up code to test this. I should be ready to test soon, and hopefully it works! *fingers crossed*

Back to Bug 1347710 Comment 43