mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fix hybrid composition case and enable test (flutter/engine#26272)
This commit is contained in:
parent
dbd751e2b0
commit
562e87e3f4
@ -125,22 +125,19 @@ void AndroidExternalViewEmbedder::SubmitFrame(
|
||||
joined_rect.join(rect);
|
||||
}
|
||||
}
|
||||
|
||||
if (joined_rect.isEmpty()) {
|
||||
continue;
|
||||
if (!joined_rect.isEmpty()) {
|
||||
// Subpixels in the platform may not align with the canvas subpixels.
|
||||
//
|
||||
// To workaround it, round the floating point bounds and make the rect
|
||||
// slightly larger.
|
||||
//
|
||||
// For example, {0.3, 0.5, 3.1, 4.7} becomes {0, 0, 4, 5}.
|
||||
joined_rect.set(joined_rect.roundOut());
|
||||
overlay_layers.insert({view_id, joined_rect});
|
||||
// Clip the background canvas, so it doesn't contain any of the pixels
|
||||
// drawn on the overlay layer.
|
||||
background_canvas->clipRect(joined_rect, SkClipOp::kDifference);
|
||||
}
|
||||
|
||||
// Subpixels in the platform may not align with the canvas subpixels.
|
||||
//
|
||||
// To workaround it, round the floating point bounds and make the rect
|
||||
// slightly larger.
|
||||
//
|
||||
// For example, {0.3, 0.5, 3.1, 4.7} becomes {0, 0, 4, 5}.
|
||||
joined_rect.set(joined_rect.roundOut());
|
||||
overlay_layers.insert({view_id, joined_rect});
|
||||
// Clip the background canvas, so it doesn't contain any of the pixels
|
||||
// drawn on the overlay layer.
|
||||
background_canvas->clipRect(joined_rect, SkClipOp::kDifference);
|
||||
background_canvas->drawPicture(pictures.at(view_id));
|
||||
}
|
||||
// Submit the background canvas frame before switching the GL context to
|
||||
|
||||
@ -96,4 +96,10 @@ public class PlatformTextureUiTests {
|
||||
intent.putExtra("scenario", "platform_view_two_intersecting_overlays");
|
||||
ScreenshotUtil.capture(activityRule.launchActivity(intent));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPlatformViewWithoutOverlayIntersection() throws Exception {
|
||||
intent.putExtra("scenario", "platform_view_no_overlay_intersection");
|
||||
ScreenshotUtil.capture(activityRule.launchActivity(intent));
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,4 +96,10 @@ public class PlatformViewUiTests {
|
||||
intent.putExtra("scenario", "platform_view_two_intersecting_overlays");
|
||||
ScreenshotUtil.capture(activityRule.launchActivity(intent));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPlatformViewWithoutOverlayIntersection() throws Exception {
|
||||
intent.putExtra("scenario", "platform_view_no_overlay_intersection");
|
||||
ScreenshotUtil.capture(activityRule.launchActivity(intent));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user