From 4966eafd3c4f3ddcf3d3382f52e763b40d57fcc2 Mon Sep 17 00:00:00 2001 From: Jia Hao Goh Date: Fri, 14 Jul 2023 16:24:46 +0800 Subject: [PATCH 1/2] Minor fixes for C++20 compatibility --- shell/common/rasterizer.cc | 2 +- .../darwin/ios/framework/Source/FlutterView.mm | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index e3daa2d7cabda..41132d8198da2 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -88,7 +88,7 @@ void Rasterizer::Setup(std::unique_ptr surface) { delegate_.GetParentRasterThreadMerger(), platform_id, gpu_id); } if (raster_thread_merger_) { - raster_thread_merger_->SetMergeUnmergeCallback([=]() { + raster_thread_merger_->SetMergeUnmergeCallback([&]() { // Clear the GL context after the thread configuration has changed. if (surface_) { surface_->ClearRenderContext(); diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.mm b/shell/platform/darwin/ios/framework/Source/FlutterView.mm index 32534da9df215..daef8b2ab30d3 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.mm @@ -156,12 +156,13 @@ - (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context { 32, // size_t bitsPerPixel, 4 * screenshot.frame_size.width(), // size_t bytesPerRow colorspace, // CGColorSpaceRef space - static_cast(kCGImageAlphaPremultipliedLast | - kCGBitmapByteOrder32Big), // CGBitmapInfo bitmapInfo - image_data_provider, // CGDataProviderRef provider - nullptr, // const CGFloat* decode - false, // bool shouldInterpolate - kCGRenderingIntentDefault // CGColorRenderingIntent intent + static_cast( + static_cast(kCGImageAlphaPremultipliedLast) | + static_cast(kCGBitmapByteOrder32Big)), // CGBitmapInfo bitmapInfo + image_data_provider, // CGDataProviderRef provider + nullptr, // const CGFloat* decode + false, // bool shouldInterpolate + kCGRenderingIntentDefault // CGColorRenderingIntent intent )); const CGRect frame_rect = From 1b7147cb6fca2c80c4d6746bfbd429808ca82308 Mon Sep 17 00:00:00 2001 From: Jia Hao Goh Date: Sat, 15 Jul 2023 05:22:50 +0800 Subject: [PATCH 2/2] update --- shell/common/rasterizer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 41132d8198da2..07de96e39f7f3 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -88,7 +88,7 @@ void Rasterizer::Setup(std::unique_ptr surface) { delegate_.GetParentRasterThreadMerger(), platform_id, gpu_id); } if (raster_thread_merger_) { - raster_thread_merger_->SetMergeUnmergeCallback([&]() { + raster_thread_merger_->SetMergeUnmergeCallback([this]() { // Clear the GL context after the thread configuration has changed. if (surface_) { surface_->ClearRenderContext();