Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
379f2e8
[flutter_releases] Flutter beta 3.16.0-0.1.pre Engine Cherrypicks (#4…
XilaiZhang Oct 3, 2023
7ccdde7
[flutter release cp] Use x86 machines for ios builds. (#46726) (#46737)
XilaiZhang Oct 10, 2023
a8f7394
[cp][ios] Link PlatformView back to semantics tree (#46471) (#46715)
Oct 11, 2023
249cc9b
Update dart to 620c1721 (#46799)
godofredoc Oct 11, 2023
54d5d0f
[CP][Impeller] Fix framebuffer blend UVs. (#46489) (#46775)
Oct 17, 2023
39078da
[CP][Impeller] Apply the transform to PointFieldGeometry coverage (#4…
Oct 17, 2023
84d9562
[CP][Impeller] Fixed subpass filter coverage with image filters (#464…
Oct 17, 2023
731c678
Cherrypick disable hardware buffer platform views for 3.16 (#46968)
johnmccutchan Oct 17, 2023
91cde06
[flutter_releases] Flutter beta 3.16.0-0.3.pre Engine Cherrypicks (#4…
itsjustkevin Oct 19, 2023
abdaabc
[flutter_releases] Flutter beta 3.16.0-0.4.pre Engine Cherrypicks (#4…
Oct 31, 2023
2dd11e3
[CP][Impeller] fix clear color optimization for large subpasses. (#46…
Nov 2, 2023
ab14aba
[CP][Impeller] Disable raster stats service protocol. (#47206) (#47578)
Nov 2, 2023
768db84
[flutter_releases] Flutter stable 3.16.0 Engine Cherrypicks (#47990)
Jasguerrero Nov 13, 2023
74d1662
[flutter_releases] Flutter stable 3.16.0 Engine Cherrypicks (#48029)
Jasguerrero Nov 14, 2023
f4f0c1d
[CP (beta)] [ios17][text_input]fix ios 17.0 keyboard freeze when swit…
hellohuanlin Nov 16, 2023
22b600f
[flutter_releases] Flutter stable 3.16.1 Engine Cherrypicks (#48320)
Nov 22, 2023
7521948
[flutter_releases] Flutter stable 3.16.2 Engine Cherrypicks (#48464)
Jasguerrero Nov 28, 2023
cd424ac
[CP][Impeller] revert non-zero tessellation optimization. (#48234) (#…
Nov 28, 2023
cf7a9d0
[CP][Impeller] Switched to static linked libc++ in vulkan validation …
zanderso Nov 29, 2023
5a11866
[CP] Fix crash on choosing share in selection controls on ipad (#48427)
LouiseHsu Nov 30, 2023
51e50e8
[CP] Fix not being able to hide iOS status bar via setEnabledSystemUI…
LinXunFeng Dec 1, 2023
aea4942
[CP][Impeller] Skip mask blur with 0 sigma. (#48457) (#48473)
Dec 5, 2023
f0c8486
[CP] Roll skia to 795ed944 (#48657)
Dec 5, 2023
54a7145
[flutter_releases] Flutter stable 3.16.3 Engine Cherrypicks (#48687)
Dec 5, 2023
bc2e856
[CP] Fix _availability_version_check for iOS 11 and 12 (#48926)
zanderso Dec 13, 2023
5a8e5c5
[CP] [Impeller] Turn off Aiks bounds tracking for filtered SaveLayers…
bdero Dec 18, 2023
61b3360
[CP] Fix for AnimatedOpacity affects blended color overlay render (#4…
zanderso Dec 18, 2023
3f3e560
[cherrypick-stable]Skip unexpected events in MultiPlatformViewBackgro…
XilaiZhang Dec 19, 2023
4a585b7
[flutter_releases] Flutter stable 3.16.7 Engine Cherrypicks (#49717)
itsjustkevin Jan 11, 2024
6e2ea58
[flutter_releases] Flutter stable 3.16.8 Engine Cherrypicks (#49795)
XilaiZhang Jan 16, 2024
f40e976
Roll 3b128c545 dart sdk. (#50024)
godofredoc Jan 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ group("unittests") {
if (is_mac) {
public_deps += [
"//flutter/impeller/golden_tests:impeller_golden_tests",
"//flutter/shell/platform/darwin/common:availability_version_check_unittests",
"//flutter/shell/platform/darwin/common:framework_common_unittests",
"//flutter/third_party/spring_animation:spring_animation_unittests",
]
Expand Down
6 changes: 3 additions & 3 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ vars = {
'llvm_git': 'https://llvm.googlesource.com',
# OCMock is for testing only so there is no google clone
'ocmock_git': 'https://github.com/erikdoe/ocmock.git',
'skia_revision': '33502f9b0c7d845adceb4907d1c7dc1f22b3fd4c',
'skia_revision': '795ed944ff5bde5916d193824589d3bacfa61a7d',

# WARNING: DO NOT EDIT canvaskit_cipd_instance MANUALLY
# See `lib/web_ui/README.md` for how to roll CanvasKit to a new version.
Expand Down Expand Up @@ -57,7 +57,7 @@ vars = {
# Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS
# You can use //tools/dart/create_updated_flutter_deps.py to produce
# updated revision list of existing dependencies.
'dart_revision': '077d768accfa3419b8b57cf779cca8228b417faa',
'dart_revision': '3b128c5454834a1aaef37d9bb12595e7c217ab61',

# WARNING: DO NOT EDIT MANUALLY
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py
Expand Down Expand Up @@ -262,7 +262,7 @@ allowed_hosts = [
]

deps = {
'src': 'https://github.com/flutter/buildroot.git' + '@' + '9780f253156165c515962f5f0c56235d34617689',
'src': 'https://github.com/flutter/buildroot.git' + '@' + 'f27d99b4428dea312646130d60c33a2d38fa9dc6',

# Fuchsia compatibility
#
Expand Down
32 changes: 20 additions & 12 deletions ci/builders/mac_ios_engine.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{
"drone_dimensions": [
"device_type=none",
"mac_model=Macmini8,1",
"os=Mac-12"
"os=Mac-12",
"cpu=x86"
],
"gn": [
"--ios",
Expand All @@ -26,7 +26,8 @@
{
"drone_dimensions": [
"device_type=none",
"os=Mac-12"
"os=Mac-12",
"cpu=x86"
],
"gn": [
"--ios",
Expand All @@ -49,7 +50,8 @@
{
"drone_dimensions": [
"device_type=none",
"os=Mac-12"
"os=Mac-12",
"cpu=x86"
],
"gn": [
"--ios",
Expand All @@ -72,7 +74,8 @@
{
"drone_dimensions": [
"device_type=none",
"os=Mac-12"
"os=Mac-12",
"cpu=x86"
],
"gn": [
"--ios",
Expand All @@ -96,7 +99,8 @@
{
"drone_dimensions": [
"device_type=none",
"os=Mac-12"
"os=Mac-12",
"cpu=x86"
],
"gn": [
"--ios",
Expand All @@ -120,8 +124,8 @@
{
"drone_dimensions": [
"device_type=none",
"mac_model=Macmini8,1",
"os=Mac-12"
"os=Mac-12",
"cpu=x86"
],
"gn": [
"--ios",
Expand All @@ -144,7 +148,8 @@
{
"drone_dimensions": [
"device_type=none",
"os=Mac-12"
"os=Mac-12",
"cpu=x86"
],
"gn": [
"--ios",
Expand All @@ -168,7 +173,8 @@
{
"drone_dimensions": [
"device_type=none",
"os=Mac-12"
"os=Mac-12",
"cpu=x86"
],
"gn": [
"--ios",
Expand All @@ -192,7 +198,8 @@
{
"drone_dimensions": [
"device_type=none",
"os=Mac-12"
"os=Mac-12",
"cpu=x86"
],
"gn": [
"--ios",
Expand All @@ -217,7 +224,8 @@
{
"drone_dimensions": [
"device_type=none",
"os=Mac-12"
"os=Mac-12",
"cpu=x86"
],
"gn": [
"--ios",
Expand Down
1 change: 1 addition & 0 deletions ci/licenses_golden/excluded_files
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@
../../../flutter/shell/platform/common/text_input_model_unittests.cc
../../../flutter/shell/platform/common/text_range_unittests.cc
../../../flutter/shell/platform/darwin/Doxyfile
../../../flutter/shell/platform/darwin/common/availability_version_check_unittests.cc
../../../flutter/shell/platform/darwin/common/framework/Source/flutter_codecs_unittest.mm
../../../flutter/shell/platform/darwin/common/framework/Source/flutter_standard_codec_unittest.mm
../../../flutter/shell/platform/darwin/macos/README.md
Expand Down
2 changes: 1 addition & 1 deletion ci/licenses_golden/licenses_dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: fdaa9367efe1c4a57d9abc0eb91db374
Signature: ca990fb99a9b23dd546b46d46ece34dd

====================================================================================================
LIBRARY: dart
Expand Down
10 changes: 10 additions & 0 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -2597,6 +2597,7 @@ ORIGIN: ../../../flutter/shell/platform/common/text_input_model.cc + ../../../fl
ORIGIN: ../../../flutter/shell/platform/common/text_input_model.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/common/text_range.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/common/availability_version_check.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/common/availability_version_check.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/common/buffer_conversions.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/common/buffer_conversions.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/common/command_line.h + ../../../flutter/LICENSE
Expand Down Expand Up @@ -2697,6 +2698,7 @@ ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextI
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelay.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelay.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelayTest.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTouchInterceptingView_Test.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUIPressProxy.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUIPressProxy.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUmbrellaImport.m + ../../../flutter/LICENSE
Expand All @@ -2718,6 +2720,8 @@ ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/KeyCodeMap_I
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTestMocks.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest_mrc.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/UIViewController+FlutterScreenAndSceneIfLoaded.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/UIViewController+FlutterScreenAndSceneIfLoaded.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/UIViewController_FlutterScreenAndSceneIfLoadedTest.mm + ../../../flutter/LICENSE
Expand All @@ -2728,6 +2732,7 @@ ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibilit
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/availability_version_check_test.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/connection_collection.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/connection_collection.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/connection_collection_test.mm + ../../../flutter/LICENSE
Expand Down Expand Up @@ -5364,6 +5369,7 @@ FILE: ../../../flutter/shell/platform/common/text_input_model.cc
FILE: ../../../flutter/shell/platform/common/text_input_model.h
FILE: ../../../flutter/shell/platform/common/text_range.h
FILE: ../../../flutter/shell/platform/darwin/common/availability_version_check.cc
FILE: ../../../flutter/shell/platform/darwin/common/availability_version_check.h
FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.h
FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.mm
FILE: ../../../flutter/shell/platform/darwin/common/command_line.h
Expand Down Expand Up @@ -5465,6 +5471,7 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInp
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelay.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelay.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelayTest.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTouchInterceptingView_Test.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUIPressProxy.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUIPressProxy.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUmbrellaImport.m
Expand All @@ -5486,6 +5493,8 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/KeyCodeMap_Int
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTestMocks.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest_mrc.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/UIViewController+FlutterScreenAndSceneIfLoaded.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/UIViewController+FlutterScreenAndSceneIfLoaded.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/UIViewController_FlutterScreenAndSceneIfLoadedTest.mm
Expand All @@ -5496,6 +5505,7 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/availability_version_check_test.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/connection_collection.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/connection_collection.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/connection_collection_test.mm
Expand Down
2 changes: 1 addition & 1 deletion ci/licenses_golden/licenses_skia
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: eca53560b3fc7923df8e91b89c6a742d
Signature: d1349790807333b45e728aa0781329ea

====================================================================================================
LIBRARY: etc1
Expand Down
2 changes: 2 additions & 0 deletions flow/layers/layer_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class LayerTree {
/// When `Paint` is called, if leaf layer tracing is enabled, additional
/// metadata around raterization of leaf layers is collected.
///
/// This is not supported in the Impeller backend.
///
/// See: `LayerSnapshotStore`
void enable_leaf_layer_tracing(bool enable) {
enable_leaf_layer_tracing_ = enable;
Expand Down
112 changes: 106 additions & 6 deletions impeller/aiks/aiks_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1580,6 +1580,26 @@ TEST_P(AiksTest, DrawPaintWithAdvancedBlendOverFilter) {
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}

TEST_P(AiksTest, DrawAdvancedBlendPartlyOffscreen) {
std::vector<Color> colors = {Color{0.9568, 0.2627, 0.2118, 1.0},
Color{0.1294, 0.5882, 0.9529, 1.0}};
std::vector<Scalar> stops = {0.0, 1.0};

Paint paint = {
.color_source = ColorSource::MakeLinearGradient(
{0, 0}, {100, 100}, std::move(colors), std::move(stops),
Entity::TileMode::kRepeat, Matrix::MakeScale(Vector3(0.3, 0.3, 0.3))),
.blend_mode = BlendMode::kLighten,
};

Canvas canvas;
canvas.DrawPaint({.color = Color::Blue()});
canvas.Scale(Vector2(2, 2));
canvas.ClipRect(Rect::MakeLTRB(0, 0, 200, 200));
canvas.DrawCircle({100, 100}, 100, paint);
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}

#define BLEND_MODE_TUPLE(blend_mode) {#blend_mode, BlendMode::k##blend_mode},

struct BlendModeSelection {
Expand Down Expand Up @@ -2086,9 +2106,12 @@ TEST_P(AiksTest, CanRenderClippedLayers) {
canvas.DrawRect(Rect::MakeSize(Size{400, 400}), {.color = Color::White()});
// Fill the layer with green, but do so with a color blend that can't be
// collapsed into the parent pass.
// TODO(jonahwilliams): this blend mode was changed from color burn to
// hardlight to work around https://github.com/flutter/flutter/issues/136554
// .
canvas.DrawRect(
Rect::MakeSize(Size{400, 400}),
{.color = Color::Green(), .blend_mode = BlendMode::kColorBurn});
{.color = Color::Green(), .blend_mode = BlendMode::kHardLight});
}

ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
Expand Down Expand Up @@ -2393,19 +2416,18 @@ TEST_P(AiksTest, ClearColorOptimizationDoesNotApplyForBackdropFilters) {
Picture picture = canvas.EndRecordingAsPicture();

std::optional<Color> actual_color;
bool found_subpass = false;
picture.pass->IterateAllElements([&](EntityPass::Element& element) -> bool {
if (auto subpass = std::get_if<std::unique_ptr<EntityPass>>(&element)) {
actual_color = subpass->get()->GetClearColor();
found_subpass = true;
}
// Fail if the first element isn't a subpass.
return true;
});

ASSERT_TRUE(actual_color.has_value());
if (!actual_color) {
return;
}
ASSERT_EQ(actual_color.value(), Color::BlackTransparent());
EXPECT_TRUE(found_subpass);
EXPECT_FALSE(actual_color.has_value());
}

TEST_P(AiksTest, CollapsedDrawPaintInSubpass) {
Expand Down Expand Up @@ -3562,7 +3584,85 @@ TEST_P(AiksTest, ClearBlend) {
clear.blend_mode = BlendMode::kClear;

canvas.DrawCircle(Point::MakeXY(300.0, 300.0), 200.0, clear);
}

TEST_P(AiksTest, MatrixImageFilterMagnify) {
Canvas canvas;
canvas.Scale(GetContentScale());
auto image = std::make_shared<Image>(CreateTextureForFixture("airplane.jpg"));
canvas.Translate({600, -200});
canvas.SaveLayer({
.image_filter = std::make_shared<MatrixImageFilter>(
Matrix{
2, 0, 0, 0, //
0, 2, 0, 0, //
0, 0, 2, 0, //
0, 0, 0, 1 //
},
SamplerDescriptor{}),
});
canvas.DrawImage(image, {0, 0}, Paint{.color = Color(1.0, 1.0, 1.0, 0.5)});
canvas.Restore();

ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}

// This should be solid red, if you see a little red box this is broken.
TEST_P(AiksTest, ClearColorOptimizationWhenSubpassIsBiggerThanParentPass) {
Canvas canvas;
canvas.Scale(GetContentScale());
canvas.DrawRect(Rect::MakeLTRB(200, 200, 300, 300), {.color = Color::Red()});
canvas.SaveLayer({
.image_filter = std::make_shared<MatrixImageFilter>(
Matrix::MakeScale({2, 2, 1}), SamplerDescriptor{}),
});
// Draw a rectangle that would fully cover the parent pass size, but not
// the subpass that it is rendered in.
canvas.DrawRect(Rect::MakeLTRB(0, 0, 400, 400), {.color = Color::Green()});
// Draw a bigger rectangle to force the subpass to be bigger.
canvas.DrawRect(Rect::MakeLTRB(0, 0, 800, 800), {.color = Color::Red()});
canvas.Restore();

ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}

TEST_P(AiksTest, MaskBlurWithZeroSigmaIsSkipped) {
Canvas canvas;

Paint paint = {
.color = Color::White(),
.mask_blur_descriptor =
Paint::MaskBlurDescriptor{
.style = FilterContents::BlurStyle::kNormal,
.sigma = Sigma(0),
},
};

canvas.DrawCircle({300, 300}, 200, paint);
canvas.DrawRect(Rect::MakeLTRB(100, 300, 500, 600), paint);

ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}

TEST_P(AiksTest, SubpassWithClearColorOptimization) {
Canvas canvas;

// Use a non-srcOver blend mode to ensure that we don't detect this as an
// opacity peephole optimization.
canvas.SaveLayer(
{.color = Color::Blue().WithAlpha(0.5), .blend_mode = BlendMode::kSource},
Rect::MakeLTRB(0, 0, 200, 200));
canvas.DrawPaint(
{.color = Color::BlackTransparent(), .blend_mode = BlendMode::kSource});
canvas.Restore();

canvas.SaveLayer(
{.color = Color::Blue(), .blend_mode = BlendMode::kDestinationOver});
canvas.Restore();

// This playground should appear blank on CI since we are only drawing
// transparent black. If the clear color optimization is broken, the texture
// will be filled with NaNs and may produce a magenta texture on macOS or iOS.
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}

Expand Down
Loading