Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@ferhatb
Copy link
Contributor

@ferhatb ferhatb commented May 6, 2020

Fixes cupertino alert rendering.
Related issues:
flutter/flutter#49877
flutter/flutter#51701

  1. drawPath now passes winding rule to html canvas.
  2. Fixed Path.getBounds and added test.
  3. Added code to skip empty paths in recording canvas.
  4. Optimized runPath code. dart2js change below:

Before:

_runPath$2: function(ctx, path) {
      var t1, t2, _i, t3, t4, _i0, command;
      ctx.beginPath();
      for (t1 = path.subpaths, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, H.throwConcurrentModificationError)(t1), ++_i)
        for (t3 = t1[_i].commands, t4 = t3.length, _i0 = 0; _i0 < t3.length; t3.length === t4 || (0, H.throwConcurrentModificationError)(t3), ++_i0) {
          command = t3[_i0];
          switch (command.type) {
            case 5:....

After:

_runPath$2: function(ctx, path) {
	      var subpaths, subpathCount, subPathIndex, commands, commandCount, c, command;
	      ctx.beginPath();
	      subpaths = path.subpaths;
	      subpathCount = subpaths.length;
	      for (subPathIndex = 0; subPathIndex < subpathCount; ++subPathIndex) {
	        commands = subpaths[subPathIndex].commands;
	        commandCount = commands.length;
	        for (c = 0; c < commandCount; ++c) {
	          command = commands[c];
	          switch (command.type) {
	            case 5:

Winding rule test:

Screen Shot 2020-05-05 at 7 17 59 PM

if (paintSpread != 0.0) {
pathBounds = pathBounds.inflate(paintSpread);
SurfacePath sPath = path;
if (sPath.subpaths.isNotEmpty) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I think I saw this in the cupertino slider as well. There were some commands thrown into the canvas without anything actually painted.

@ferhatb ferhatb merged commit 80c090d into flutter:master May 6, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 6, 2020
GaryQian pushed a commit to flutter/flutter that referenced this pull request May 6, 2020
* c2c6ad9 Roll src/third_party/skia 41e377d1baf0..3d311a983bf0 (9 commits) (flutter/engine#18150)

* a0983d3 [web] Add support for ColorFilter on images (flutter/engine#18111)

* 905836d [web] Upgrade the test package to remove the dependency on package_resolver (flutter/engine#18135)

* 0645e93 Manually add dependency for shelf_proxy (flutter/engine#18151)

* d104f87 Roll src/third_party/skia 3d311a983bf0..0cbd58766ace (2 commits) (flutter/engine#18152)

* b1b1df0 Roll fuchsia/sdk/core/mac-amd64 from ERGnT... to c5NQZ... (flutter/engine#18155)

* 8a8cd5d Roll src/third_party/dart 7bb38670d279..1ef444139c4c (22 commits) (flutter/engine#18161)

* c1068de gpu_metal_surface `submitframe` return false when canvas is null (flutter/engine#18154)

* cf13c7f [iOS platform view] fix active_composition_order_ never cleared (flutter/engine#18153)

* 805a887 Add first Linux shell tests (flutter/engine#18159)

* 80c090d Fix path bounds for multiple rects. Implement winding rules (flutter/engine#18165)

* 15752ee Roll src/third_party/skia 0cbd58766ace..e1c0cb3de8ab (8 commits) (flutter/engine#18167)

* c1bd64a Roll src/third_party/skia e1c0cb3de8ab..1e8fb04b29b9 (3 commits) (flutter/engine#18168)

* 6a379cc Roll fuchsia/sdk/core/linux-amd64 from gnNdl... to RpHTv... (flutter/engine#18171)

* 961fa14 Roll src/third_party/dart 1ef444139c4c..8c8249fa0123 (11 commits) (flutter/engine#18172)

* 337ec63 Roll src/third_party/skia 1e8fb04b29b9..c5727d8e34d2 (1 commits) (flutter/engine#18173)

* bc30355 Roll src/third_party/skia c5727d8e34d2..999257d870d7 (5 commits) (flutter/engine#18174)

* c3cd83b Roll fuchsia/sdk/core/mac-amd64 from c5NQZ... to jMJqf... (flutter/engine#18175)

* Updated bin/internal/fuchsia-linux.version

* Updated bin/internal/fuchsia-mac.version
@ferhatb ferhatb deleted the cupertinofilter branch May 8, 2020 19:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants