[Impeller Scene] Add ColorSourceContents for drawing a node (#38485)

diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter
index 70bdd21..5a7f8c8 100644
--- a/ci/licenses_golden/licenses_flutter
+++ b/ci/licenses_golden/licenses_flutter
@@ -1259,6 +1259,8 @@
 ORIGIN: ../../../flutter/impeller/entity/contents/rrect_shadow_contents.h + ../../../flutter/LICENSE
 ORIGIN: ../../../flutter/impeller/entity/contents/runtime_effect_contents.cc + ../../../flutter/LICENSE
 ORIGIN: ../../../flutter/impeller/entity/contents/runtime_effect_contents.h + ../../../flutter/LICENSE
+ORIGIN: ../../../flutter/impeller/entity/contents/scene_contents.cc + ../../../flutter/LICENSE
+ORIGIN: ../../../flutter/impeller/entity/contents/scene_contents.h + ../../../flutter/LICENSE
 ORIGIN: ../../../flutter/impeller/entity/contents/solid_color_contents.cc + ../../../flutter/LICENSE
 ORIGIN: ../../../flutter/impeller/entity/contents/solid_color_contents.h + ../../../flutter/LICENSE
 ORIGIN: ../../../flutter/impeller/entity/contents/sweep_gradient_contents.cc + ../../../flutter/LICENSE
@@ -3716,6 +3718,8 @@
 FILE: ../../../flutter/impeller/entity/contents/rrect_shadow_contents.h
 FILE: ../../../flutter/impeller/entity/contents/runtime_effect_contents.cc
 FILE: ../../../flutter/impeller/entity/contents/runtime_effect_contents.h
+FILE: ../../../flutter/impeller/entity/contents/scene_contents.cc
+FILE: ../../../flutter/impeller/entity/contents/scene_contents.h
 FILE: ../../../flutter/impeller/entity/contents/solid_color_contents.cc
 FILE: ../../../flutter/impeller/entity/contents/solid_color_contents.h
 FILE: ../../../flutter/impeller/entity/contents/sweep_gradient_contents.cc
diff --git a/impeller/aiks/aiks_unittests.cc b/impeller/aiks/aiks_unittests.cc
index 14bdcac..d649658 100644
--- a/impeller/aiks/aiks_unittests.cc
+++ b/impeller/aiks/aiks_unittests.cc
@@ -5,6 +5,7 @@
 #include <array>
 #include <cmath>
 #include <iostream>
+#include <memory>
 #include <tuple>
 #include <utility>
 
@@ -12,7 +13,9 @@
 #include "impeller/aiks/aiks_playground.h"
 #include "impeller/aiks/canvas.h"
 #include "impeller/aiks/image.h"
+#include "impeller/entity/contents/color_source_contents.h"
 #include "impeller/entity/contents/filters/inputs/filter_input.h"
+#include "impeller/entity/contents/scene_contents.h"
 #include "impeller/entity/contents/tiled_texture_contents.h"
 #include "impeller/geometry/color.h"
 #include "impeller/geometry/geometry_unittests.h"
@@ -21,6 +24,8 @@
 #include "impeller/playground/widgets.h"
 #include "impeller/renderer/command_buffer.h"
 #include "impeller/renderer/snapshot.h"
+#include "impeller/scene/material.h"
+#include "impeller/scene/node.h"
 #include "impeller/typographer/backends/skia/text_frame_skia.h"
 #include "impeller/typographer/backends/skia/text_render_context_skia.h"
 #include "third_party/skia/include/core/SkData.h"
@@ -1700,5 +1705,53 @@
   ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
 }
 
+TEST_P(AiksTest, SceneColorSource) {
+  // Load up the scene.
+  auto mapping =
+      flutter::testing::OpenFixtureAsMapping("flutter_logo.glb.ipscene");
+  ASSERT_NE(mapping, nullptr);
+
+  std::shared_ptr<scene::Node> gltf_scene = scene::Node::MakeFromFlatbuffer(
+      *mapping, *GetContext()->GetResourceAllocator());
+  ASSERT_NE(gltf_scene, nullptr);
+
+  // Assign a material (temporary stopgap).
+  std::shared_ptr<scene::UnlitMaterial> material = scene::Material::MakeUnlit();
+  auto color_baked = CreateTextureForFixture("flutter_logo_baked.png");
+  ASSERT_NE(color_baked, nullptr);
+  material->SetColorTexture(std::move(color_baked));
+  material->SetVertexColorWeight(0);
+
+  ASSERT_EQ(gltf_scene->GetChildren().size(), 1u);
+  ASSERT_EQ(gltf_scene->GetChildren()[0]->GetMesh().GetPrimitives().size(), 1u);
+  gltf_scene->GetChildren()[0]->GetMesh().GetPrimitives()[0].material =
+      std::move(material);
+
+  auto callback = [&](AiksContext& renderer, RenderTarget& render_target) {
+    Paint paint;
+
+    paint.color_source_type = Paint::ColorSourceType::kScene;
+    paint.color_source = [this, gltf_scene]() {
+      Scalar angle = GetSecondsElapsed();
+      Scalar distance = 2;
+      auto camera_position =
+          Vector3(distance * std::sin(angle), 2, -distance * std::cos(angle));
+      auto contents = std::make_shared<SceneContents>();
+      contents->SetNode(gltf_scene);
+      contents->SetCameraTransform(
+          Matrix::MakePerspective(Degrees(45), GetWindowSize(), 0.1, 1000) *
+          Matrix::MakeLookAt(camera_position, {0, 0, 0}, {0, 1, 0}));
+      return contents;
+    };
+
+    Canvas canvas;
+    canvas.Scale(GetContentScale());
+    canvas.DrawPaint(paint);
+    return renderer.Render(canvas.EndRecordingAsPicture(), render_target);
+  };
+
+  ASSERT_TRUE(OpenPlaygroundHere(callback));
+}
+
 }  // namespace testing
 }  // namespace impeller
diff --git a/impeller/aiks/paint.h b/impeller/aiks/paint.h
index 6f37841..7db7b42 100644
--- a/impeller/aiks/paint.h
+++ b/impeller/aiks/paint.h
@@ -44,6 +44,7 @@
     kConicalGradient,
     kSweepGradient,
     kRuntimeEffect,
+    kScene,
   };
 
   struct MaskBlurDescriptor {
diff --git a/impeller/display_list/display_list_dispatcher.cc b/impeller/display_list/display_list_dispatcher.cc
index eba5782..538eff8 100644
--- a/impeller/display_list/display_list_dispatcher.cc
+++ b/impeller/display_list/display_list_dispatcher.cc
@@ -27,6 +27,7 @@
 #include "impeller/entity/contents/linear_gradient_contents.h"
 #include "impeller/entity/contents/radial_gradient_contents.h"
 #include "impeller/entity/contents/runtime_effect_contents.h"
+#include "impeller/entity/contents/scene_contents.h"
 #include "impeller/entity/contents/sweep_gradient_contents.h"
 #include "impeller/entity/contents/tiled_texture_contents.h"
 #include "impeller/entity/entity.h"
@@ -500,6 +501,20 @@
       };
       return;
     }
+    case Paint::ColorSourceType::kScene: {
+      // const flutter::DlSceneColorSource* scene_color_source =
+      // source->asScene(); std::shared_ptr<scene::Node> scene_node =
+      // scene_color_source->node(); Matrix camera_transform =
+      //   scene_color_node->camera_transform();
+
+      paint_.color_source = [/*scene_node, camera_transform*/]() {
+        auto contents = std::make_shared<SceneContents>();
+        // contents->SetNode(scene_node);
+        // contents->SetCameraTransform(camera_transform);
+        return contents;
+      };
+    }
+      return;
     case Paint::ColorSourceType::kConicalGradient:
       UNIMPLEMENTED;
       break;
diff --git a/impeller/entity/BUILD.gn b/impeller/entity/BUILD.gn
index ecba665..24702f3 100644
--- a/impeller/entity/BUILD.gn
+++ b/impeller/entity/BUILD.gn
@@ -134,6 +134,8 @@
     "contents/rrect_shadow_contents.h",
     "contents/runtime_effect_contents.cc",
     "contents/runtime_effect_contents.h",
+    "contents/scene_contents.cc",
+    "contents/scene_contents.h",
     "contents/solid_color_contents.cc",
     "contents/solid_color_contents.h",
     "contents/sweep_gradient_contents.cc",
@@ -164,6 +166,7 @@
     "../archivist",
     "../image",
     "../renderer",
+    "../scene",
     "../typographer",
   ]
 
diff --git a/impeller/entity/contents/color_source_contents.cc b/impeller/entity/contents/color_source_contents.cc
index 37e079d..c95507e 100644
--- a/impeller/entity/contents/color_source_contents.cc
+++ b/impeller/entity/contents/color_source_contents.cc
@@ -13,11 +13,11 @@
 
 ColorSourceContents::~ColorSourceContents() = default;
 
-void ColorSourceContents::SetGeometry(std::unique_ptr<Geometry> geometry) {
+void ColorSourceContents::SetGeometry(std::shared_ptr<Geometry> geometry) {
   geometry_ = std::move(geometry);
 }
 
-const std::unique_ptr<Geometry>& ColorSourceContents::GetGeometry() const {
+const std::shared_ptr<Geometry>& ColorSourceContents::GetGeometry() const {
   return geometry_;
 }
 
diff --git a/impeller/entity/contents/color_source_contents.h b/impeller/entity/contents/color_source_contents.h
index f528919..4396c38 100644
--- a/impeller/entity/contents/color_source_contents.h
+++ b/impeller/entity/contents/color_source_contents.h
@@ -18,7 +18,7 @@
 
   ~ColorSourceContents() override;
 
-  void SetGeometry(std::unique_ptr<Geometry> geometry);
+  void SetGeometry(std::shared_ptr<Geometry> geometry);
 
   void SetMatrix(Matrix matrix);
 
@@ -32,14 +32,14 @@
                     const std::optional<Rect>& stencil_coverage) const override;
 
  protected:
-  const std::unique_ptr<Geometry>& GetGeometry() const;
+  const std::shared_ptr<Geometry>& GetGeometry() const;
 
   const Matrix& GetInverseMatrix() const;
 
   Scalar GetAlpha() const;
 
  private:
-  std::unique_ptr<Geometry> geometry_;
+  std::shared_ptr<Geometry> geometry_;
   Matrix inverse_matrix_;
   Scalar alpha_ = 1.0;
 
diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc
index fa6c678..c6158d8 100644
--- a/impeller/entity/contents/content_context.cc
+++ b/impeller/entity/contents/content_context.cc
@@ -4,6 +4,7 @@
 
 #include "impeller/entity/contents/content_context.h"
 
+#include <memory>
 #include <sstream>
 
 #include "impeller/entity/entity.h"
@@ -146,7 +147,8 @@
 ContentContext::ContentContext(std::shared_ptr<Context> context)
     : context_(std::move(context)),
       tessellator_(std::make_shared<Tessellator>()),
-      glyph_atlas_context_(std::make_shared<GlyphAtlasContext>()) {
+      glyph_atlas_context_(std::make_shared<GlyphAtlasContext>()),
+      scene_context_(std::make_shared<scene::SceneContext>(context_)) {
   if (!context_ || !context_->IsValid()) {
     return;
   }
@@ -298,6 +300,10 @@
   return subpass_texture;
 }
 
+std::shared_ptr<scene::SceneContext> ContentContext::GetSceneContext() const {
+  return scene_context_;
+}
+
 std::shared_ptr<Tessellator> ContentContext::GetTessellator() const {
   return tessellator_;
 }
diff --git a/impeller/entity/contents/content_context.h b/impeller/entity/contents/content_context.h
index 661ac5a..a235843 100644
--- a/impeller/entity/contents/content_context.h
+++ b/impeller/entity/contents/content_context.h
@@ -8,8 +8,8 @@
 #include <unordered_map>
 
 #include "flutter/fml/hash_combine.h"
+#include "flutter/fml/logging.h"
 #include "flutter/fml/macros.h"
-#include "fml/logging.h"
 #include "impeller/base/validation.h"
 #include "impeller/entity/advanced_blend.vert.h"
 #include "impeller/entity/advanced_blend_color.frag.h"
@@ -65,11 +65,13 @@
 #include "impeller/entity/yuv_to_rgb_filter.vert.h"
 #include "impeller/renderer/formats.h"
 #include "impeller/renderer/pipeline.h"
+#include "impeller/scene/scene_context.h"
 
 #include "impeller/entity/position.vert.h"
 #include "impeller/entity/position_color.vert.h"
 #include "impeller/entity/position_uv.vert.h"
 
+#include "impeller/scene/scene_context.h"
 #include "impeller/typographer/glyph_atlas.h"
 
 #include "impeller/entity/linear_gradient_ssbo_fill.frag.h"
@@ -216,6 +218,8 @@
 
   bool IsValid() const;
 
+  std::shared_ptr<scene::SceneContext> GetSceneContext() const;
+
   std::shared_ptr<Tessellator> GetTessellator() const;
 
   std::shared_ptr<Pipeline<PipelineDescriptor>> GetLinearGradientFillPipeline(
@@ -522,6 +526,7 @@
   bool is_valid_ = false;
   std::shared_ptr<Tessellator> tessellator_;
   std::shared_ptr<GlyphAtlasContext> glyph_atlas_context_;
+  std::shared_ptr<scene::SceneContext> scene_context_;
 
   FML_DISALLOW_COPY_AND_ASSIGN(ContentContext);
 };
diff --git a/impeller/entity/contents/scene_contents.cc b/impeller/entity/contents/scene_contents.cc
new file mode 100644
index 0000000..3a1c0d9
--- /dev/null
+++ b/impeller/entity/contents/scene_contents.cc
@@ -0,0 +1,77 @@
+// Copyright 2013 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "impeller/entity/contents/scene_contents.h"
+
+#include "impeller/entity/contents/content_context.h"
+#include "impeller/entity/contents/tiled_texture_contents.h"
+#include "impeller/entity/entity.h"
+#include "impeller/geometry/path_builder.h"
+#include "impeller/renderer/formats.h"
+#include "impeller/scene/camera.h"
+#include "impeller/scene/scene.h"
+
+namespace impeller {
+
+SceneContents::SceneContents() = default;
+
+SceneContents::~SceneContents() = default;
+
+void SceneContents::SetCameraTransform(Matrix matrix) {
+  camera_transform_ = matrix;
+}
+
+void SceneContents::SetNode(std::shared_ptr<scene::Node> node) {
+  node_ = std::move(node);
+}
+
+bool SceneContents::Render(const ContentContext& renderer,
+                           const Entity& entity,
+                           RenderPass& pass) const {
+  if (!node_) {
+    return true;
+  }
+
+  auto coverage = GetCoverage(entity);
+  if (!coverage.has_value()) {
+    return true;
+  }
+
+  // This happens for CoverGeometry (DrawPaint). In this situation,
+  // Draw the scene to the full layer.
+  if (coverage.value().IsMaximum()) {
+    coverage = Rect::MakeSize(pass.GetRenderTargetSize());
+  }
+
+  RenderTarget subpass_target = RenderTarget::CreateOffscreenMSAA(
+      *renderer.GetContext(),            // context
+      ISize(coverage.value().size),      // size
+      "SceneContents",                   // label
+      StorageMode::kDeviceTransient,     // color_storage_mode
+      StorageMode::kDevicePrivate,       // color_resolve_storage_mode
+      LoadAction::kClear,                // color_load_action
+      StoreAction::kMultisampleResolve,  // color_store_action
+      StorageMode::kDeviceTransient,     // stencil_storage_mode
+      LoadAction::kDontCare,             // stencil_load_action
+      StoreAction::kDontCare             // stencil_store_action
+  );
+  if (!subpass_target.IsValid()) {
+    return false;
+  }
+
+  scene::Scene scene(renderer.GetSceneContext());
+  scene.GetRoot().AddChild(node_);
+
+  if (!scene.Render(subpass_target, camera_transform_)) {
+    return false;
+  }
+
+  // Render the texture to the pass.
+  TiledTextureContents contents;
+  contents.SetGeometry(GetGeometry());
+  contents.SetTexture(subpass_target.GetRenderTargetTexture());
+  return contents.Render(renderer, entity, pass);
+}
+
+}  // namespace impeller
diff --git a/impeller/entity/contents/scene_contents.h b/impeller/entity/contents/scene_contents.h
new file mode 100644
index 0000000..def5a36
--- /dev/null
+++ b/impeller/entity/contents/scene_contents.h
@@ -0,0 +1,35 @@
+// Copyright 2013 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <memory>
+
+#include "impeller/entity/contents/color_source_contents.h"
+
+#include "impeller/geometry/matrix.h"
+#include "impeller/geometry/rect.h"
+#include "impeller/scene/node.h"
+
+namespace impeller {
+
+class SceneContents final : public ColorSourceContents {
+ public:
+  SceneContents();
+
+  ~SceneContents() override;
+
+  void SetCameraTransform(Matrix matrix);
+
+  void SetNode(std::shared_ptr<scene::Node> node);
+
+  // |Contents|
+  bool Render(const ContentContext& renderer,
+              const Entity& entity,
+              RenderPass& pass) const override;
+
+ private:
+  Matrix camera_transform_;
+  std::shared_ptr<scene::Node> node_;
+};
+
+}  // namespace impeller
diff --git a/impeller/geometry/rect.h b/impeller/geometry/rect.h
index 3c83622..94a5b6d 100644
--- a/impeller/geometry/rect.h
+++ b/impeller/geometry/rect.h
@@ -74,10 +74,10 @@
   }
 
   constexpr static TRect MakeMaximum() {
-    return TRect::MakeLTRB(-std::numeric_limits<Scalar>::infinity(),
-                           -std::numeric_limits<Scalar>::infinity(),
-                           std::numeric_limits<Scalar>::infinity(),
-                           std::numeric_limits<Scalar>::infinity());
+    return TRect::MakeLTRB(-std::numeric_limits<Type>::infinity(),
+                           -std::numeric_limits<Type>::infinity(),
+                           std::numeric_limits<Type>::infinity(),
+                           std::numeric_limits<Type>::infinity());
   }
 
   template <class U>
@@ -122,6 +122,8 @@
 
   constexpr bool IsEmpty() const { return size.IsEmpty(); }
 
+  constexpr bool IsMaximum() const { return *this == MakeMaximum(); }
+
   constexpr auto GetLeft() const {
     return std::min(origin.x, origin.x + size.width);
   }
diff --git a/impeller/scene/scene.cc b/impeller/scene/scene.cc
index 46801cb..cf88faa 100644
--- a/impeller/scene/scene.cc
+++ b/impeller/scene/scene.cc
@@ -15,17 +15,23 @@
 namespace impeller {
 namespace scene {
 
-Scene::Scene(std::shared_ptr<Context> context)
-    : scene_context_(std::make_unique<SceneContext>(std::move(context))) {
+Scene::Scene(std::shared_ptr<SceneContext> scene_context)
+    : scene_context_(std::move(scene_context)) {
   root_.is_root_ = true;
 };
 
+Scene::~Scene() {
+  for (auto& child : GetRoot().GetChildren()) {
+    child->parent_ = nullptr;
+  }
+}
+
 Node& Scene::GetRoot() {
   return root_;
 }
 
 bool Scene::Render(const RenderTarget& render_target,
-                   const Camera& camera) const {
+                   const Matrix& camera_transform) const {
   // Collect the render commands from the scene.
   SceneEncoder encoder;
   if (!root_.Render(encoder, Matrix())) {
@@ -36,7 +42,8 @@
   // Encode the commands.
 
   std::shared_ptr<CommandBuffer> command_buffer =
-      encoder.BuildSceneCommandBuffer(*scene_context_, camera, render_target);
+      encoder.BuildSceneCommandBuffer(*scene_context_, camera_transform,
+                                      render_target);
 
   // TODO(bdero): Do post processing.
 
@@ -48,5 +55,11 @@
   return true;
 }
 
+bool Scene::Render(const RenderTarget& render_target,
+                   const Camera& camera) const {
+  return Render(render_target,
+                camera.GetTransform(render_target.GetRenderTargetSize()));
+}
+
 }  // namespace scene
 }  // namespace impeller
diff --git a/impeller/scene/scene.h b/impeller/scene/scene.h
index 97fadc8..9ff0745 100644
--- a/impeller/scene/scene.h
+++ b/impeller/scene/scene.h
@@ -20,14 +20,20 @@
 class Scene {
  public:
   Scene() = delete;
-  explicit Scene(std::shared_ptr<Context> context);
+
+  explicit Scene(std::shared_ptr<SceneContext> scene_context);
+
+  ~Scene();
 
   Node& GetRoot();
 
+  bool Render(const RenderTarget& render_target,
+              const Matrix& camera_transform) const;
+
   bool Render(const RenderTarget& render_target, const Camera& camera) const;
 
  private:
-  std::unique_ptr<SceneContext> scene_context_;
+  std::shared_ptr<SceneContext> scene_context_;
   Node root_;
 
   FML_DISALLOW_COPY_AND_ASSIGN(Scene);
diff --git a/impeller/scene/scene_encoder.cc b/impeller/scene/scene_encoder.cc
index e337651..662820a 100644
--- a/impeller/scene/scene_encoder.cc
+++ b/impeller/scene/scene_encoder.cc
@@ -46,7 +46,7 @@
 
 std::shared_ptr<CommandBuffer> SceneEncoder::BuildSceneCommandBuffer(
     const SceneContext& scene_context,
-    const Camera& camera,
+    const Matrix& camera_transform,
     RenderTarget render_target) const {
   {
     TextureDescriptor ds_texture;
@@ -91,9 +91,7 @@
   }
 
   for (auto& command : commands_) {
-    Matrix view_transform =
-        camera.GetTransform(render_pass->GetRenderTargetSize());
-    EncodeCommand(scene_context, view_transform, *render_pass, command);
+    EncodeCommand(scene_context, camera_transform, *render_pass, command);
   }
 
   if (!render_pass->EncodeCommands()) {
diff --git a/impeller/scene/scene_encoder.h b/impeller/scene/scene_encoder.h
index 600dd72..2c2ef1b 100644
--- a/impeller/scene/scene_encoder.h
+++ b/impeller/scene/scene_encoder.h
@@ -35,7 +35,7 @@
 
   std::shared_ptr<CommandBuffer> BuildSceneCommandBuffer(
       const SceneContext& scene_context,
-      const Camera& camera,
+      const Matrix& camera_transform,
       RenderTarget render_target) const;
 
   std::vector<SceneCommand> commands_;
diff --git a/impeller/scene/scene_unittests.cc b/impeller/scene/scene_unittests.cc
index 1ac4034..a9ce213 100644
--- a/impeller/scene/scene_unittests.cc
+++ b/impeller/scene/scene_unittests.cc
@@ -33,9 +33,11 @@
 INSTANTIATE_PLAYGROUND_SUITE(SceneTest);
 
 TEST_P(SceneTest, CuboidUnlit) {
+  auto scene_context = std::make_shared<SceneContext>(GetContext());
+
   Renderer::RenderCallback callback = [&](RenderTarget& render_target) {
     auto allocator = GetContext()->GetResourceAllocator();
-    auto scene = Scene(GetContext());
+    auto scene = Scene(scene_context);
 
     {
       Mesh mesh;
@@ -87,7 +89,8 @@
   gltf_scene->GetChildren()[0]->GetMesh().GetPrimitives()[0].material =
       material;
 
-  auto scene = Scene(GetContext());
+  auto scene_context = std::make_shared<SceneContext>(GetContext());
+  auto scene = Scene(scene_context);
   scene.GetRoot().AddChild(std::move(gltf_scene));
   scene.GetRoot().SetLocalTransform(Matrix::MakeScale({3, 3, 3}));
 
@@ -121,7 +124,8 @@
       Node::MakeFromFlatbuffer(*mapping, *allocator);
   ASSERT_NE(gltf_scene, nullptr);
 
-  auto scene = Scene(GetContext());
+  auto scene_context = std::make_shared<SceneContext>(GetContext());
+  auto scene = Scene(scene_context);
   scene.GetRoot().AddChild(std::move(gltf_scene));
 
   Renderer::RenderCallback callback = [&](RenderTarget& render_target) {
diff --git a/shell/platform/android/android_surface_gl_impeller.cc b/shell/platform/android/android_surface_gl_impeller.cc
index 89cbf66..3200822 100644
--- a/shell/platform/android/android_surface_gl_impeller.cc
+++ b/shell/platform/android/android_surface_gl_impeller.cc
@@ -5,12 +5,13 @@
 #include "flutter/shell/platform/android/android_surface_gl_impeller.h"
 
 #include "flutter/fml/logging.h"
-#include "flutter/impeller/entity/gles/entity_shaders_gles.h"
 #include "flutter/impeller/renderer/backend/gles/context_gles.h"
 #include "flutter/impeller/renderer/backend/gles/proc_table_gles.h"
 #include "flutter/impeller/toolkit/egl/context.h"
 #include "flutter/impeller/toolkit/egl/surface.h"
 #include "flutter/shell/gpu/gpu_surface_gl_impeller.h"
+#include "impeller/entity/gles/entity_shaders_gles.h"
+#include "impeller/scene/shaders/gles/scene_shaders_gles.h"
 
 namespace flutter {
 
@@ -59,6 +60,8 @@
       std::make_shared<fml::NonOwnedMapping>(
           impeller_entity_shaders_gles_data,
           impeller_entity_shaders_gles_length),
+      std::make_shared<fml::NonOwnedMapping>(
+          impeller_scene_shaders_gles_data, impeller_scene_shaders_gles_length),
   };
 
   auto context =
diff --git a/shell/platform/android/android_surface_vulkan_impeller.cc b/shell/platform/android/android_surface_vulkan_impeller.cc
index b9588df..65a682b 100644
--- a/shell/platform/android/android_surface_vulkan_impeller.cc
+++ b/shell/platform/android/android_surface_vulkan_impeller.cc
@@ -15,6 +15,7 @@
 #include "flutter/vulkan/vulkan_native_surface_android.h"
 #include "impeller/entity/vk/entity_shaders_vk.h"
 #include "impeller/entity/vk/modern_shaders_vk.h"
+#include "impeller/scene/shaders/vk/scene_shaders_vk.h"
 
 namespace flutter {
 
@@ -24,6 +25,8 @@
   std::vector<std::shared_ptr<fml::Mapping>> shader_mappings = {
       std::make_shared<fml::NonOwnedMapping>(impeller_entity_shaders_vk_data,
                                              impeller_entity_shaders_vk_length),
+      std::make_shared<fml::NonOwnedMapping>(impeller_scene_shaders_vk_data,
+                                             impeller_scene_shaders_vk_length),
       std::make_shared<fml::NonOwnedMapping>(impeller_modern_shaders_vk_data,
                                              impeller_modern_shaders_vk_length),
   };
diff --git a/shell/platform/darwin/graphics/FlutterDarwinContextMetalImpeller.mm b/shell/platform/darwin/graphics/FlutterDarwinContextMetalImpeller.mm
index 1ab7dcd..4810aaa 100644
--- a/shell/platform/darwin/graphics/FlutterDarwinContextMetalImpeller.mm
+++ b/shell/platform/darwin/graphics/FlutterDarwinContextMetalImpeller.mm
@@ -6,11 +6,12 @@
 
 #include "flutter/common/graphics/persistent_cache.h"
 #include "flutter/fml/logging.h"
-#include "flutter/impeller/entity/mtl/entity_shaders.h"
 #include "flutter/impeller/renderer/backend/metal/context_mtl.h"
 #include "flutter/shell/common/context_options.h"
 #import "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
+#include "impeller/entity/mtl/entity_shaders.h"
 #include "impeller/entity/mtl/modern_shaders.h"
+#include "impeller/scene/shaders/mtl/scene_shaders.h"
 
 FLUTTER_ASSERT_ARC
 
@@ -18,6 +19,8 @@
   std::vector<std::shared_ptr<fml::Mapping>> shader_mappings = {
       std::make_shared<fml::NonOwnedMapping>(impeller_entity_shaders_data,
                                              impeller_entity_shaders_length),
+      std::make_shared<fml::NonOwnedMapping>(impeller_scene_shaders_data,
+                                             impeller_scene_shaders_length),
       std::make_shared<fml::NonOwnedMapping>(impeller_modern_shaders_data,
                                              impeller_modern_shaders_length),
   };