This bug is based on a couple of observations.
1. SurfaceFactory(Client) and CompositorFrameSink(Client) are converging and should become one thing in the future to dedup a lot of code (hundreds if not thousands of lines of code).
2. All CompositorFrameSink implementations use SurfaceFactory in essentially the same way: if we need a new surface ID, then we create it and destroy the old one.
In an effort to minimize SurfaceFactory's API footprint and continue to converge SurfaceFactory and CompositorFrameSink, I propose deleting SurfaceFactory::Create, SurfaceFactory::Destroy, and adding a LocalFrameId to the SubmitCompositorFrame interface on SurfaceFactory:
void SurfaceFactory::SubmitCompositorFrame(const LocalFrameId& local_frame_id, CompositorFrame compositor_frame);
Internally, if the local_frame_id changes, then we throw out the old Surface, and create a new one.
Comment 1 by danakj@chromium.org
, Oct 24 2016