[flutter_releases] Cherry pick flutter-2.13-candidate.7 changes  (#10… (#103374)

* [flutter_releases] Cherry pick flutter-2.13-candidate.7 changes  (#103206)

* Revert "Fix jumping when doing long press for selecting text (#102270)" (#103142)

This reverts commit 6ea4aef827cefff2f088dae8abd4f762271d2ff0.

* Roll engine with Cps

* Fix engine hash

* [flutter_releases] partial revert of repaint boundary change (#102962) (#103214)

Co-authored-by: Jonah Williams <jonahwilliams@google.com>

* [flutter_releases] remove assert on markNeedsCompositingBitsUpdate #103227 (#103225)

Co-authored-by: Casey Hillers <chillers@google.com>
Co-authored-by: Jonah Williams <jonahwilliams@google.com>
diff --git a/bin/internal/engine.version b/bin/internal/engine.version
index 62e6786..84001e4 100644
--- a/bin/internal/engine.version
+++ b/bin/internal/engine.version
@@ -1 +1 @@
-07584c64bb7ba8d9e79214c3667cdb16cfa67923
+74ac1de5d4f70d6db6cc7f99f6f259a7d073c3ab
diff --git a/packages/flutter/lib/src/rendering/object.dart b/packages/flutter/lib/src/rendering/object.dart
index 73648a2..cee3c63 100644
--- a/packages/flutter/lib/src/rendering/object.dart
+++ b/packages/flutter/lib/src/rendering/object.dart
@@ -2295,12 +2295,6 @@
         return;
       }
     }
-    assert(() {
-      final AbstractNode? parent = this.parent;
-      if (parent is RenderObject)
-        return parent._needsCompositing;
-      return true;
-    }());
     // parent is fine (or there isn't one), but we are dirty
     if (owner != null)
       owner!._nodesNeedingCompositingBitsUpdate.add(this);
diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart
index 28b5990..e593f59 100644
--- a/packages/flutter/lib/src/rendering/proxy_box.dart
+++ b/packages/flutter/lib/src/rendering/proxy_box.dart
@@ -843,7 +843,7 @@
        super(child);
 
   @override
-  bool get isRepaintBoundary => child != null && (_alpha > 0);
+  bool get alwaysNeedsCompositing => child != null && (_alpha > 0);
 
   @override
   OffsetLayer updateCompositedLayer({required covariant OpacityLayer? oldLayer}) {
@@ -871,13 +871,13 @@
     assert(value >= 0.0 && value <= 1.0);
     if (_opacity == value)
       return;
-    final bool wasRepaintBoundary = isRepaintBoundary;
+    final bool didNeedCompositing = alwaysNeedsCompositing;
     final bool wasVisible = _alpha != 0;
     _opacity = value;
     _alpha = ui.Color.getAlphaFromOpacity(_opacity);
-    if (wasRepaintBoundary != isRepaintBoundary)
+    if (didNeedCompositing != alwaysNeedsCompositing)
       markNeedsCompositingBitsUpdate();
-    markNeedsCompositedLayerUpdate();
+    markNeedsPaint();
     if (wasVisible != (_alpha != 0) && !alwaysIncludeSemantics)
       markNeedsSemanticsUpdate();
   }
@@ -898,10 +898,19 @@
 
   @override
   void paint(PaintingContext context, Offset offset) {
-    if (_alpha == 0) {
-      return;
+    if (child != null) {
+      if (_alpha == 0) {
+        // No need to keep the layer. We'll create a new one if necessary.
+        layer = null;
+        return;
+      }
+      assert(needsCompositing);
+      layer = context.pushOpacity(offset, _alpha, super.paint, oldLayer: layer as OpacityLayer?);
+      assert(() {
+        layer!.debugCreator = debugCreator;
+        return true;
+      }());
     }
-    super.paint(context, offset);
   }
 
   @override
diff --git a/packages/flutter/lib/src/widgets/editable_text.dart b/packages/flutter/lib/src/widgets/editable_text.dart
index be622d5..8e477b4 100644
--- a/packages/flutter/lib/src/widgets/editable_text.dart
+++ b/packages/flutter/lib/src/widgets/editable_text.dart
@@ -2514,11 +2514,6 @@
     _showCaretOnScreenScheduled = true;
     SchedulerBinding.instance.addPostFrameCallback((Duration _) {
       _showCaretOnScreenScheduled = false;
-
-      // if cursor is inactive, e.g. while selecting text, do not jump away
-      if (!_cursorActive) {
-        return;
-      }
       if (_currentCaretRect == null || !_scrollController.hasClients) {
         return;
       }
diff --git a/packages/flutter/test/widgets/editable_text_test.dart b/packages/flutter/test/widgets/editable_text_test.dart
index 4b0226e..c13aecb 100644
--- a/packages/flutter/test/widgets/editable_text_test.dart
+++ b/packages/flutter/test/widgets/editable_text_test.dart
@@ -5183,53 +5183,6 @@
     // toolbar. Until we change that, this test should remain skipped.
   }, skip: kIsWeb); // [intended]
 
-
-  testWidgets('text selection handle visibility for long text', (WidgetTester tester) async {
-    // long text which is scrollable based on given box size
-    const String testText =
-        'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.';
-    final TextEditingController controller =
-        TextEditingController(text: testText);
-    final ScrollController scrollController = ScrollController();
-
-    await tester.pumpWidget(MaterialApp(
-      home: Align(
-        alignment: Alignment.topLeft,
-        child: SizedBox(
-          width: 100,
-          height: 100,
-          child: SingleChildScrollView(
-            controller: scrollController,
-            child: EditableText(
-              controller: controller,
-              showSelectionHandles: true,
-              focusNode: FocusNode(),
-              style: Typography.material2018().black.subtitle1!,
-              cursorColor: Colors.blue,
-              backgroundCursorColor: Colors.grey,
-              selectionControls: materialTextSelectionControls,
-              keyboardType: TextInputType.multiline,
-              maxLines: null,
-            ),
-          ),
-        ),
-      ),
-    ));
-
-    // scroll to a text that is outside of the inital visible rect
-    scrollController.jumpTo(151);
-    await tester.pump();
-
-    // long press on a word to trigger a select
-    await tester.longPressAt(const Offset(20, 15));
-    // wait for adjustments of scroll area
-    await tester.pump();
-    await tester.pumpAndSettle();
-
-    // assert not jumped to top
-    expect(scrollController.offset, equals(151));
-  });
-
   const String testText = 'Now is the time for\n' // 20
       'all good people\n'                         // 20 + 16 => 36
       'to come to the aid\n'                      // 36 + 19 => 55
diff --git a/packages/flutter/test/widgets/opacity_repaint_test.dart b/packages/flutter/test/widgets/opacity_repaint_test.dart
deleted file mode 100644
index 00ca296..0000000
--- a/packages/flutter/test/widgets/opacity_repaint_test.dart
+++ /dev/null
@@ -1,275 +0,0 @@
-// Copyright 2014 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.
-
-import 'package:flutter/material.dart';
-import 'package:flutter/rendering.dart';
-import 'package:flutter_test/flutter_test.dart';
-
-void main() {
-  testWidgets('RenderOpacity acts as a repaint boundary for changes above the widget when partially opaque', (WidgetTester tester) async {
-    RenderTestObject.paintCount = 0;
-    await tester.pumpWidget(
-      Container(
-        color: Colors.red,
-        child: const Opacity(
-          opacity: 0.5,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-
-    await tester.pumpWidget(
-      Container(
-        color: Colors.blue,
-        child: const Opacity(
-          opacity: 0.5,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-  });
-
-  testWidgets('RenderOpacity acts as a repaint boundary for changes above the widget when fully opaque', (WidgetTester tester) async {
-    RenderTestObject.paintCount = 0;
-    await tester.pumpWidget(
-      Container(
-        color: Colors.red,
-        child: const Opacity(
-          opacity: 1,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-
-    await tester.pumpWidget(
-      Container(
-        color: Colors.blue,
-        child: const Opacity(
-          opacity: 1,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-  });
-
-  testWidgets('RenderOpacity can update its opacity without repainting its child - partially opaque to partially opaque', (WidgetTester tester) async {
-    RenderTestObject.paintCount = 0;
-    await tester.pumpWidget(
-      Container(
-        color: Colors.red,
-        child: const Opacity(
-          opacity: 0.5,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-
-    await tester.pumpWidget(
-      Container(
-        color: Colors.blue,
-        child: const Opacity(
-          opacity: 0.9,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-  });
-
-  testWidgets('RenderOpacity can update its opacity without repainting its child - partially opaque to fully opaque', (WidgetTester tester) async {
-    RenderTestObject.paintCount = 0;
-    await tester.pumpWidget(
-      Container(
-        color: Colors.red,
-        child: const Opacity(
-          opacity: 0.5,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-
-    await tester.pumpWidget(
-      Container(
-        color: Colors.blue,
-        child: const Opacity(
-          opacity: 1,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-  });
-
-  testWidgets('RenderOpacity can update its opacity without repainting its child - fully opaque to partially opaque', (WidgetTester tester) async {
-    RenderTestObject.paintCount = 0;
-    await tester.pumpWidget(
-      Container(
-        color: Colors.red,
-        child: const Opacity(
-          opacity: 1,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-
-    await tester.pumpWidget(
-      Container(
-        color: Colors.blue,
-        child: const Opacity(
-          opacity: 0.5,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-  });
-
-  testWidgets('RenderOpacity can update its opacity without repainting its child - fully opaque to fully transparent', (WidgetTester tester) async {
-    RenderTestObject.paintCount = 0;
-    await tester.pumpWidget(
-      Container(
-        color: Colors.red,
-        child: const Opacity(
-          opacity: 1,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-
-    await tester.pumpWidget(
-      Container(
-        color: Colors.blue,
-        child: const Opacity(
-          opacity: 0,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-  });
-
-  testWidgets('RenderOpacity must paint child - fully transparent to partially opaque', (WidgetTester tester) async {
-    RenderTestObject.paintCount = 0;
-    await tester.pumpWidget(
-      Container(
-        color: Colors.red,
-        child: const Opacity(
-          opacity: 0,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 0);
-
-    await tester.pumpWidget(
-      Container(
-        color: Colors.blue,
-        child: const Opacity(
-          opacity: 0.5,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-  });
-
-  testWidgets('RenderOpacity allows child to update without updating parent', (WidgetTester tester) async {
-    RenderTestObject.paintCount = 0;
-    await tester.pumpWidget(
-      TestWidget(
-        child: Opacity(
-          opacity: 0.5,
-          child: Container(
-            color: Colors.red,
-          ),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-
-    await tester.pumpWidget(
-      TestWidget(
-        child: Opacity(
-          opacity: 0.5,
-          child: Container(
-            color: Colors.blue,
-          ),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-  });
-
-  testWidgets('RenderOpacity disposes of opacity layer when opacity is updated to 0', (WidgetTester tester) async {
-    RenderTestObject.paintCount = 0;
-    await tester.pumpWidget(
-      Container(
-        color: Colors.red,
-        child: const Opacity(
-          opacity: 0.5,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-    expect(tester.layers, contains(isA<OpacityLayer>()));
-
-    await tester.pumpWidget(
-      Container(
-        color: Colors.blue,
-        child: const Opacity(
-          opacity: 0,
-          child: TestWidget(),
-        ),
-      )
-    );
-
-    expect(RenderTestObject.paintCount, 1);
-    expect(tester.layers, isNot(contains(isA<OpacityLayer>())));
-  });
-}
-
-class TestWidget extends SingleChildRenderObjectWidget {
-  const TestWidget({super.key, super.child});
-
-  @override
-  RenderObject createRenderObject(BuildContext context) {
-    return RenderTestObject();
-  }
-}
-
-class RenderTestObject extends RenderProxyBox {
-  static int paintCount = 0;
-
-  @override
-  void paint(PaintingContext context, Offset offset) {
-    paintCount += 1;
-    super.paint(context, offset);
-  }
-}