From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Thu, 7 Apr 2022 20:30:16 +0900 Subject: Make gtk::GetLibGdkPixbuf public Allows embedders to get a handle to the gdk_pixbuf library already loaded in the process. diff --git a/ui/gtk/gtk_compat.cc b/ui/gtk/gtk_compat.cc index bcd86e7a9e870b274d0c6487a691f23ad1888079..4b192c90ce82ddddaedf14970919447e8f43dd7c 100644 --- a/ui/gtk/gtk_compat.cc +++ b/ui/gtk/gtk_compat.cc @@ -68,11 +68,6 @@ void* GetLibGio() { return libgio; } -void* GetLibGdkPixbuf() { - static void* libgdk_pixbuf = DlOpen("libgdk_pixbuf-2.0.so.0"); - return libgdk_pixbuf; -} - void* GetLibGdk3() { static void* libgdk3 = DlOpen("libgdk-3.so.0"); return libgdk3; @@ -165,6 +160,11 @@ gfx::Insets InsetsFromGtkBorder(const GtkBorder& border) { } // namespace +void* GetLibGdkPixbuf() { + static void* libgdk_pixbuf = DlOpen("libgdk_pixbuf-2.0.so.0"); + return libgdk_pixbuf; +} + bool LoadGtk(ui::LinuxUiBackend backend) { static bool loaded = LoadGtkImpl(backend); return loaded; diff --git a/ui/gtk/gtk_compat.h b/ui/gtk/gtk_compat.h index 841e2e8fcdbe2da4aac487badd4d352476e461a2..e458df649546fa3bee10e24f0edac147186cc152 100644 --- a/ui/gtk/gtk_compat.h +++ b/ui/gtk/gtk_compat.h @@ -42,6 +42,9 @@ using SkColor = uint32_t; namespace gtk { +// Get handle to the currently loaded gdk_pixbuf library in the process. +void* GetLibGdkPixbuf(); + // Loads libgtk and related libraries and returns true on success. bool LoadGtk(ui::LinuxUiBackend backend);