Skip to content

Conversation

@ShahzaibIbrahim
Copy link
Contributor

Replacing Image(Display, int, int) with Image(Display, ImageGcDrawer, int, int) in Tests

@github-actions
Copy link
Contributor

github-actions bot commented May 28, 2025

Test Results

   545 files  ±0     545 suites  ±0   27m 29s ⏱️ -14s
 4 399 tests ±0   4 381 ✅ ±0   18 💤 ±0  0 ❌ ±0 
16 723 runs  ±0  16 583 ✅ ±0  140 💤 ±0  0 ❌ ±0 

Results for commit 4aa477a. ± Comparison against base commit d2cb26d.

♻️ This comment has been updated with latest results.

@ShahzaibIbrahim
Copy link
Contributor Author

FYI, This PR is not ready to be reviewed. WIP.

Replacing Image(Display, int, int) with Image(Display, ImageGcDrawer,
int, int) in Tests
@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as ready for review June 7, 2025 12:44
Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

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

Thank you for the adaptations, @ShahzaibIbrahim. Unfortunately, the bunch of changes makes it hard to properly review each and every change. There are several "regressions" in the actual changes. For example, you need to consider that the logic moved inside an ImageGcDrawer is not necessarily executed immediately but may be executed later on demand. This is particularly relevant on Windows, where an Image instantiation does not lead to a handle and/or data instantiation (anymore), such that the moved code will only be executed upon first access to an image data/handle, which may be later than expected in the subsequent code (or not at all, if no data/handle is accessed). I made comments on some of the affected placed.

Some of the manual test examples break completely. See this comparison of Bug563475_DarkDisabledTable before and after this change:
image

In consequence, please break down this PR into smaller changes, e.g.:

  • Changes to manual tests separated from changes to automated tests, as the latter require more manual validation effort
  • Simple refactorings where the image is used immediately after ImageGcDrawer definition separated from complex changes where images are passed around so that we need to be careful if the drawer is actually executed (correctly)

Image image = new Image(display, rect.width, rect.height);
gc = new GC(image);
Rectangle rect = layout.getBounds();
final ImageGcDrawer gcDrawer = (gc, height, width) -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
final ImageGcDrawer gcDrawer = (gc, height, width) -> {
final ImageGcDrawer gcDrawer = (gc, width, height) -> {

@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as draft June 10, 2025 11:46
@ShahzaibIbrahim
Copy link
Contributor Author

ShahzaibIbrahim commented Jun 10, 2025

As per suggestion, The PR is broken into three parts

No-Op Cases (Simple Refactoring) : #2221.
Automated Tests Cases: #2229.
Manual Tests: #2230.

Hence, closing this one. P.S: The review suggestion also addressed in the given PRs.

@HeikoKlare

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace usages of new Image(device, width, height) for Snippets/Tests

3 participants