{"action":"created","comment":{"url":"https://api.github.com/repos/flutter/flutter/pulls/comments/225750369","pull_request_review_id":165419832,"id":225750369,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTc1MDM2OQ==","diff_hunk":"@@ -41,6 +41,33 @@ abstract class Layer extends AbstractNode with DiagnosticableTreeMixin {\n   @override\n   ContainerLayer get parent => super.parent;\n \n+  // Whether this layer has any changes since it's last added to the engine\n+  // using [addToScene]. Initialized to true as a new layer has never called\n+  // [addToScene].\n+  bool _isDirty = true;\n+\n+  /// Mark that this layer has changed and we need to upload changes to the\n+  /// engine using [addToScene].\n+  void markDirty() { _isDirty = true; }\n+\n+  // Whether any layer in the subtree of this layer is dirty ([_isDirty]).\n+  bool _isSubtreeDirty;\n+\n+  ui.EngineLayer _engineLayer;\n+\n+  /// Traverse the layer tree and compute if any subtree has a dirty layer (by\n+  /// calling [markDirty]).\n+  void updateSubtreeDirtiness() {\n+    _isSubtreeDirty = _isDirty;\n+    if (this is ContainerLayer) {\n+      final ContainerLayer container = this;\n+      for (Layer child = container.firstChild; child != null; child = child.nextSibling) {\n+        child.updateSubtreeDirtiness();\n+        _isSubtreeDirty = _isSubtreeDirty || child._isSubtreeDirty;\n+      }\n+    }\n+  }","path":"packages/flutter/lib/src/rendering/layer.dart","position":38,"original_position":38,"commit_id":"4c812e4efdbad23c66be43d90985eb2fbe13c9ce","original_commit_id":"4c812e4efdbad23c66be43d90985eb2fbe13c9ce","user":{"login":"Hixie","id":551196,"node_id":"MDQ6VXNlcjU1MTE5Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/551196?v=4","gravatar_id":"","url":"https://api.github.com/users/Hixie","html_url":"https://github.com/Hixie","followers_url":"https://api.github.com/users/Hixie/followers","following_url":"https://api.github.com/users/Hixie/following{/other_user}","gists_url":"https://api.github.com/users/Hixie/gists{/gist_id}","starred_url":"https://api.github.com/users/Hixie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hixie/subscriptions","organizations_url":"https://api.github.com/users/Hixie/orgs","repos_url":"https://api.github.com/users/Hixie/repos","events_url":"https://api.github.com/users/Hixie/events{/privacy}","received_events_url":"https://api.github.com/users/Hixie/received_events","type":"User","site_admin":false},"body":"oh i see, it's not O(N^2) because you only run this once, before sending the layers up to the engine.\r\n\r\nI recommend making this private, and having a single method that does all the logic of updating these bits, creating the SceneBuilder, calling addToScene, and eventually returning a Scene. That way the two places where you call this method would just call that method and there would be less danger of someone thinking they had to call this method sometimes. (That would also allow you to make addToScene protected.)","created_at":"2018-10-17T00:37:35Z","updated_at":"2018-10-17T00:37:36Z","html_url":"https://github.com/flutter/flutter/pull/22566#discussion_r225750369","pull_request_url":"https://api.github.com/repos/flutter/flutter/pulls/22566","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments/225750369"},"html":{"href":"https://github.com/flutter/flutter/pull/22566#discussion_r225750369"},"pull_request":{"href":"https://api.github.com/repos/flutter/flutter/pulls/22566"}},"in_reply_to_id":225748310},"pull_request":{"url":"https://api.github.com/repos/flutter/flutter/pulls/22566","id":219798441,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5Nzk4NDQx","html_url":"https://github.com/flutter/flutter/pull/22566","diff_url":"https://github.com/flutter/flutter/pull/22566.diff","patch_url":"https://github.com/flutter/flutter/pull/22566.patch","issue_url":"https://api.github.com/repos/flutter/flutter/issues/22566","number":22566,"state":"open","locked":false,"title":"Maintain dirtiness and use retained engine layers","user":{"login":"liyuqian","id":22987568,"node_id":"MDQ6VXNlcjIyOTg3NTY4","avatar_url":"https://avatars2.githubusercontent.com/u/22987568?v=4","gravatar_id":"","url":"https://api.github.com/users/liyuqian","html_url":"https://github.com/liyuqian","followers_url":"https://api.github.com/users/liyuqian/followers","following_url":"https://api.github.com/users/liyuqian/following{/other_user}","gists_url":"https://api.github.com/users/liyuqian/gists{/gist_id}","starred_url":"https://api.github.com/users/liyuqian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liyuqian/subscriptions","organizations_url":"https://api.github.com/users/liyuqian/orgs","repos_url":"https://api.github.com/users/liyuqian/repos","events_url":"https://api.github.com/users/liyuqian/events{/privacy}","received_events_url":"https://api.github.com/users/liyuqian/received_events","type":"User","site_admin":false},"body":"flutter/flutter#21756","created_at":"2018-10-02T18:18:50Z","updated_at":"2018-10-17T00:37:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1df05e54d779b919ff4dd6ce20c0fff75ca5edb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":487496476,"node_id":"MDU6TGFiZWw0ODc0OTY0NzY=","url":"https://api.github.com/repos/flutter/flutter/labels/cla:%20yes","name":"cla: yes","color":"ffffff","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/flutter/flutter/pulls/22566/commits","review_comments_url":"https://api.github.com/repos/flutter/flutter/pulls/22566/comments","review_comment_url":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/22566/comments","statuses_url":"https://api.github.com/repos/flutter/flutter/statuses/4c812e4efdbad23c66be43d90985eb2fbe13c9ce","head":{"label":"liyuqian:retained_upload_1","ref":"retained_upload_1","sha":"4c812e4efdbad23c66be43d90985eb2fbe13c9ce","user":{"login":"liyuqian","id":22987568,"node_id":"MDQ6VXNlcjIyOTg3NTY4","avatar_url":"https://avatars2.githubusercontent.com/u/22987568?v=4","gravatar_id":"","url":"https://api.github.com/users/liyuqian","html_url":"https://github.com/liyuqian","followers_url":"https://api.github.com/users/liyuqian/followers","following_url":"https://api.github.com/users/liyuqian/following{/other_user}","gists_url":"https://api.github.com/users/liyuqian/gists{/gist_id}","starred_url":"https://api.github.com/users/liyuqian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liyuqian/subscriptions","organizations_url":"https://api.github.com/users/liyuqian/orgs","repos_url":"https://api.github.com/users/liyuqian/repos","events_url":"https://api.github.com/users/liyuqian/events{/privacy}","received_events_url":"https://api.github.com/users/liyuqian/received_events","type":"User","site_admin":false},"repo":{"id":130421804,"node_id":"MDEwOlJlcG9zaXRvcnkxMzA0MjE4MDQ=","name":"flutter","full_name":"liyuqian/flutter","private":false,"owner":{"login":"liyuqian","id":22987568,"node_id":"MDQ6VXNlcjIyOTg3NTY4","avatar_url":"https://avatars2.githubusercontent.com/u/22987568?v=4","gravatar_id":"","url":"https://api.github.com/users/liyuqian","html_url":"https://github.com/liyuqian","followers_url":"https://api.github.com/users/liyuqian/followers","following_url":"https://api.github.com/users/liyuqian/following{/other_user}","gists_url":"https://api.github.com/users/liyuqian/gists{/gist_id}","starred_url":"https://api.github.com/users/liyuqian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liyuqian/subscriptions","organizations_url":"https://api.github.com/users/liyuqian/orgs","repos_url":"https://api.github.com/users/liyuqian/repos","events_url":"https://api.github.com/users/liyuqian/events{/privacy}","received_events_url":"https://api.github.com/users/liyuqian/received_events","type":"User","site_admin":false},"html_url":"https://github.com/liyuqian/flutter","description":"Flutter makes it easy and fast to build beautiful mobile apps.","fork":true,"url":"https://api.github.com/repos/liyuqian/flutter","forks_url":"https://api.github.com/repos/liyuqian/flutter/forks","keys_url":"https://api.github.com/repos/liyuqian/flutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liyuqian/flutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liyuqian/flutter/teams","hooks_url":"https://api.github.com/repos/liyuqian/flutter/hooks","issue_events_url":"https://api.github.com/repos/liyuqian/flutter/issues/events{/number}","events_url":"https://api.github.com/repos/liyuqian/flutter/events","assignees_url":"https://api.github.com/repos/liyuqian/flutter/assignees{/user}","branches_url":"https://api.github.com/repos/liyuqian/flutter/branches{/branch}","tags_url":"https://api.github.com/repos/liyuqian/flutter/tags","blobs_url":"https://api.github.com/repos/liyuqian/flutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liyuqian/flutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liyuqian/flutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/liyuqian/flutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liyuqian/flutter/statuses/{sha}","languages_url":"https://api.github.com/repos/liyuqian/flutter/languages","stargazers_url":"https://api.github.com/repos/liyuqian/flutter/stargazers","contributors_url":"https://api.github.com/repos/liyuqian/flutter/contributors","subscribers_url":"https://api.github.com/repos/liyuqian/flutter/subscribers","subscription_url":"https://api.github.com/repos/liyuqian/flutter/subscription","commits_url":"https://api.github.com/repos/liyuqian/flutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/liyuqian/flutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/liyuqian/flutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/liyuqian/flutter/issues/comments{/number}","contents_url":"https://api.github.com/repos/liyuqian/flutter/contents/{+path}","compare_url":"https://api.github.com/repos/liyuqian/flutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liyuqian/flutter/merges","archive_url":"https://api.github.com/repos/liyuqian/flutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liyuqian/flutter/downloads","issues_url":"https://api.github.com/repos/liyuqian/flutter/issues{/number}","pulls_url":"https://api.github.com/repos/liyuqian/flutter/pulls{/number}","milestones_url":"https://api.github.com/repos/liyuqian/flutter/milestones{/number}","notifications_url":"https://api.github.com/repos/liyuqian/flutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liyuqian/flutter/labels{/name}","releases_url":"https://api.github.com/repos/liyuqian/flutter/releases{/id}","deployments_url":"https://api.github.com/repos/liyuqian/flutter/deployments","created_at":"2018-04-20T23:14:51Z","updated_at":"2018-10-15T23:38:59Z","pushed_at":"2018-10-15T23:39:02Z","git_url":"git://github.com/liyuqian/flutter.git","ssh_url":"git@github.com:liyuqian/flutter.git","clone_url":"https://github.com/liyuqian/flutter.git","svn_url":"https://github.com/liyuqian/flutter","homepage":"https://flutter.io","size":48757,"stargazers_count":0,"watchers_count":0,"language":"Dart","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"flutter:master","ref":"master","sha":"bdc3dda5f298f50b432faaffe71730c4fe26afda","user":{"login":"flutter","id":14101776,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTAxNzc2","avatar_url":"https://avatars3.githubusercontent.com/u/14101776?v=4","gravatar_id":"","url":"https://api.github.com/users/flutter","html_url":"https://github.com/flutter","followers_url":"https://api.github.com/users/flutter/followers","following_url":"https://api.github.com/users/flutter/following{/other_user}","gists_url":"https://api.github.com/users/flutter/gists{/gist_id}","starred_url":"https://api.github.com/users/flutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flutter/subscriptions","organizations_url":"https://api.github.com/users/flutter/orgs","repos_url":"https://api.github.com/users/flutter/repos","events_url":"https://api.github.com/users/flutter/events{/privacy}","received_events_url":"https://api.github.com/users/flutter/received_events","type":"Organization","site_admin":false},"repo":{"id":31792824,"node_id":"MDEwOlJlcG9zaXRvcnkzMTc5MjgyNA==","name":"flutter","full_name":"flutter/flutter","private":false,"owner":{"login":"flutter","id":14101776,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTAxNzc2","avatar_url":"https://avatars3.githubusercontent.com/u/14101776?v=4","gravatar_id":"","url":"https://api.github.com/users/flutter","html_url":"https://github.com/flutter","followers_url":"https://api.github.com/users/flutter/followers","following_url":"https://api.github.com/users/flutter/following{/other_user}","gists_url":"https://api.github.com/users/flutter/gists{/gist_id}","starred_url":"https://api.github.com/users/flutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flutter/subscriptions","organizations_url":"https://api.github.com/users/flutter/orgs","repos_url":"https://api.github.com/users/flutter/repos","events_url":"https://api.github.com/users/flutter/events{/privacy}","received_events_url":"https://api.github.com/users/flutter/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/flutter/flutter","description":"Flutter makes it easy and fast to build beautiful mobile apps.","fork":false,"url":"https://api.github.com/repos/flutter/flutter","forks_url":"https://api.github.com/repos/flutter/flutter/forks","keys_url":"https://api.github.com/repos/flutter/flutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flutter/flutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flutter/flutter/teams","hooks_url":"https://api.github.com/repos/flutter/flutter/hooks","issue_events_url":"https://api.github.com/repos/flutter/flutter/issues/events{/number}","events_url":"https://api.github.com/repos/flutter/flutter/events","assignees_url":"https://api.github.com/repos/flutter/flutter/assignees{/user}","branches_url":"https://api.github.com/repos/flutter/flutter/branches{/branch}","tags_url":"https://api.github.com/repos/flutter/flutter/tags","blobs_url":"https://api.github.com/repos/flutter/flutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flutter/flutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flutter/flutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/flutter/flutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flutter/flutter/statuses/{sha}","languages_url":"https://api.github.com/repos/flutter/flutter/languages","stargazers_url":"https://api.github.com/repos/flutter/flutter/stargazers","contributors_url":"https://api.github.com/repos/flutter/flutter/contributors","subscribers_url":"https://api.github.com/repos/flutter/flutter/subscribers","subscription_url":"https://api.github.com/repos/flutter/flutter/subscription","commits_url":"https://api.github.com/repos/flutter/flutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/flutter/flutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/flutter/flutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/flutter/flutter/issues/comments{/number}","contents_url":"https://api.github.com/repos/flutter/flutter/contents/{+path}","compare_url":"https://api.github.com/repos/flutter/flutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flutter/flutter/merges","archive_url":"https://api.github.com/repos/flutter/flutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flutter/flutter/downloads","issues_url":"https://api.github.com/repos/flutter/flutter/issues{/number}","pulls_url":"https://api.github.com/repos/flutter/flutter/pulls{/number}","milestones_url":"https://api.github.com/repos/flutter/flutter/milestones{/number}","notifications_url":"https://api.github.com/repos/flutter/flutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flutter/flutter/labels{/name}","releases_url":"https://api.github.com/repos/flutter/flutter/releases{/id}","deployments_url":"https://api.github.com/repos/flutter/flutter/deployments","created_at":"2015-03-06T22:54:58Z","updated_at":"2018-10-17T00:35:06Z","pushed_at":"2018-10-17T00:22:23Z","git_url":"git://github.com/flutter/flutter.git","ssh_url":"git@github.com:flutter/flutter.git","clone_url":"https://github.com/flutter/flutter.git","svn_url":"https://github.com/flutter/flutter","homepage":"https://flutter.io","size":48823,"stargazers_count":39394,"watchers_count":39394,"language":"Dart","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3815,"mirror_url":null,"archived":false,"open_issues_count":4115,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":3815,"open_issues":4115,"watchers":39394,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/22566"},"html":{"href":"https://github.com/flutter/flutter/pull/22566"},"issue":{"href":"https://api.github.com/repos/flutter/flutter/issues/22566"},"comments":{"href":"https://api.github.com/repos/flutter/flutter/issues/22566/comments"},"review_comments":{"href":"https://api.github.com/repos/flutter/flutter/pulls/22566/comments"},"review_comment":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flutter/flutter/pulls/22566/commits"},"statuses":{"href":"https://api.github.com/repos/flutter/flutter/statuses/4c812e4efdbad23c66be43d90985eb2fbe13c9ce"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Hixie"}}