Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix RGB565 format documentation and bit masks #57210

Merged
merged 3 commits into from
Dec 16, 2024

Conversation

MyriadSoft
Copy link
Contributor

@MyriadSoft MyriadSoft commented Dec 15, 2024

The RGB565 format documentation in embedder.h incorrectly stated that the red component uses the least significant bits. Unit tests in embedder/testdefs/embedder_unittests.cc demonstrate this is incorrect, showing:

  • Red test (0xF800): Uses bits [15:11]
  • Green test (0x07E0): Uses bits [10:5]
  • Blue test (0x001F): Uses bits [4:0]

This commit fixes the documentation to correctly reflect the actual bit layout:

  • Red uses 5 MSBs [15:11]
  • Green uses 6 middle bits [10:5]
  • Blue uses 5 LSBs [4:0]

Also fixes the example bit extraction code to use correct masks, matching the test expectations.

Impact: This change helps prevent potential developer confusion about RGB565 bit ordering and ensures the documentation matches the actual implementation as verified by the test suite.

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities
  • I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]
  • I listed at least one issue that this PR fixes in the description above
  • I added new tests to check the change I am making (no new tests needed - documentation only)
  • I updated/added relevant documentation
  • I signed the [CLA]
  • All existing and new tests are passing

…mat documentation incorrectly stated that red component uses the least significant bits. This commit fixes the documentation to correctly reflect that:\n\n- Red uses 5 MSBs [15:11]\n- Green uses 6 middle bits [10:5]\n- Blue uses 5 LSBs [4:0]\n\nAlso fixes the example bit extraction code to use correct masks.
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

Copy link

google-cla bot commented Dec 15, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@stuartmorgan
Copy link
Contributor

test-exempt: only affects comments

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

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

@MyriadSoft thanks for your patch. Looks like this was failing the formatting check. I've pushed a patch that reformats to appease the tests. Once those pass, we'll merge.

@cbracken cbracken added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 16, 2024
@auto-submit auto-submit bot merged commit ec98cde into flutter:main Dec 16, 2024
28 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 16, 2024
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Dec 16, 2024
…160376)

flutter/engine@d373a93...0dfbd04

2024-12-16 [email protected] Roll Skia from 8c1e2bf9492c to
8054b098b5cd (5 revisions) (flutter/engine#57197)
2024-12-16 [email protected] Reland 'Delete stale
package_config.json in gclient sync hook' (flutter/engine#57218)
2024-12-16 [email protected] docs: Fix RGB565 format
documentation and bit masks (flutter/engine#57210)
2024-12-16 [email protected] [Impeller] disable AHB swapchains on
all platforms. (flutter/engine#57213)
2024-12-16 [email protected] [Impeller] fix Adreno precision
issue in gaussian downsample. (flutter/engine#57212)

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
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
…7210)

The RGB565 format documentation in embedder.h incorrectly stated that the red component uses the least significant bits. Unit tests in embedder/testdefs/embedder_unittests.cc demonstrate this is incorrect, showing:

- Red test (0xF800): Uses bits [15:11]
- Green test (0x07E0): Uses bits [10:5]
- Blue test (0x001F): Uses bits [4:0]

This commit fixes the documentation to correctly reflect the actual bit layout:
- Red uses 5 MSBs [15:11]
- Green uses 6 middle bits [10:5]
- Blue uses 5 LSBs [4:0]

Also fixes the example bit extraction code to use correct masks, matching the test expectations.

Impact: This change helps prevent potential developer confusion about RGB565 bit ordering and ensures the documentation matches the actual implementation as verified by the test suite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants