Right now DirectRenderer goes thru ResourceProvider as a nice abstraction of GL vs Software resources.
This is the right thing to do for accessing resources sent in the frame. But for resources it allocates itself, it is extra overhead to require those resources be in shared memory since they are never going anywhere.
This forces SynchronousCompositorFrameSink to take a SharedBitmapManager to give to the Display for resourceless software mode. And makes software compositing less efficient everywhere.
There's 2 general ways to fix this:
1) Add a CreateResource() mode to ResourceProvider that gives a local resource. It wouldn't need to differ for GL but would for software.
2) Don't use ResourceProvider to allocate RenderPass resources directly. Go thru the DirectRenderer's subclass (GLRenderer or SoftwareRenderer). The GLRenderer could go to ResourceProvider. The SoftwareRenderer could use malloc. It would require not using "Resource" in the DirectRenderer and providing some other general type to be used there.
Comment 1 by jbau...@chromium.org
, Feb 16 2017