Currently, SubmitFrame() only submits the frame for overlay surfaces on iOS. However, the background canvas is also mutated in this method. This requires a GL/Metal context switches from background -> overlay -> background surface. However, this isn't possible with the EGL API.
The proposed change is to pass background_frame to SubmitFrame() directly. However, this currently creates a circular dependency. To solve this issue, SurfaceFrame should be put into its own surface_frame.* file.
This way this can be done:
-embedder->SubmitFrame(gr_context, background_frame->SkiaCanvas());
+embedder->SubmitFrame(gr_context, background_frame);
Another alternative is to do a more complex refactor and pass background_frame to SubmitFrame directly. However, this creates a circular dependency currently.