summaryrefslogtreecommitdiffstats
path: root/widget/PuppetWidget.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /widget/PuppetWidget.cpp
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/PuppetWidget.cpp')
-rw-r--r--widget/PuppetWidget.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/widget/PuppetWidget.cpp b/widget/PuppetWidget.cpp
index 07b22d9a2b..7da6de3eaa 100644
--- a/widget/PuppetWidget.cpp
+++ b/widget/PuppetWidget.cpp
@@ -900,17 +900,14 @@ void PuppetWidget::SetCursor(const Cursor& aCursor) {
return;
}
- bool hasCustomCursor = false;
- Maybe<mozilla::ipc::BigBuffer> customCursorData;
- size_t length = 0;
- IntSize customCursorSize;
- int32_t stride = 0;
- auto format = SurfaceFormat::B8G8R8A8;
ImageResolution resolution = aCursor.mResolution;
+ Maybe<IPCImage> customCursor;
if (aCursor.IsCustom()) {
- int32_t width = 0, height = 0;
+ int32_t width = 0;
+ int32_t height = 0;
aCursor.mContainer->GetWidth(&width);
aCursor.mContainer->GetHeight(&height);
+
const int32_t flags =
imgIContainer::FLAG_SYNC_DECODE | imgIContainer::FLAG_ASYNC_NOTIFY;
RefPtr<SourceSurface> surface;
@@ -928,22 +925,17 @@ void PuppetWidget::SetCursor(const Cursor& aCursor) {
surface =
aCursor.mContainer->GetFrame(imgIContainer::FRAME_CURRENT, flags);
}
+
if (surface) {
if (RefPtr<DataSourceSurface> dataSurface = surface->GetDataSurface()) {
- hasCustomCursor = true;
- customCursorData =
- nsContentUtils::GetSurfaceData(*dataSurface, &length, &stride);
- customCursorSize = dataSurface->GetSize();
- format = dataSurface->GetFormat();
+ customCursor = nsContentUtils::SurfaceToIPCImage(*dataSurface);
}
}
}
if (!mBrowserChild->SendSetCursor(
- aCursor.mDefaultCursor, hasCustomCursor, std::move(customCursorData),
- customCursorSize.width, customCursorSize.height, resolution.mX,
- resolution.mY, stride, format, aCursor.mHotspotX, aCursor.mHotspotY,
- force)) {
+ aCursor.mDefaultCursor, std::move(customCursor), resolution.mX,
+ resolution.mY, aCursor.mHotspotX, aCursor.mHotspotY, force)) {
return;
}
mCursor = aCursor;