-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] treat glyph atlas texture as source of truth, remove copy of SkBitmap. #52567
Conversation
const ISize& max_texture_size) { | ||
static constexpr auto kMinAtlasSize = 8u; | ||
static constexpr auto kMinAlphaBitmapSize = 1024u; | ||
static constexpr auto kMinAtlasSize = 4096u; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we don't have to upload the whole bitmap for each change, we can afford a larger texture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backed this out for now because I'd need to rework all of the tests.
ASSERT_EQ(old_packer, new_packer); | ||
} | ||
|
||
TEST_P(TypographerTest, GlyphAtlasTextureIsRecreatedIfTypeChanges) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test case is deleted because we never need to change the type of an atlas at runtime, we always create distinct alpha and color atlases
#include "flutter/lib/ui/window/platform_configuration.h" | ||
#include "fml/mapping.h" | ||
#include "fml/memory/ref_ptr.h" | ||
#include "impeller/base/validation.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This TU was depending on this include transitively through the atlas code
Still working on last test failure. |
explicit HostBufferAllocator(HostBuffer& host_buffer) | ||
: host_buffer_(host_buffer) {} | ||
|
||
BufferView TakeBufferView() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[[nodiscard]] here perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
return std::move(buffer_view_); | ||
} | ||
|
||
bool allocPixelRef(SkBitmap* bitmap) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this an override? Maybe add the override and decorate it with the comment for an override.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
BufferView buffer_view = host_buffer_.Emplace(nullptr, required_bytes, | ||
DefaultUniformAlignment()); | ||
|
||
struct ImpellerPixelRef final : public SkPixelRef { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why this subclass is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not! removed
Still has some rendering bugs |
testing/dart/assets_test.dart
Outdated
// Therefore each buffer will contain identical contents. | ||
expect(ahemImage, equals(bundledFontImage)); | ||
}); | ||
// TESTING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. |
looks like we're still shifted a bit. |
Golden file changes are available for triage from new commit, Click here to view. |
50b9e44
to
63de4db
Compare
Golden file changes are available for triage from new commit, Click here to view. |
…move copy of SkBitmap. (flutter/engine#52567)
…move copy of SkBitmap. (flutter/engine#52567)
…move copy of SkBitmap. (flutter/engine#52567)
…move copy of SkBitmap. (flutter/engine#52567)
…148156) flutter/engine@ba8e0d3...fad88cb 2024-05-10 [email protected] Roll Skia from f69e8967610e to b6186e1b3995 (2 revisions) (flutter/engine#52726) 2024-05-10 [email protected] Simplify GN pools, use in more places (flutter/engine#52721) 2024-05-10 [email protected] Write `dart:ui` golden-file tests testing `FilterQuality.*` (flutter/engine#52687) 2024-05-10 [email protected] Revert "DisplayListBuilder internal reorganization with better rendering op overlap detection" (flutter/engine#52725) 2024-05-10 [email protected] deletes canvas recorder (flutter/engine#52722) 2024-05-10 [email protected] Roll Skia from d1118d56853c to f69e8967610e (1 revision) (flutter/engine#52723) 2024-05-10 [email protected] [Impeller] treat glyph atlas texture as source of truth, remove copy of SkBitmap. (flutter/engine#52567) 2024-05-10 [email protected] Roll Dart SDK from 01121c008f4d to 13fc7db956c7 (2 revisions) (flutter/engine#52716) 2024-05-10 [email protected] Roll Skia from 11d892ce49b6 to d1118d56853c (1 revision) (flutter/engine#52717) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. 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://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Work towards part of flutter/flutter#138798
Allow updating single glyphs in the glyph atlas, without replacing the entire bitmap. Required to efficiently append/update to large atlases.