[Webkit-unassigned] [Bug 142673] [GTK] Automatically adjust font size when gtk-xft-dpi changes
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Nov 14 23:52:57 PST 2017
https://bugs.webkit.org/show_bug.cgi?id=142673
Carlos Garcia Campos <cgarcia at igalia.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #326881|review?, commit-queue? |review+, commit-queue-
Flags| |
--- Comment #63 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 326881
--> https://bugs.webkit.org/attachment.cgi?id=326881
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=326881&action=review
> Source/WebCore/platform/gtk/PlatformScreenGtk.cpp:43
> -#include <wtf/Optional.h>
> +#include <unordered_map>
Use HashMap from WTF, please.
> Source/WebCore/platform/gtk/PlatformScreenGtk.cpp:116
> -static std::optional<Function<void()>> screenDPIObserverHandler;
> +static std::unordered_map<void*, Function<void()>> m_screenDPIObserverHandlersMap;
For global maps we normally use a function with a NeverDestroyed map that returns a reference of the map.
> Source/WebCore/platform/gtk/PlatformScreenGtk.cpp:128
>
Instead of null-checking gtkSettings everywhere we can just return early since it doesn't make sense to save the handler that we are not going to call ever.
> Source/WebCore/platform/gtk/PlatformScreenGtk.cpp:134
> + if (m_screenDPIObserverHandlersMap.size() > 0) {
Do not compare to 0, use either size() or when using HashMap !isEmpty().
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20171115/bbce989a/attachment-0001.html>
More information about the webkit-unassigned
mailing list