Add a PaintRecorder to CanvasResourceProvider

This CL is the first step in creating a PaintRecord backed resource
provider for canvas OOP-R.

Changes of ownership:
- PaintRecorder entirely moved from Canvas2DLayerBridge to
- Management of needs_flush_ for MemoryManagedPaintRecorder moved to
- RestoreCanvasMatrixClipStack logic centralized to CanvasResourceHost
  and can be accessed via callback
- Backing SkiaPaintCanvas now private to CanvasResourceProvider with no
  external access. Any users of the backing SkiaPaintCanvas in
  Canvas2DLayerBridge had their functionality moved to
  CanvasResourceProvider (ie. new RestoreBackBuffer() function)

Updates to test files:
- Addition of explicit FlushCanvas() calls in tests that used to expect
  SkiaPaintCanvas to immediately update.
- Some tests expected the CanvasResourceProvider to be created on first
  draw. This expectation has been changed since the
  CanvasResourceProvider now gets set up on SetCanvasResourceHost().

Other new functionality:
- Display Item List now has a bit that tracks if it contains any draw
  operations. This is used to see if there are draw ops to flush.

Bug: 1019288
Change-Id: I717b18e22d6699dc876d8f8121a25d147738579d
Commit-Queue: Khushal <>
Reviewed-by: Aaron Krajeski <>
Reviewed-by: Juanmi Huertas <>
Reviewed-by: Fernando Serboncini <>
Reviewed-by: Khushal <>
Cr-Commit-Position: refs/heads/master@{#743002}
18 files changed