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

[Impeller] Fix render transform is not correct. #39617

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

luckysmg
Copy link
Contributor

@luckysmg luckysmg commented Feb 14, 2023

Fix

We should cover zfar = +infinity and znear = -infinity.
So the zScale in MakeOrthographic should be 1 / (infinity - (-infinity)) = 1 / infinity = 0

For example in linked issue

Dart sample code
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData.light(useMaterial3: true),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Transform(
          transform: Matrix4.identity() // perspective
            ..setEntry(3, 2, 0.001)
            ..rotateX(1.01) // changed
            ..rotateY(-1.01),
          alignment: FractionalOffset.center,
          child: Container(
            height: 150,
            width: 200,
            color: Colors.red,
          ),
        ),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
skia impeller before impeller After

For test CanDrawCorrectlyWithRotatedTransformation

Before

Before.mp4

After

After.mp4

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See [testing the engine] for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the [CLA].
  • All existing and new tests are passing.

@luckysmg luckysmg marked this pull request as draft February 14, 2023 09:25
@luckysmg luckysmg changed the title WIP [Impeller] Fix render transform not correct. Feb 14, 2023
@luckysmg luckysmg marked this pull request as ready for review February 14, 2023 10:35
@luckysmg luckysmg changed the title [Impeller] Fix render transform not correct. [Impeller] Fix render transform is not correct. Feb 14, 2023
@luckysmg luckysmg requested a review from bdero February 14, 2023 10:45
@luckysmg luckysmg added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 16, 2023
@auto-submit auto-submit bot merged commit 3fc40ca into flutter:main Feb 16, 2023
@luckysmg luckysmg deleted the transform branch February 16, 2023 02:18
luckysmg added a commit that referenced this pull request Feb 16, 2023
This reverts commit 3fc40ca.
@luckysmg luckysmg restored the transform branch February 16, 2023 02:41
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 16, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Feb 16, 2023
…120850)

* b7ec9ce18 [macOS] Improve TextInputPlugin test readability (flutter/engine#39664)

* a6e8fb134 Roll Dart SDK from a594e34e85b6 to ce9397c5fc8f (1 revision) (flutter/engine#39667)

* 3fc40ca5b ++ (flutter/engine#39617)
@delfme
Copy link

delfme commented Mar 5, 2023

@luckysmg I think we still have this issue. Look at “Reply to Leo”. That is a flutter placeholder.

IMG_7805.MOV

@luckysmg
Copy link
Contributor Author

luckysmg commented Mar 6, 2023

Emm i didn't see any incorrect😳

@luckysmg luckysmg deleted the transform branch March 6, 2023 02:23
@delfme
Copy link

delfme commented Mar 6, 2023

My bad, I double checked it and was trick of the eye 👍

@delfme
Copy link

delfme commented Mar 6, 2023

Saw this yesterday, not sure if it is unrelated

flutter/flutter#121887 (comment)

@luckysmg
Copy link
Contributor Author

luckysmg commented Mar 6, 2023

I think that maybe a issue of filter (But I m not very familiar with how filter works at present o(╥﹏╥)o ).
See flutter/flutter#120879 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Transform Widget not working correctly with Impeller enable
3 participants