Skip to content
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

ShaderMask is broken and messes up layout, AppBar rendered in the middle of the screen #20859

Closed
sir-boformer opened this issue Aug 21, 2018 · 8 comments
Labels
c: regression It was better in the past than it is now engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels.

Comments

@sir-boformer
Copy link
Contributor

sir-boformer commented Aug 21, 2018

It seems like there is a bug in the engine in SceneBuilder.pushShaderMask or SceneBuilder.pop that causes this.

This makes ShaderMask unusable.

Example code (taken from the ShaderMask docs):

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Playground',
      home: TestPage(),
    );
  }
}

class TestPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: new AppBar(
        title: Text('Test'),
        backgroundColor: Colors.blue.withOpacity(0.5),
      ),
      body: Center(
        child: ShaderMask(
          shaderCallback: (Rect bounds) {
            return new RadialGradient(
              center: Alignment.topLeft,
              radius: 1.0,
              colors: <Color>[Colors.yellow, Colors.deepOrange.shade900],
              tileMode: TileMode.mirror,
            ).createShader(bounds);
          },
          child: const Text('I’m burning the memories'),
        ),
      ),
    );
  }
}

Flutter version: Latest master

@sir-boformer
Copy link
Contributor Author

@HansMuller it seems like you initially implemented ShaderMask

@sir-boformer
Copy link
Contributor Author

Here is what happens when I run the card_collection test in dev/manual_tests with the sunshine option enabled (adds a ShaderMask):

screenshot_1534847817

@sir-boformer sir-boformer changed the title ShaderMask messes up layout, AppBar rendered in the middle of the screen ShaderMask is broken and messes up layout, AppBar rendered in the middle of the screen Aug 21, 2018
@zoechi zoechi added the framework flutter/packages/flutter repository. See also f: labels. label Aug 21, 2018
@sir-boformer
Copy link
Contributor Author

@zoechi Seems like a bug in the engine

@zoechi zoechi added the engine flutter/engine repository. See also e: labels. label Sep 2, 2018
@zoechi zoechi added this to the Goals milestone Sep 2, 2018
@GaryQian GaryQian added the c: regression It was better in the past than it is now label Sep 14, 2018
jason-simmons added a commit to jason-simmons/flutter_engine that referenced this issue Sep 15, 2018
@sir-boformer
Copy link
Contributor Author

Thank you for the fix!

@knopp
Copy link
Member

knopp commented Sep 18, 2018

This seems to have caused regression in my case - I had BackdropFilter inside ShaderMask (to apply gradient with darken blend mode over blurred UI). It used to work fine but it does not anymore. Is BackdropFilter inside ShaderMask something that should be working or am I pushing it too far?

@jamesblasco
Copy link
Contributor

@knopp did you find a solution for using BackdropFilter inside ShaderMask ?

@JasCodes
Copy link

This is still an issue

@github-actions
Copy link

github-actions bot commented Aug 8, 2021

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 flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: regression It was better in the past than it is now engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

No branches or pull requests

6 participants