Protect layers from concurrent CompositeToTarget calls

NEW
Unassigned

Status

()

Core
Graphics: Layers
3 years ago
3 years ago

People

(Reporter: tatiana, Unassigned)

Tracking

Trunk
ARM
Mer
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Created attachment 8495409 [details] [diff] [review]
Reject rendering if Compositor has active render target

In EmbedLite unit tests https://github.com/tmeshkova/gecko-dev/blob/embedlite/embedding/embedlite/tests/embedLiteViewInitTest.cpp#L57
I do call CompositeToTarget in order to render content to image, and that conflicts with CompositorParent::CompositeCallback which get's called automatically on first content paint.

So we have two CompositeToTarget calls one after another, and we crashing in BasicCompositor::EndFrame with mRenderTarget == null, because previous EndFrame destroyed mRenderTarget pointer

Here is the simple fix to reject CompositeToTarget if some rendering already in progress.
Let me know if there are better place to do same thing.
(Reporter)

Updated

3 years ago
Attachment #8495409 - Flags: review?(matt.woodrow)
Can you explain this more please.

mRenderTarget for BasicCompositor should only be valid within BeginFrame/EndFrame calls. How are we getting another call to CompositeToTarget while we're already in the middle of compositing a frame? A different thead?
Attachment #8495409 - Flags: review?(matt.woodrow)
(Reporter)

Comment 2

3 years ago
No I see exactly the same thread for both calls, and sounds like something between Begin/End frame are spinning event loop and allow to call another BeginFrame before previous call finished
You need to log in before you can comment on or make changes to this bug.