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

Conversation

jonahwilliams
Copy link
Contributor

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.

@jonahwilliams jonahwilliams changed the title Texture sot [Impeller] treat glyph atlas texture as source of truth, remove copy of SkBitmap. May 5, 2024
const ISize& max_texture_size) {
static constexpr auto kMinAtlasSize = 8u;
static constexpr auto kMinAlphaBitmapSize = 1024u;
static constexpr auto kMinAtlasSize = 4096u;
Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@jonahwilliams jonahwilliams marked this pull request as ready for review May 8, 2024 17:45
@jonahwilliams jonahwilliams requested a review from chinmaygarde May 8, 2024 18:00
ASSERT_EQ(old_packer, new_packer);
}

TEST_P(TypographerTest, GlyphAtlasTextureIsRecreatedIfTypeChanges) {
Copy link
Contributor Author

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"
Copy link
Contributor Author

@jonahwilliams jonahwilliams May 8, 2024

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

@jonahwilliams
Copy link
Contributor Author

Still working on last test failure.

explicit HostBufferAllocator(HostBuffer& host_buffer)
: host_buffer_(host_buffer) {}

BufferView TakeBufferView() {
Copy link
Member

Choose a reason for hiding this comment

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

[[nodiscard]] here perhaps?

Copy link
Contributor Author

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) {
Copy link
Member

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.

Copy link
Contributor Author

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 {
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its not! removed

jonahwilliams added 3 commits May 9, 2024 16:33
@jonahwilliams
Copy link
Contributor Author

Still has some rendering bugs

// Therefore each buffer will contain identical contents.
expect(ahemImage, equals(bundledFontImage));
});
// TESTING
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Testing

@flutter-dashboard
Copy link

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.

Changes reported for pull request #52567 at sha 55a88b0

@jonahwilliams
Copy link
Contributor Author

looks like we're still shifted a bit.

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

Changes reported for pull request #52567 at sha 50b9e44

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

Changes reported for pull request #52567 at sha 7382403

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label May 10, 2024
@auto-submit auto-submit bot merged commit 2824230 into flutter:main May 10, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 10, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 10, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 11, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 11, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request May 11, 2024
…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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App e: impeller will affect goldens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants