Giter VIP home page Giter VIP logo

Comments (9)

zhangwen0510 avatar zhangwen0510 commented on July 2, 2024

@gaaclarke @darshankawar

from flutter.

gaaclarke avatar gaaclarke commented on July 2, 2024

The cl that made png compression work for skia had unit tests at the skia layer and an integration test that just make sure it didn't error. There may be a different integration problem that the current tests don't cover. I'll give it a look on monday, thanks for the reproduction code.

from flutter.

gaaclarke avatar gaaclarke commented on July 2, 2024

The CL's are listed in this PR if you want to poke around before monday: flutter/engine#53182

from flutter.

zhangwen0510 avatar zhangwen0510 commented on July 2, 2024

The CL's are listed in this PR if you want to poke around before monday: flutter/engine#53182

Yes, I updated the master branch this morning. The latest code includes this PR, and then I encountered this error.

from flutter.

huycozy avatar huycozy commented on July 2, 2024

Thanks for the report. Reproduced this issue on master channel while it works as expected on stable 3.22.2. If I disable Impeller, issue does not appear.

flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.1 23B74 darwin-x64, locale en-VN)
    • Flutter version 3.22.2 on channel stable at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747bfc5 (31 hours ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode15.3.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

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

[✓] Android Studio (version 2023.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /Applications/Android Studio.app/
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

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

[✓] Connected device (3 available)
    • iPhone (mobile) • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios            • iOS 15.8 19H370
    • macOS (desktop) • macos                                    • darwin-x64     • macOS 14.1 23B74 darwin-x64
    • Chrome (web)    • chrome                                   • web-javascript • Google Chrome 125.0.6422.142

[✓] Network resources
    • All expected network resources are available.

• No issues found!
[!] Flutter (Channel master, 3.23.0-13.0.pre.168, on macOS 14.1 23B74 darwin-x64, locale en-VN)
    • Flutter version 3.23.0-13.0.pre.168 on channel master at /Users/huynq/Documents/GitHub/flutter_master
    ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 32081aab69 (34 hours ago), 2024-06-08 10:35:21 -0700
    • Engine revision 1cdbebee19
    • Dart version 3.5.0 (build 3.5.0-236.0.dev)
    • DevTools version 2.36.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode15.3.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

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

[✓] Android Studio (version 2023.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /Applications/Android Studio.app/
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

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

[✓] Connected device (4 available)
    • Pixel 7 (mobile) • 2B171FDH20084L                           • android-arm64  • Android 14 (API 34)
    • iPhone (mobile)  • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios            • iOS 15.8 19H370
    • macOS (desktop)  • macos                                    • darwin-x64     • macOS 14.1 23B74 darwin-x64
    • Chrome (web)     • chrome                                   • web-javascript • Google Chrome 125.0.6422.142

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

from flutter.

jonahwilliams avatar jonahwilliams commented on July 2, 2024

@gaaclarke assigning to you to investigate.

from flutter.

gaaclarke avatar gaaclarke commented on July 2, 2024
  • I tweaked the skcms change to always return a solid color, but the png is still wrong, having, being vertical lines of red. So, so the error isn't in the skcms change.
  • It's weird that the png still has the form. This suggests that the alpha channels and stride are correct.
  • I audited the skia CL too, and it doesn't really do much. There isn't much room for there to be a bug. It almost seems like there is some switch statement's default branch we are hitting, the bug is not in the changed code but code that wasn't changed.

from flutter.

gaaclarke avatar gaaclarke commented on July 2, 2024

There is one bug in skcms but fixing it doesn't solve the weird artifacts we are seeing. I misread the spec and the lowest 6 bits are padding, not the highest. So the following change is needed:

diff --git a/modules/skcms/src/Transform_inl.h b/modules/skcms/src/Transform_inl.h
index b9c27ac395..31259e3d6d 100644
--- a/modules/skcms/src/Transform_inl.h
+++ b/modules/skcms/src/Transform_inl.h
@@ -903,14 +903,14 @@ STAGE(load_101010x_XR, NoCtx) {
 }
 
 STAGE(load_10101010_XR, NoCtx) {
-    static constexpr float min = -0.752941f;
-    static constexpr float max = 1.25098f;
-    static constexpr float range = max - min;
+    // static constexpr float min = -0.752941f;
+    // static constexpr float max = 1.25098f;
+    // static constexpr float range = max - min;
     U64 rgba = load<U64>(src + 8*i);
-    r = cast<F>((rgba >>  0) & 0x3ff) * (1/1023.0f) * range + min;
-    g = cast<F>((rgba >> 16) & 0x3ff) * (1/1023.0f) * range + min;
-    b = cast<F>((rgba >> 32) & 0x3ff) * (1/1023.0f) * range + min;
-    a = cast<F>((rgba >> 48) & 0x3ff) * (1/1023.0f) * range + min;
+    r = (cast<F>((rgba >>  (0+6)) & 0x3ff) - 384.f) / 510.f;
+    g = (cast<F>((rgba >> (16+6)) & 0x3ff) - 384.f) / 510.f;
+    b = (cast<F>((rgba >> (32+6)) & 0x3ff) - 384.f) / 510.f;
+    a = (cast<F>((rgba >> (48+6)) & 0x3ff) - 384.f) / 510.f;
 }

from flutter.

gaaclarke avatar gaaclarke commented on July 2, 2024

Okay, got it working, skia also needed this:

--- a/src/encode/SkImageEncoderFns.h
+++ b/src/encode/SkImageEncoderFns.h
@@ -138,7 +138,7 @@ static inline void transform_scanline_bgr_101010x_xr(char* dst, const char* src,
 static inline void transform_scanline_bgra_10101010_xr(char* dst, const char* src, int width, int) {
     skcms(dst, src, width,
           skcms_PixelFormat_BGRA_10101010_XR, skcms_AlphaFormat_Unpremul,
-          skcms_PixelFormat_RGB_161616BE,     skcms_AlphaFormat_Unpremul);
+          skcms_PixelFormat_RGBA_16161616BE,  skcms_AlphaFormat_Unpremul);
 }

I'll get everything cleaned up and beef up the tests to get this landed.

from flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.