Skip to content

[Web] [CanvasKit] WebGL errors when using HtmlElementView  #49947

@cbenhagen

Description

@cbenhagen

In a full app I see lots of rendering issues caused by this error. In this simple example there is only the error.

/cc @hterkelsen

WebGL: INVALID_OPERATION: bindTexture: object does not belong to this context
[.WebGL-0x7fc2991f8e00]GL ERROR :GL_INVALID_OPERATION : glDrawElements: Source and destination textures of the draw are the same.
import 'dart:html';
import 'dart:ui' as ui;

import 'package:flutter/material.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  double opacity = 0;

  @override
  void initState() {
    super.initState();
    ui.platformViewRegistry
        .registerViewFactory('xyz', (int viewId) => SpanElement());

    WidgetsBinding.instance.addPostFrameCallback((_) {
      setState(() {
        opacity = 1;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Column(
        children: <Widget>[
          Expanded(
            child: AnimatedOpacity(
              duration: Duration(seconds: 4),
              opacity: opacity,
              child: Container(
                child: FlutterLogo(size: 400),
              ),
            ),
          ),
          Container(
            height: 400,
            child: HtmlElementView(viewType: 'xyz'),
          ),
        ],
      ),
    );
  }
}
[✓] Flutter (Channel master, v1.14.7-pre.83, on Mac OS X 10.15.2 19C57, locale en-CH)
    • Flutter version 1.14.7-pre.83 at /Users/ben/Projects/flutter
    • Framework revision e10df3c1a6 (14 hours ago), 2020-02-01 11:23:01 +0800
    • Engine revision e625e174c5
    • Dart version 2.8.0 (build 2.8.0-dev.6.0 5ae5aff640)


[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/ben/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.8.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 43.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.41.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.7.1

[✓] Connected device (3 available)
    • macOS      • macOS      • darwin-x64     • Mac OS X 10.15.2 19C57
    • Chrome     • chrome     • web-javascript • Google Chrome 79.0.3945.130
    • Web Server • web-server • web-javascript • Flutter Tools

• No issues found!

Metadata

Metadata

Labels

c: crashStack traces logged to the consolee: web_canvaskitCanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Webengineflutter/engine related. See also e: labels.platform-webWeb applications specifically

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions