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

[Skia] Fix support for custom cursors with GTK #26388

Merged

Conversation

TingPing
Copy link
Contributor

@TingPing TingPing commented Mar 24, 2024

ee489d2

[Skia] Fix support for custom cursors with GTK
https://bugs.webkit.org/show_bug.cgi?id=271613

Reviewed by Adrian Perez de Castro.

* Source/WebCore/platform/graphics/gtk/GdkSkiaUtilities.cpp:
(WebCore::skiaImageToGdkPixbuf):
* Source/WebCore/platform/graphics/gtk/GdkSkiaUtilities.h:
* Source/WebCore/platform/graphics/gtk/ImageAdapterGtk.cpp:
(WebCore::ImageAdapter::gdkPixbuf):
(WebCore::ImageAdapter::gdkTexture):
* Source/WebCore/platform/gtk/CursorGtk.cpp:
(WebCore::createCustomCursor):

destroy notify was not being called.

* Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContextSkia::~GraphicsContextSkia):

Canonical link: https://commits.webkit.org/276737@main

2ab2574

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-wpe
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ›  wpe-skia
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ›  gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ api-gtk
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@TingPing TingPing added the WebKitGTK Bugs related to the Gtk API layer. label Mar 24, 2024
Copy link
Contributor

@aperezdc aperezdc left a comment

Choose a reason for hiding this comment

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

I left one comment, please take a look.

Source/WebCore/platform/graphics/gtk/GdkSkiaUtilities.cpp Outdated Show resolved Hide resolved
@TingPing TingPing force-pushed the pgriffis/skia/gtk/customcursors branch from 45b3f88 to 1de06bd Compare March 25, 2024 14:51
@TingPing TingPing requested a review from aperezdc March 25, 2024 14:52
Copy link
Contributor

@aperezdc aperezdc left a comment

Choose a reason for hiding this comment

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

@TingPing my apologies for the churn, I think in my earlier review I wasn't clear about needing to change the accessor used for the pixel data πŸ˜‡

Source/WebCore/platform/graphics/gtk/GdkSkiaUtilities.cpp Outdated Show resolved Hide resolved
Source/WebCore/platform/graphics/gtk/GdkSkiaUtilities.cpp Outdated Show resolved Hide resolved
@TingPing TingPing force-pushed the pgriffis/skia/gtk/customcursors branch from 1de06bd to 2ab2574 Compare March 26, 2024 17:51
@TingPing TingPing requested a review from aperezdc March 26, 2024 17:55
Copy link
Contributor

@aperezdc aperezdc left a comment

Choose a reason for hiding this comment

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

However you can construct a GdkTexture/cairo_surface from it and then create a GdkPixbuf off that, so I took this approach.

@TingPing That's a clever solution, and I like it that makes the code somewhat more consistent and easier to follow. Thanks!

@TingPing TingPing added the merge-queue Applied to send a pull request to merge-queue label Mar 27, 2024
https://bugs.webkit.org/show_bug.cgi?id=271613

Reviewed by Adrian Perez de Castro.

* Source/WebCore/platform/graphics/gtk/GdkSkiaUtilities.cpp:
(WebCore::skiaImageToGdkPixbuf):
* Source/WebCore/platform/graphics/gtk/GdkSkiaUtilities.h:
* Source/WebCore/platform/graphics/gtk/ImageAdapterGtk.cpp:
(WebCore::ImageAdapter::gdkPixbuf):
(WebCore::ImageAdapter::gdkTexture):
* Source/WebCore/platform/gtk/CursorGtk.cpp:
(WebCore::createCustomCursor):

destroy notify was not being called.

* Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContextSkia::~GraphicsContextSkia):

Canonical link: https://commits.webkit.org/276737@main
@webkit-commit-queue
Copy link
Collaborator

Committed 276737@main (ee489d2): https://commits.webkit.org/276737@main

Reviewed commits have been landed. Closing PR #26388 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit ee489d2 into WebKit:main Mar 27, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKitGTK Bugs related to the Gtk API layer.
Projects
None yet
4 participants