Tonemap everywhere in PixelCopy

* Hookup tonemap support for PixelCopying a SurfaceView
* Fix issue in PixelCopying a SurfaceView where the wrong dataspace was
  retrieved from the last queued buffer, since the bufferqueue dataspace
  may drift due to another process like camera setting the dataspace
  without being propagated to the app process
* Cleanup LayerDrawable to share code

Bug: 238395777
Test: Switching HDR cameras doesn't color shift
Test: TextureView playback in Photos
Change-Id: I0fd1bd86410630acfbb7de72339874a3d0ecac58
diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp
index c0a4fdf..88cfed9 100644
--- a/libs/hwui/Android.bp
+++ b/libs/hwui/Android.bp
@@ -589,6 +589,7 @@
                 "ProfileData.cpp",
                 "ProfileDataContainer.cpp",
                 "Readback.cpp",
+                "Tonemapper.cpp",
                 "TreeInfo.cpp",
                 "WebViewFunctorManager.cpp",
                 "protos/graphicsstats.proto",