Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit ad8d7fa

Browse files
committed
iOS: Eliminate non-handling of non-zero origin platformviews
In #35501, handling was added to log a debug message to the console in the case where a platform view with a non-zero origin was identified. Unfortunately: * In unopt builds, the first thing we do in that block is to call FML_DCHECK asserting that the origin is zero, so we never actually emit the log statement. * In opt builds, FML_DCHECK is a no-op, so users are unlikely to actually ever notice the crash. The proper fix is to eliminate this restriction, but in the meantime, this eliminates this block entirely and leaves the TODO. We've had only two comments on that bug in the 2.5 years since it was added. Issue: flutter/flutter#109700
1 parent 7a8c1e8 commit ad8d7fa

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

shell/platform/darwin/ios/framework/Source/platform_views_controller.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,6 @@ class PlatformViewsController {
295295
/// This state is only modified on the raster thread.
296296
std::unordered_set<int64_t> views_to_recomposite_;
297297

298-
#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG
299-
/// A set to keep track of embedded views that do not have (0, 0) origin.
300-
/// An insertion triggers a warning message about non-zero origin logged on the debug console.
301-
/// See https://github.com/flutter/flutter/issues/109700 for details.
302-
std::unordered_set<int64_t> non_zero_origin_views_;
303-
#endif
304-
305298
/// @brief The composition order from the previous thread.
306299
///
307300
/// Only accessed from the platform thread.

shell/platform/darwin/ios/framework/Source/platform_views_controller.mm

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -537,26 +537,9 @@ bool ClipRRectContainsPlatformViewBoundingRect(const SkRRect& clip_rrect,
537537
// included in the `views_to_recomposite_`.
538538
void PlatformViewsController::CompositeWithParams(int64_t view_id,
539539
const EmbeddedViewParams& params) {
540+
/// TODO(https://github.com/flutter/flutter/issues/109700)
540541
CGRect frame = CGRectMake(0, 0, params.sizePoints().width(), params.sizePoints().height());
541542
FlutterTouchInterceptingView* touchInterceptor = platform_views_[view_id].touch_interceptor;
542-
#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG
543-
FML_DCHECK(CGPointEqualToPoint([touchInterceptor embeddedView].frame.origin, CGPointZero));
544-
if (non_zero_origin_views_.find(view_id) == non_zero_origin_views_.end() &&
545-
!CGPointEqualToPoint([touchInterceptor embeddedView].frame.origin, CGPointZero)) {
546-
non_zero_origin_views_.insert(view_id);
547-
NSLog(
548-
@"A Embedded PlatformView's origin is not CGPointZero.\n"
549-
" View id: %@\n"
550-
" View info: \n %@ \n"
551-
"A non-zero origin might cause undefined behavior.\n"
552-
"See https://github.com/flutter/flutter/issues/109700 for more details.\n"
553-
"If you are the author of the PlatformView, please update the implementation of the "
554-
"PlatformView to have a (0, 0) origin.\n"
555-
"If you have a valid case of using a non-zero origin, "
556-
"please leave a comment at https://github.com/flutter/flutter/issues/109700 with details.",
557-
@(view_id), [touchInterceptor embeddedView]);
558-
}
559-
#endif
560543
touchInterceptor.layer.transform = CATransform3DIdentity;
561544
touchInterceptor.frame = frame;
562545
touchInterceptor.alpha = 1;

0 commit comments

Comments
 (0)