[flutter_releases] Apply flutter-2.13 candidate.7 CPs to latest roll (#33169)

* [flutter_releases] Fix condition in OpacityLayer where it inherits opacity twice (#33085) (#33105)

Co-authored-by: Jim Graham <flar@google.com>

* [flutter_releases] Remove reference to FX_LOG_ALL (#33027) (#33147)

It was partially removed in
https://fuchsia-review.googlesource.com/c/fuchsia/+/674049; this commit
allows remaining references to be removed.

Co-authored-by: Tamir Duberstein <tamird@google.com>

Co-authored-by: Jim Graham <flar@google.com>
Co-authored-by: Tamir Duberstein <tamird@google.com>
diff --git a/flow/layers/opacity_layer.cc b/flow/layers/opacity_layer.cc
index b234428..bda6da9 100644
--- a/flow/layers/opacity_layer.cc
+++ b/flow/layers/opacity_layer.cc
@@ -126,7 +126,9 @@
 
   Layer::AutoSaveLayer save_layer =
       Layer::AutoSaveLayer::Create(context, saveLayerBounds, &paint);
+  context.inherited_opacity = SK_Scalar1;
   PaintChildren(context);
+  context.inherited_opacity = inherited_opacity;
 }
 
 }  // namespace flutter
diff --git a/flow/layers/opacity_layer_unittests.cc b/flow/layers/opacity_layer_unittests.cc
index 0362575..c86945a 100644
--- a/flow/layers/opacity_layer_unittests.cc
+++ b/flow/layers/opacity_layer_unittests.cc
@@ -543,7 +543,7 @@
   EXPECT_TRUE(opacityLayer->children_can_accept_opacity());
 }
 
-TEST_F(OpacityLayerTest, OpacityInheritanceNested) {
+TEST_F(OpacityLayerTest, OpacityInheritanceNestedWithCompatibleChild) {
   SkPoint offset1 = SkPoint::Make(10, 20);
   SkPoint offset2 = SkPoint::Make(20, 10);
   SkPath mockPath = SkPath::Rect({10, 10, 20, 20});
@@ -603,6 +603,63 @@
   EXPECT_TRUE(DisplayListsEQ_Verbose(expected_builder.Build(), display_list()));
 }
 
+TEST_F(OpacityLayerTest, OpacityInheritanceNestedWithIncompatibleChild) {
+  SkPoint offset1 = SkPoint::Make(10, 20);
+  SkPoint offset2 = SkPoint::Make(20, 10);
+  SkPath mockPath = SkPath::Rect({10, 10, 20, 20});
+  auto opacityLayer1 = std::make_shared<OpacityLayer>(128, offset1);
+  auto opacityLayer2 = std::make_shared<OpacityLayer>(64, offset2);
+  auto mockLayer = MockLayer::Make(mockPath);
+  opacityLayer2->Add(mockLayer);
+  opacityLayer1->Add(opacityLayer2);
+
+  PrerollContext* context = preroll_context();
+  context->subtree_can_inherit_opacity = false;
+  opacityLayer1->Preroll(context, SkMatrix::I());
+  EXPECT_TRUE(context->subtree_can_inherit_opacity);
+  EXPECT_TRUE(opacityLayer1->children_can_accept_opacity());
+  EXPECT_FALSE(opacityLayer2->children_can_accept_opacity());
+
+  SkPaint saveLayerPaint;
+  SkScalar inheritedOpacity = 128 * 1.0 / SK_AlphaOPAQUE;
+  inheritedOpacity *= 64 * 1.0 / SK_AlphaOPAQUE;
+  saveLayerPaint.setAlphaf(inheritedOpacity);
+
+  DisplayListBuilder expected_builder;
+  /* opacityLayer1::Paint */ {
+    expected_builder.save();
+    {
+      expected_builder.translate(offset1.fX, offset1.fY);
+#ifndef SUPPORT_FRACTIONAL_TRANSLATION
+      expected_builder.transformReset();
+      expected_builder.transform(SkM44::Translate(offset1.fX, offset1.fY));
+#endif
+      /* opacityLayer2::Paint */ {
+        expected_builder.save();
+        {
+          expected_builder.translate(offset2.fX, offset2.fY);
+#ifndef SUPPORT_FRACTIONAL_TRANSLATION
+          expected_builder.transformReset();
+          expected_builder.transform(SkM44::Translate(offset1.fX + offset2.fX,
+                                                      offset1.fY + offset2.fY));
+#endif
+          expected_builder.setColor(saveLayerPaint.getAlpha() << 24);
+          expected_builder.saveLayer(&mockLayer->paint_bounds(), true);
+          /* mockLayer::Paint */ {
+            expected_builder.setColor(0xFF000000);
+            expected_builder.drawPath(mockPath);
+          }
+        }
+        expected_builder.restore();
+      }
+    }
+    expected_builder.restore();
+  }
+
+  opacityLayer1->Paint(display_list_paint_context());
+  EXPECT_TRUE(DisplayListsEQ_Verbose(expected_builder.Build(), display_list()));
+}
+
 using OpacityLayerDiffTest = DiffContextTest;
 
 TEST_F(OpacityLayerDiffTest, FractionalTranslation) {
diff --git a/fml/log_settings.cc b/fml/log_settings.cc
index 4388a1a..93df3d4 100644
--- a/fml/log_settings.cc
+++ b/fml/log_settings.cc
@@ -9,6 +9,7 @@
 #include <algorithm>
 #include <cstring>
 #include <iostream>
+#include <limits>
 
 #include "flutter/fml/build_config.h"
 #include "flutter/fml/logging.h"
@@ -31,7 +32,11 @@
       std::min(LOG_FATAL, settings.min_log_level);
 #if defined(OS_FUCHSIA)
   // Syslog should accept all logs, since filtering by severity is done by fml.
-  FX_LOG_SET_SEVERITY(ALL);
+  fx_logger_t* logger = fx_log_get_logger();
+  if (logger) {
+    fx_logger_set_min_severity(logger,
+                               std::numeric_limits<fx_log_severity_t>::min());
+  }
 #endif
 }