Title: [270176] trunk/Source/WebCore
Revision
270176
Author
[email protected]
Date
2020-11-26 18:53:39 -0800 (Thu, 26 Nov 2020)

Log Message

[GTK4] Build fix. Add cast when taking const data ownership
https://bugs.webkit.org/show_bug.cgi?id=219267

Reviewed by Carlos Garcia Campos.

r269614 introduced the NativeImage class, which returns a const platform image and
uses an Observer scheme to release the data.

* platform/graphics/gtk/ImageGtk.cpp:
(WebCore::BitmapImage::gdkTexture): Keep using the direct approach and use a const_cast
to release the data.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (270175 => 270176)


--- trunk/Source/WebCore/ChangeLog	2020-11-27 02:18:30 UTC (rev 270175)
+++ trunk/Source/WebCore/ChangeLog	2020-11-27 02:53:39 UTC (rev 270176)
@@ -1,3 +1,17 @@
+2020-11-26  Lauro Moura  <[email protected]>
+
+        [GTK4] Build fix. Add cast when taking const data ownership
+        https://bugs.webkit.org/show_bug.cgi?id=219267
+
+        Reviewed by Carlos Garcia Campos.
+
+        r269614 introduced the NativeImage class, which returns a const platform image and
+        uses an Observer scheme to release the data.
+
+        * platform/graphics/gtk/ImageGtk.cpp:
+        (WebCore::BitmapImage::gdkTexture): Keep using the direct approach and use a const_cast
+        to release the data.
+
 2020-11-26  Fujii Hironori  <[email protected]>
 
         [WinCairo] Enable GPU process

Modified: trunk/Source/WebCore/platform/graphics/gtk/ImageGtk.cpp (270175 => 270176)


--- trunk/Source/WebCore/platform/graphics/gtk/ImageGtk.cpp	2020-11-27 02:18:30 UTC (rev 270175)
+++ trunk/Source/WebCore/platform/graphics/gtk/ImageGtk.cpp	2020-11-27 02:53:39 UTC (rev 270176)
@@ -79,7 +79,7 @@
     auto* data = ""
     GRefPtr<GBytes> bytes = adoptGRef(g_bytes_new_with_free_func(data, height * stride, [](gpointer data) {
         cairo_surface_destroy(static_cast<cairo_surface_t*>(data));
-    }, surface.leakRef()));
+    }, const_cast<PlatformImagePtr&>(surface).leakRef()));
     return gdk_memory_texture_new(width, height, GDK_MEMORY_DEFAULT, bytes.get(), stride);
 }
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to