surfaceflinger: switch RE color matrices lazily

Client composition in doComposeSurfaces normally needs to handle

  N sRGB layers, when in ColorMode::SRGB
  N P3 layer and then M sRGB layers, when in ColorMode::DISPLAY_P3

Constantly switching and restoring RE color matrices when handling
sRGB layers is less efficient.  Do the switches lazily.

We don't really care about the current RE color matrix when
doComposeSurfaces is called, and we already assume it to be
identity.  Update RenderEngine::setupColorTransform not to return
the current color matrix.

Bug: 78891890
Test: night light under Boosted/Enhanced and sRGB/P3
Change-Id: I3b785c2a05f2e1679e486ab2497fc0e13993a791
diff --git a/services/surfaceflinger/RenderEngine/RenderEngine.h b/services/surfaceflinger/RenderEngine/RenderEngine.h
index df9e6a7..d559464 100644
--- a/services/surfaceflinger/RenderEngine/RenderEngine.h
+++ b/services/surfaceflinger/RenderEngine/RenderEngine.h
@@ -112,7 +112,7 @@
     virtual void setupLayerBlackedOut() = 0;
     virtual void setupFillWithColor(float r, float g, float b, float a) = 0;
 
-    virtual mat4 setupColorTransform(const mat4& /* colorTransform */) = 0;
+    virtual void setupColorTransform(const mat4& /* colorTransform */) = 0;
 
     virtual void disableTexturing() = 0;
     virtual void disableBlending() = 0;
@@ -224,7 +224,7 @@
 
     void checkErrors() const override;
 
-    mat4 setupColorTransform(const mat4& /* colorTransform */) override { return mat4(); }
+    void setupColorTransform(const mat4& /* colorTransform */) override {}
 
     // internal to RenderEngine
     EGLDisplay getEGLDisplay() const;