From bd471f7a8aed450e1330fbc37a9868d61b3f1ecd Mon Sep 17 00:00:00 2001 From: Jackson Gardner Date: Wed, 1 May 2024 17:08:05 -0700 Subject: [PATCH] [skwasm] Don't mark the backend texture as mipmapped, since it isn't. (flutter/engine#52501) We don't actually produce mipmaps for any of the textures generated through the `TextureSourceImageGenerator`, even if it is requested of us. So we shouldn't mark the texture as mipmapped in this case. This will allow rendering mechanisms to fall back to a non-mipmapped rendering strategy as needed. --- engine/src/flutter/lib/web_ui/skwasm/image.cpp | 2 +- engine/src/flutter/lib/web_ui/test/ui/image_golden_test.dart | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/lib/web_ui/skwasm/image.cpp b/engine/src/flutter/lib/web_ui/skwasm/image.cpp index def216398a..0c9919f6b4 100644 --- a/engine/src/flutter/lib/web_ui/skwasm/image.cpp +++ b/engine/src/flutter/lib/web_ui/skwasm/image.cpp @@ -100,7 +100,7 @@ class TextureSourceImageGenerator : public GrExternalTextureGenerator { glInfo.fTarget = GL_TEXTURE_2D; auto backendTexture = GrBackendTextures::MakeGL( - fInfo.width(), fInfo.height(), mipmapped, glInfo); + fInfo.width(), fInfo.height(), skgpu::Mipmapped::kNo, glInfo); // In order to bind the image source to the texture, makeTexture has changed // which texture is "in focus" for the WebGL context. diff --git a/engine/src/flutter/lib/web_ui/test/ui/image_golden_test.dart b/engine/src/flutter/lib/web_ui/test/ui/image_golden_test.dart index 504aa6eec1..f126afb94a 100644 --- a/engine/src/flutter/lib/web_ui/test/ui/image_golden_test.dart +++ b/engine/src/flutter/lib/web_ui/test/ui/image_golden_test.dart @@ -192,9 +192,9 @@ Future testMain() async { await drawOvalWithShader(const ui.Rect.fromLTRB(0, 0, 150, 100), ui.FilterQuality.none); await drawOvalWithShader(const ui.Rect.fromLTRB(150, 0, 300, 100), ui.FilterQuality.low); - // Note that for images that skia handles lazily (ones created via + // Note that for images that CanvasKit handles lazily (ones created via // `createImageFromImageBitmap` or `instantiateImageCodecFromUrl`) - // there is a skia bug that this just renders a black oval instead of + // there is a CanvasKit bug that this just renders a black oval instead of // actually texturing it with the image. // See https://g-issues.skia.org/issues/338095525 await drawOvalWithShader(const ui.Rect.fromLTRB(0, 100, 150, 200), ui.FilterQuality.medium);