-
Notifications
You must be signed in to change notification settings - Fork 27.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Horizontal overscroll is being clipped on Android #8523
Comments
Can you say a bit more about how to reproduce this issue? |
Sure. Sorry, will make sure I include more details in the future. Two scenarios:
List<Widget> children = ...
SliverChildDelegate childrenDelegate = new SliverChildListDelegate(children);
PageView pageView = new PageView.custom(
childrenDelegate: this.childrenDelegate,
); Both cases seem to be exhibiting the issue consistently. FYI - I have a |
@Hixie I think we still have a coordinate flipped somewhere in the horizontal glow math. |
What's the issue exactly? |
The |
This is easy to repro with a horizontal scrollview on Android, btw. It looks like the overscroll glow is drawing from the bottom of the screen with the correct cliprect, just wrong origin. |
Wow yeah I wonder what I did. |
Turns out this is a Skia bug. Consider this app. It has a function that draws a rectangle with a circle in the middle. The first one has no particular transforms applied. It renders fine (whitish). The second is rotate by pi/2 and flipped along the y-axis; it renders fine too (green). The next three should all look identical (they are the red ones). They are the same as the green one but with the y-axis (now effectively the x-axis since we're rotated by pi/2) squeezed further, by 0.5 plus or minor 0.001. It should look like a squeezed version of the green one, blurred out a bit. Instead, two of the circles end up squeezed in the wrong direction. import 'package:flutter/material.dart';
import 'dart:math' as math;
void main() {
runApp(new CustomPaint(painter: new TestPainter()));
}
class TestPainter extends CustomPainter {
void drawFlag(Canvas canvas, Paint paint) {
canvas.drawRect(new Rect.fromLTWH(50.0, 50.0, 300.0, 200.0), paint);
canvas.drawCircle(new Point(200.0, 150.0), 50.0, paint);
}
@override
void paint(Canvas canvas, Size size) {
Paint paint = new Paint()
..style = PaintingStyle.stroke
..strokeWidth = 10.0;
paint.color = const Color(0xFFEEEEEE);
drawFlag(canvas, paint);
canvas.rotate(math.PI / 2.0);
canvas.scale(1.0, -1.0);
paint.color = const Color(0xFF00FF00);
drawFlag(canvas, paint);
canvas.save();
canvas.scale(1.0, 0.4999);
paint.color = const Color(0xFFFF0000);
drawFlag(canvas, paint);
canvas.restore();
canvas.save();
canvas.scale(1.0, 0.5000);
paint.color = const Color(0xFFFF0000);
drawFlag(canvas, paint);
canvas.restore();
canvas.save();
canvas.scale(1.0, 0.5001);
paint.color = const Color(0xFFFF0000);
drawFlag(canvas, paint);
canvas.restore();
}
@override
bool shouldRepaint(TestPainter oldDelegate) => true;
} cc @chinmaygarde to take over the investigation. :-) |
@chinmaygarde can you escalate to Skia? :) Thanks! |
Will do. Trying all platform variants first. |
So this is an Android-GL only bug? |
Ok, I tried both debug and release variants on Android to make sure there were no differences between AOT vs JIT modes. Both are fine. |
Ok. I was testing on ToT with local engine. I can reproduce this with the currently released engine. I need to do a bisect of the changes since the last release and current ToT. But this is definitely not an issue anymore. Rather worrying how this regressed though. Bisecting. |
The only two changes in the engine repository between ToT and the released version is a minor change where I got rid of an iOS specific flag and literally a commit with a whitespace change. I tried bisecting the framework and cannot find a revision using a released version of the engine that is correctly rendering the test case. All I can think of is to manually pull the released engine and do a binary diff against the locally built variant. This is bizarre. |
What's the status of this bug? Did we figure out if it was a Skia problem? Local issue? Only devices @chinmaygarde hasn't touched? :-) |
I have not made any progress on this. Local builds on all platforms were fine for me. I was building on a Mac and did ensure to checkout to the version of the released engine. Will try building on Linux. Besides that, out of ideas. |
Ah, could be something that happens with the compiler on Linux maybe? |
Here is the code I used to repro: I'm using 06144a7 flutter doctor is clean |
I converted the code in the sample to the equivalent Skia calls and added it to this fiddle. This does not seem to be a Skia issue. Maybe the raster cache. Checking now. |
@eseidelGoogle Did you try using a locally built engine on Mac or was this from the released engine? |
@chinmaygarde i was using a released engine. |
@chinmaygarde are you actively working on this? (Just checking our in-progress M2 bugs to make sure they're actually owned.) |
No. I am not actively working on this because I am not able to reproduce this. |
I don't know if it's the same issue, but you can see a rectangular (instead of ellipse) vertical glow in the gallery: #8747 |
Yes, this is the same issue as far as I know |
Reproduced it and looked at the Skia code. This apparently happens if we flow through EllipseOp::Make EllipseOp::Make is calculating the ellipse's x and y radius based on scale and skew values extracted from the viewMatrix that I don't think are accurate if a negative scale transform has been applied. This works as expected if I patch EllipseOp::Make to call viewMatrix.mapRect(ellipse) and use the resulting radii. |
Can you prepare a reduced test case on fiddle.skia.org so we can share it
with the Skia team?
…On Tue, Apr 11, 2017 at 5:17 PM Jason Simmons ***@***.***> wrote:
Reproduced it and looked at the Skia code. This apparently happens if we
flow through EllipseOp::Make
EllipseOp::Make is calculating the ellipse's x and y radius based on scale
and skew values extracted from the viewMatrix that I don't think are
accurate if a negative scale transform has been applied.
This works as expected if I patch EllipseOp::Make to call
viewMatrix.mapRect(ellipse) and use the resulting radii.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8523 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACsNeL50Z8RYAsKvuKXnunQj3Ubr9mHks5rvBgHgaJpZM4MQmSv>
.
|
Skia bug filed: https://bugs.chromium.org/p/skia/issues/detail?id=6495 |
Should be fixed by https://skia-review.googlesource.com/c/13989/. |
Fix has been integrated into Flutter |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
The horizontal overscroll glow is being clipped or rendered incorrectly. The vertical overscroll glow is correctly rendered.
The text was updated successfully, but these errors were encountered: