From 2d50ff74e80df1ecb0ea88bf3381e9a532806b5c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll Date: Fri, 13 Jan 2023 00:33:51 +0000 Subject: [PATCH 1/5] Roll Skia from dfb838747295 to 9e51c2c9e231 (26 revisions) https://skia.googlesource.com/skia.git/+log/dfb838747295..9e51c2c9e231 2023-01-12 kjlubick@google.com Roll CanvasKit to 0.38.0 2023-01-12 jonahwilliams@google.com Allow clients to cache sample count and stencil params 2023-01-12 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 0a9529c8cd2d to 4053bc460f32 (6 revisions) 2023-01-12 herb@google.com Fix stack alignment for SkAutoSTArray 2023-01-12 kjlubick@google.com Remove SkBudgeted in favor of skgpu::Budgeted 2023-01-12 johnstiles@google.com Implement comma operator in RP codegen. 2023-01-12 johnstiles@google.com Allow cloning from another stack with an offset-from-top. 2023-01-12 fmalita@chromium.org [skottie] Initial text editing experiment 2023-01-12 skia-autoroll@skia-public.iam.gserviceaccount.com Roll Dawn from 46e3e213b046 to 1f9e50edd4d4 (9 revisions) 2023-01-12 kjlubick@google.com [base] Fold GrConfig.h into SkTypes.h 2023-01-12 kjlubick@google.com Break out metal headers used by C++ and ObjC code 2023-01-12 skia-autoroll@skia-public.iam.gserviceaccount.com Roll SK Tool from 77e7d61086a2 to 65176286ea26 2023-01-12 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 154fb3872c36 to 0a9529c8cd2d (9 revisions) 2023-01-12 skia-autoroll@skia-public.iam.gserviceaccount.com Roll ANGLE from eab5947427ad to 410d8ba51f95 (17 revisions) 2023-01-12 skia-autoroll@skia-public.iam.gserviceaccount.com Roll Skia Infra from 8bedae1a44a2 to 77e7d61086a2 (4 revisions) 2023-01-12 skia-autoroll@skia-public.iam.gserviceaccount.com Roll Dawn from 410b5acc7f3f to 46e3e213b046 (14 revisions) 2023-01-12 kyslov@google.com jpegr codec: get image origin from EXIF metadata 2023-01-12 ccameron@chromium.org Enable Jpeg gainmaps on Android 2023-01-11 johnstiles@google.com Add transpose support to RP codegen. 2023-01-11 johnstiles@google.com Add transpose support to the RP builder. 2023-01-11 jvanverth@google.com Some fixes to address null color attachment crash. 2023-01-11 johnstiles@google.com Create a RP transpose op, based on swizzle. 2023-01-11 kjlubick@google.com Remove two shim files 2023-01-11 kjlubick@google.com [canvaskit] Fix return value of Paragraph ranges 2023-01-11 kjlubick@google.com Disable JpegGainmapTest on WASM build 2023-01-11 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 93e4d1cd4725 to 154fb3872c36 (2 revisions) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/skia-flutter-autoroll Please CC aaclarke@google.com,herb@google.com,jacksongardner@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md --- DEPS | 2 +- ci/licenses_golden/licenses_skia | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/DEPS b/DEPS index aa53109d7600c..db4009c2735ca 100644 --- a/DEPS +++ b/DEPS @@ -18,7 +18,7 @@ vars = { 'llvm_git': 'https://llvm.googlesource.com', # OCMock is for testing only so there is no google clone 'ocmock_git': 'https://github.com/erikdoe/ocmock.git', - 'skia_revision': 'dfb838747295b9109343e6f536b25e9fa3fe933e', + 'skia_revision': '9e51c2c9e231cf1350a476c2b1695066144593ce', # WARNING: DO NOT EDIT canvaskit_cipd_instance MANUALLY # See `lib/web_ui/README.md` for how to roll CanvasKit to a new version. diff --git a/ci/licenses_golden/licenses_skia b/ci/licenses_golden/licenses_skia index e8e3db2b4f29d..3d14a7415debc 100644 --- a/ci/licenses_golden/licenses_skia +++ b/ci/licenses_golden/licenses_skia @@ -1,4 +1,4 @@ -Signature: fa9e0cdd5cd2189db5a01faa94515a3d +Signature: 6fb22ea5d126038c1276ad346f1fb34b ==================================================================================================== LIBRARY: etc1 @@ -1216,7 +1216,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: skia -ORIGIN: ../../../third_party/skia/include/gpu/GrConfig.h + ../../../third_party/skia/LICENSE ORIGIN: ../../../third_party/skia/include/gpu/GrTypes.h + ../../../third_party/skia/LICENSE ORIGIN: ../../../third_party/skia/src/core/SkImageInfo.cpp + ../../../third_party/skia/LICENSE ORIGIN: ../../../third_party/skia/src/core/SkRasterClip.cpp + ../../../third_party/skia/LICENSE @@ -1239,7 +1238,6 @@ ORIGIN: ../../../third_party/skia/src/gpu/ganesh/geometry/GrRect.h + ../../../th ORIGIN: ../../../third_party/skia/src/ports/SkDebug_win.cpp + ../../../third_party/skia/LICENSE ORIGIN: ../../../third_party/skia/src/text/gpu/Glyph.h + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/include/gpu/GrConfig.h FILE: ../../../third_party/skia/include/gpu/GrTypes.h FILE: ../../../third_party/skia/src/core/SkImageInfo.cpp FILE: ../../../third_party/skia/src/core/SkRasterClip.cpp @@ -8924,15 +8922,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: skia -ORIGIN: ../../../third_party/skia/include/private/SkDeque.h + ../../../third_party/skia/LICENSE ORIGIN: ../../../third_party/skia/include/private/SkMalloc.h + ../../../third_party/skia/LICENSE -ORIGIN: ../../../third_party/skia/include/private/SkTo.h + ../../../third_party/skia/LICENSE ORIGIN: ../../../third_party/skia/src/core/SkDiscardableMemory.h + ../../../third_party/skia/LICENSE ORIGIN: ../../../third_party/skia/src/core/SkFloatingPoint.cpp + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/include/private/SkDeque.h FILE: ../../../third_party/skia/include/private/SkMalloc.h -FILE: ../../../third_party/skia/include/private/SkTo.h FILE: ../../../third_party/skia/src/core/SkDiscardableMemory.h FILE: ../../../third_party/skia/src/core/SkFloatingPoint.cpp ---------------------------------------------------------------------------------------------------- From 48dfa7bb19e7bcfdf1651edcab60df700ef34a9c Mon Sep 17 00:00:00 2001 From: Jackson Gardner Date: Wed, 11 Jan 2023 17:34:02 -0800 Subject: [PATCH 2/5] Adjust to changes to CanvasKit getRectsForRange API. --- .../lib/src/engine/canvaskit/canvaskit_api.dart | 14 ++++++++++++-- lib/web_ui/lib/src/engine/canvaskit/text.dart | 14 +++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/lib/web_ui/lib/src/engine/canvaskit/canvaskit_api.dart b/lib/web_ui/lib/src/engine/canvaskit/canvaskit_api.dart index fc226bfa7632f..9cffb79f76cbf 100644 --- a/lib/web_ui/lib/src/engine/canvaskit/canvaskit_api.dart +++ b/lib/web_ui/lib/src/engine/canvaskit/canvaskit_api.dart @@ -2167,6 +2167,16 @@ extension SkLineMetricsExtension on SkLineMetrics { external double get lineNumber; } +@JS() +@anonymous +@staticInterop +class SkRectWithDirection {} + +extension SkRectWithDirectionExtension on SkRectWithDirection { + external Float32List rect; + external double direction; +} + @JS() @anonymous @staticInterop @@ -2182,13 +2192,13 @@ extension SkParagraphExtension on SkParagraph { external double getMaxIntrinsicWidth(); external double getMinIntrinsicWidth(); external double getMaxWidth(); - external /* List */ List getRectsForRange( + external /* List */ List getRectsForRange( int start, int end, SkRectHeightStyle heightStyle, SkRectWidthStyle widthStyle, ); - external /* List */ List getRectsForPlaceholders(); + external /* List */ List getRectsForPlaceholders(); external SkTextPosition getGlyphPositionAtCoordinate( double x, double y, diff --git a/lib/web_ui/lib/src/engine/canvaskit/text.dart b/lib/web_ui/lib/src/engine/canvaskit/text.dart index 0828763cdb531..dd5096ccc8c42 100644 --- a/lib/web_ui/lib/src/engine/canvaskit/text.dart +++ b/lib/web_ui/lib/src/engine/canvaskit/text.dart @@ -631,7 +631,7 @@ class CkParagraph extends SkiaObject implements ui.Paragraph { _width = paragraph.getMaxWidth(); _boxesForPlaceholders = skRectsToTextBoxes( - paragraph.getRectsForPlaceholders().cast()); + paragraph.getRectsForPlaceholders().cast()); } catch (e) { printWarning('CanvasKit threw an exception while laying ' 'out the paragraph. The font was "${_paragraphStyle._fontFamily}". ' @@ -732,23 +732,23 @@ class CkParagraph extends SkiaObject implements ui.Paragraph { } final SkParagraph paragraph = _ensureInitialized(_lastLayoutConstraints!); - final List skRects = paragraph.getRectsForRange( + final List skRects = paragraph.getRectsForRange( start, end, toSkRectHeightStyle(boxHeightStyle), toSkRectWidthStyle(boxWidthStyle), - ).cast(); + ).cast(); return skRectsToTextBoxes(skRects); } - List skRectsToTextBoxes(List skRects) { + List skRectsToTextBoxes(List skRects) { final List result = []; for (int i = 0; i < skRects.length; i++) { - final Float32List rect = skRects[i]; - final int skTextDirection = - getJsProperty(getJsProperty(rect, 'direction'), 'value'); + final SkRectWithDirection skRect = skRects[i]; + final Float32List rect = skRect.rect; + final int skTextDirection = skRect.direction.toInt(); result.add(ui.TextBox.fromLTRBD( rect[0], rect[1], From 5e355fbfbf93560a657d33ea1590209477c3bba4 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Thu, 12 Jan 2023 18:28:13 -0800 Subject: [PATCH 3/5] remove unused commit --- lib/web_ui/lib/src/engine/canvaskit/text.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/web_ui/lib/src/engine/canvaskit/text.dart b/lib/web_ui/lib/src/engine/canvaskit/text.dart index dd5096ccc8c42..99ca81c61a945 100644 --- a/lib/web_ui/lib/src/engine/canvaskit/text.dart +++ b/lib/web_ui/lib/src/engine/canvaskit/text.dart @@ -7,7 +7,6 @@ import 'dart:typed_data'; import 'package:meta/meta.dart'; import 'package:ui/ui.dart' as ui; -import '../safe_browser_api.dart'; import '../util.dart'; import 'canvaskit_api.dart'; import 'font_fallbacks.dart'; From e0ca0d25fe4933528e6780c07af267e7eca463bb Mon Sep 17 00:00:00 2001 From: Jackson Gardner Date: Thu, 12 Jan 2023 18:23:13 -0800 Subject: [PATCH 4/5] Roll CIPD CanvasKit and fix some unit tests. --- DEPS | 2 +- lib/web_ui/dev/canvaskit_lock.yaml | 2 +- lib/web_ui/lib/src/engine/configuration.dart | 2 +- .../test/canvaskit/canvaskit_api_test.dart | 28 +++++++++++-------- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/DEPS b/DEPS index db4009c2735ca..8a44976a83ce9 100644 --- a/DEPS +++ b/DEPS @@ -22,7 +22,7 @@ vars = { # WARNING: DO NOT EDIT canvaskit_cipd_instance MANUALLY # See `lib/web_ui/README.md` for how to roll CanvasKit to a new version. - 'canvaskit_cipd_instance': 'ztaLvbs5GPmlAwUosC7VVp7EQnNVknRpNuKdv7vmzaAC', + 'canvaskit_cipd_instance': '61aeJQ9laGfEFF_Vlc_u0MCkqB6xb2hAYHRBxKH-Uw4C', # Do not download the Emscripten SDK by default. # This prevents us from downloading the Emscripten toolchain for builds diff --git a/lib/web_ui/dev/canvaskit_lock.yaml b/lib/web_ui/dev/canvaskit_lock.yaml index 251e759555951..ab4826af1a057 100644 --- a/lib/web_ui/dev/canvaskit_lock.yaml +++ b/lib/web_ui/dev/canvaskit_lock.yaml @@ -1,4 +1,4 @@ # Specifies the version of CanvasKit to use for Flutter Web apps. # # See `lib/web_ui/README.md` for how to update this file. -canvaskit_version: "0.37.1" +canvaskit_version: "0.38.0" diff --git a/lib/web_ui/lib/src/engine/configuration.dart b/lib/web_ui/lib/src/engine/configuration.dart index 1e89528992962..e1e16cae5dd8b 100644 --- a/lib/web_ui/lib/src/engine/configuration.dart +++ b/lib/web_ui/lib/src/engine/configuration.dart @@ -51,7 +51,7 @@ import 'dom.dart'; /// The version of CanvasKit used by the web engine by default. // DO NOT EDIT THE NEXT LINE OF CODE MANUALLY // See `lib/web_ui/README.md` for how to roll CanvasKit to a new version. -const String _canvaskitVersion = '0.37.1'; +const String _canvaskitVersion = '0.38.0'; /// The Web Engine configuration for the current application. FlutterConfiguration get configuration => diff --git a/lib/web_ui/test/canvaskit/canvaskit_api_test.dart b/lib/web_ui/test/canvaskit/canvaskit_api_test.dart index cd76ddcbeb7af..2eedcc1d6891f 100644 --- a/lib/web_ui/test/canvaskit/canvaskit_api_test.dart +++ b/lib/web_ui/test/canvaskit/canvaskit_api_test.dart @@ -1669,8 +1669,14 @@ void _paragraphTests() { expectAlmost(paragraph.getMaxIntrinsicWidth(), 263); expectAlmost(paragraph.getMinIntrinsicWidth(), 135); expectAlmost(paragraph.getMaxWidth(), 500); + final SkRectWithDirection rectWithDirection = + paragraph.getRectsForRange( + 1, + 3, + canvasKit.RectHeightStyle.Tight, + canvasKit.RectWidthStyle.Max).single! as SkRectWithDirection; expect( - paragraph.getRectsForRange(1, 3, canvasKit.RectHeightStyle.Tight, canvasKit.RectWidthStyle.Max).single, + rectWithDirection.rect, hasLength(4), ); expect(paragraph.getRectsForPlaceholders(), hasLength(1)); @@ -1739,17 +1745,15 @@ void _paragraphTests() { final SkParagraph paragraph = builder.build(); paragraph.layout(500); - expect( - paragraph.getRectsForRange( - 0, - 1, - canvasKit.RectHeightStyle.Strut, - canvasKit.RectWidthStyle.Tight, - ), - >[ - [0, 0, 13.770000457763672, 75], - ], - ); + final List rects = paragraph.getRectsForRange( + 0, + 1, + canvasKit.RectHeightStyle.Strut, + canvasKit.RectWidthStyle.Tight, + ).cast(); + expect(rects.length, 1); + final SkRectWithDirection rect = rects.first; + expect(rect.rect, [0, 0, 13.770000457763672, 75]); }); test('TextHeightBehavior', () { From 581502d37386f3035934d6508bd6d0a3b6a855e1 Mon Sep 17 00:00:00 2001 From: Jackson Gardner Date: Thu, 12 Jan 2023 18:37:12 -0800 Subject: [PATCH 5/5] Adjustments to direction API and unit tests. --- lib/web_ui/lib/src/engine/canvaskit/canvaskit_api.dart | 2 +- lib/web_ui/lib/src/engine/canvaskit/text.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/web_ui/lib/src/engine/canvaskit/canvaskit_api.dart b/lib/web_ui/lib/src/engine/canvaskit/canvaskit_api.dart index 9cffb79f76cbf..28bcd04e85294 100644 --- a/lib/web_ui/lib/src/engine/canvaskit/canvaskit_api.dart +++ b/lib/web_ui/lib/src/engine/canvaskit/canvaskit_api.dart @@ -2174,7 +2174,7 @@ class SkRectWithDirection {} extension SkRectWithDirectionExtension on SkRectWithDirection { external Float32List rect; - external double direction; + external SkTextDirection dir; } @JS() diff --git a/lib/web_ui/lib/src/engine/canvaskit/text.dart b/lib/web_ui/lib/src/engine/canvaskit/text.dart index 99ca81c61a945..11096a8fd2782 100644 --- a/lib/web_ui/lib/src/engine/canvaskit/text.dart +++ b/lib/web_ui/lib/src/engine/canvaskit/text.dart @@ -747,7 +747,7 @@ class CkParagraph extends SkiaObject implements ui.Paragraph { for (int i = 0; i < skRects.length; i++) { final SkRectWithDirection skRect = skRects[i]; final Float32List rect = skRect.rect; - final int skTextDirection = skRect.direction.toInt(); + final int skTextDirection = skRect.dir.value.toInt(); result.add(ui.TextBox.fromLTRBD( rect[0], rect[1],