Summary: | [GTK] Process accelerated compositing env variables only if they are really enabled | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Tomas Popela <tpopela> | ||||||||
Component: | WebKitGTK | Assignee: | Tomas Popela <tpopela> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | bugs-noreply, commit-queue, mcatanzaro | ||||||||
Priority: | P2 | ||||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | 165501 | ||||||||||
Bug Blocks: | |||||||||||
Attachments: |
|
Description
Tomas Popela
2016-12-02 04:26:17 PST
Created attachment 295940 [details]
Patch
Comment on attachment 295940 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=295940&action=review > Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp:50 > - if (getenv("WEBKIT_FORCE_COMPOSITING_MODE")) > + if (!g_strcmp0(getenv("WEBKIT_FORCE_COMPOSITING_MODE"), "1")) How about if (g_strcmp0(getenv("WEBKIT_FORCE_COMPOSITING_MODE"), "0")), that way you can disable it by setting it to 0, but set it to anything else and it'd still be enabled? That seems more familiar to me; what do other popular applications do? > Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp:54 > - if (getenv("WEBKIT_DISABLE_COMPOSITING_MODE")) { > + if (!g_strcmp0(getenv("WEBKIT_DISABLE_COMPOSITING_MODE"), "1")) { Ditto. (In reply to comment #2) > Comment on attachment 295940 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=295940&action=review > > > Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp:50 > > - if (getenv("WEBKIT_FORCE_COMPOSITING_MODE")) > > + if (!g_strcmp0(getenv("WEBKIT_FORCE_COMPOSITING_MODE"), "1")) > > How about if (g_strcmp0(getenv("WEBKIT_FORCE_COMPOSITING_MODE"), "0")), that > way you can disable it by setting it to 0, but set it to anything else and > it'd still be enabled? That seems more familiar to me; what do other popular > applications do? Could be as I don't have a strong preference on any of them. I don't any env variable apart from gtk's GTK_OVERLAY_SCROLLING: gtk/gtkscrolledwindow.c:4415: if (g_strcmp0 (g_getenv ("GTK_OVERLAY_SCROLLING"), "0") == 0) and that behaves the same way you described.. Let's rework the patch :).. Created attachment 296135 [details]
Patch
Comment on attachment 296135 [details]
Patch
This way also avoids breaking previous instructions. I doubt anybody was dumb enough to define WEBKIT_FORCE_COMPOSITING_MODE=0 and expect to get compositing mode, but it's not hard to imagine someone using WEBKIT_FORCE_COMPOSITING_MODE= or something.
Comment on attachment 296135 [details] Patch Clearing flags on attachment: 296135 Committed r209391: <http://trac.webkit.org/changeset/209391> All reviewed patches have been landed. Closing bug. Re-opened since this is blocked by bug 165501 Sorry about the bad advice, Tom. :) To do it properly you'll need to check if the env variable is set, and then use plain strcmp instead of g_strcmp0 only if it's set, like Milan suggested. Created attachment 296508 [details]
Patch
Comment on attachment 296508 [details] Patch Clearing flags on attachment: 296508 Committed r209534: <http://trac.webkit.org/changeset/209534> All reviewed patches have been landed. Closing bug. |