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

Introduce an auto-deletable SkiaObject; make SkPaint a SkiaObject#14486

Merged
yjbanov merged 2 commits into
flutter-team-archive:masterfrom
yjbanov:cache-sk-paint-for-realz
Dec 13, 2019
Merged

Introduce an auto-deletable SkiaObject; make SkPaint a SkiaObject#14486
yjbanov merged 2 commits into
flutter-team-archive:masterfrom
yjbanov:cache-sk-paint-for-realz

Conversation

@yjbanov

@yjbanov yjbanov commented Dec 13, 2019

Copy link
Copy Markdown
Contributor
  • Introduce SkiaObject an object that's backed by Skia C++ objects that need to be explicitly deleted.
  • Automatically delete SkiaObjects at the end of frame.
  • Make SkPaint a SkiaObject.

Because SkiaObjects are deleted at the end of the frame, the object can be reused as many times as necessary within the frame. SkPaint in particular is a fairly expensive object. Reusing this object, for example, on drawRRect drops the canvas paint time by 30%.

@harryterkelsen harryterkelsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! This should go a long way towards helping memory leaks also

@yjbanov yjbanov merged commit 6c71f89 into flutter-team-archive:master Dec 13, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 17, 2019
iskakaushik pushed a commit to flutter/flutter that referenced this pull request Dec 18, 2019
* c260057 Roll src/third_party/dart fe9f30c3896e..8ad8abfb7463 (19 commits) (flutter-team-archive/engine#14480)

* 47c1dde Roll src/third_party/skia d0840ecf5831..ea47b0e65802 (9 commits) (flutter-team-archive/engine#14481)

* 35adf37 [web] Implement Paragraph.getLineBoundary (flutter-team-archive/engine#14479)

* 00cbfd3 [web] Remove Paragraph._lines which isn't necessary anymore (flutter-team-archive/engine#14485)

* d6172fd libtxt: cache fallback fonts found by a Minikin font collection (flutter-team-archive/engine#14482)

* 1912478 adding firefox unit tests to font loading (flutter-team-archive/engine#14487)

* 6c71f89 Introduce an auto-deletable SkiaObject; make SkPaint a SkiaObject (flutter-team-archive/engine#14486)

* 2026b83 Roll src/third_party/dart 8ad8abfb7463..83eeab1e63d9 (13 commits) (flutter-team-archive/engine#14488)

* b43d3fe Roll src/third_party/skia ea47b0e65802..cd9ad409a90d (7 commits) (flutter-team-archive/engine#14490)

* 3c85b82 Roll fuchsia/sdk/core/linux-amd64 from QZVxo... to q0tup... (flutter-team-archive/engine#14494)

* 3e3eb9c Roll src/third_party/dart 83eeab1e63d9..6c99171686be (5 commits) (flutter-team-archive/engine#14492)

* cbe0e6c Roll src/third_party/skia cd9ad409a90d..cf0e3c63fd22 (1 commits) (flutter-team-archive/engine#14495)

* a653bd8 Roll fuchsia/sdk/core/mac-amd64 from 5t09i... to esDH2... (flutter-team-archive/engine#14493)

* 17d8882 Roll src/third_party/dart 6c99171686be..09a0b040dd9b (1 commits) (flutter-team-archive/engine#14497)

* be9c7c9 Roll src/third_party/skia cf0e3c63fd22..9e7199561fc8 (1 commits) (flutter-team-archive/engine#14499)

* c504b8f Roll src/third_party/skia 9e7199561fc8..ef363a9ce692 (1 commits) (flutter-team-archive/engine#14500)

* cf20f87 Roll src/third_party/dart 09a0b040dd9b..ae3973da4023 (1 commits) (flutter-team-archive/engine#14501)

* bb3166b Roll src/third_party/dart ae3973da4023..24b99838f433 (3 commits) (flutter-team-archive/engine#14502)

* 87c1110 Roll src/third_party/skia ef363a9ce692..187cd367d388 (1 commits) (flutter-team-archive/engine#14503)

* 45c6c3a Roll src/third_party/skia 187cd367d388..706eb5788e8b (1 commits) (flutter-team-archive/engine#14505)

* d292380 Fix comments of iOS status bar height constant (flutter-team-archive/engine#14496)

* 1ed7247 Roll src/third_party/dart 24b99838f433..2e1dd98e5e7f (1 commits) (flutter-team-archive/engine#14507)

* 8712461 Allow custom embedders to post low memory notifications. (flutter-team-archive/engine#14506)

* 1d1eae2 Roll fuchsia/sdk/core/linux-amd64 from q0tup... to O6ELR... (flutter-team-archive/engine#14512)

* 8b47886 Roll src/third_party/dart c5c469088697..44ba80053396 (1 commits) (flutter-team-archive/engine#14510)

* ca799fa Roll src/third_party/skia 706eb5788e8b..9b59953e77b9 (3 commits) (flutter-team-archive/engine#14511)

* 8456411 Roll src/third_party/dart 44ba80053396..2eba06d26f71 (32 commits) (flutter-team-archive/engine#14515)

* 46d76eb Roll src/third_party/skia 9b59953e77b9..d78a9b45b9e5 (23 commits) (flutter-team-archive/engine#14516)

* 5f9e558 Forward low memory notifications from the shell to DartVM. (flutter-team-archive/engine#14517)

* dc59758 Apply SmoothPointerDataDispatcher to Fuchsia (flutter-team-archive/engine#14514)

* 9556f2c Roll src/third_party/dart 2eba06d26f71..b1afe2d0ebc1 (6 commits) (flutter-team-archive/engine#14523)

* e829384 Roll fuchsia/sdk/core/linux-amd64 from O6ELR... to ZHhOi... (flutter-team-archive/engine#14525)

* 0fbdeb8 Roll src/third_party/dart b1afe2d0ebc1..2d332ee1d3f1 (1 commits) (flutter-team-archive/engine#14526)

* 500f9ce Roll src/third_party/skia 6153165d78f2..fdb2b7d53038 (2 commits) (flutter-team-archive/engine#14528)
filmil pushed a commit to filmil/engine that referenced this pull request Mar 13, 2020
…utter-team-archive#14486)

* Introduce `SkiaObject` an object that's backed by Skia C++ objects that need to be explicitly deleted.
* Automatically delete `SkiaObject`s at the end of frame.
* Make `SkPaint` a `SkiaObject`.

Because `SkiaObject`s are deleted at the end of the frame, the object can be reused as many times as necessary within the frame. `SkPaint` in particular is a fairly expensive object. Reusing this object, for example, on `drawRRect` drops the canvas paint time by 30%.
@yjbanov yjbanov deleted the cache-sk-paint-for-realz branch June 22, 2021 21:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

3 participants