Bug 98048 - Don't allow compositing to be disabled in forced compositing mode
Summary: Don't allow compositing to be disabled in forced compositing mode
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Balazs Kelemen
URL:
Keywords:
Depends on:
Blocks: 94800
  Show dependency treegraph
 
Reported: 2012-10-01 10:59 PDT by Balazs Kelemen
Modified: 2012-10-12 09:35 PDT (History)
10 users (show)

See Also:


Attachments
Patch (2.10 KB, patch)
2012-10-01 11:12 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
Patch (2.43 KB, patch)
2012-10-03 01:52 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
Patch (2.98 KB, patch)
2012-10-03 05:13 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
Patch (2.70 KB, patch)
2012-10-03 05:43 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
Patch (3.79 KB, patch)
2012-10-03 06:04 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
Patch (5.22 KB, patch)
2012-10-03 06:15 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
Patch (7.63 KB, patch)
2012-10-04 05:53 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Balazs Kelemen 2012-10-01 10:59:59 PDT
... because it makes the whole system confused. It brakes the syncronisation between UI and web process rendering, giving me empty pixel dumps with the patch applied from bug 95992. In fact we don't support the non-accelerated path so don't pretend that we do.
Comment 1 Balazs Kelemen 2012-10-01 11:12:37 PDT
Created attachment 166508 [details]
Patch
Comment 2 Balazs Kelemen 2012-10-01 11:15:01 PDT
For example css3/filters tests would broke after bug 95992 lands because of this.
Comment 3 Jocelyn Turcotte 2012-10-02 02:43:10 PDT
Comment on attachment 166508 [details]
Patch

This feels a bit hidden in a corner and I think this doesn't need to be restricted to layout tests. What about making sure that this setting has no effect and gets overridden if forceCompositingMode() == true in DrawingAreaImpl?
Comment 4 Simon Fraser (smfr) 2012-10-02 11:47:08 PDT
(In reply to comment #3)
> (From update of attachment 166508 [details])
> This feels a bit hidden in a corner and I think this doesn't need to be restricted to layout tests. What about making sure that this setting has no effect and gets overridden if forceCompositingMode() == true in DrawingAreaImpl?

Agreed. Seems like the wrong place to enforce this.
Comment 5 Balazs Kelemen 2012-10-03 01:52:13 PDT
Created attachment 166829 [details]
Patch
Comment 6 Build Bot 2012-10-03 02:14:48 PDT
Comment on attachment 166829 [details]
Patch

Attachment 166829 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/14123661
Comment 7 Jocelyn Turcotte 2012-10-03 02:29:30 PDT
Comment on attachment 166829 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=166829&action=review

> Source/WebCore/page/Settings.h:512
> -        void setForceCompositingMode(bool flag) { m_forceCompositingMode = flag; }
> +        void setForceCompositingMode(bool flag)
> +        {

Settings.h is pretty clean already, I would send this to the .cpp if you expand it.

> Source/WebCore/page/Settings.h:513
> +            setAcceleratedCompositingEnabled(true);

I wouldn't call this if flag == false.

> Source/WebCore/page/Settings.h:514
> +            m_forceCompositingMode = flag;

Since setAcceleratedCompositingEnabled depends on m_forceCompositingMode, I would set this before calling setAcceleratedCompositingEnabled, just to be clean in case somebody updates this code in the future.
Comment 8 Balazs Kelemen 2012-10-03 05:13:30 PDT
Created attachment 166861 [details]
Patch
Comment 9 Build Bot 2012-10-03 05:26:10 PDT
Comment on attachment 166861 [details]
Patch

Attachment 166861 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14130715
Comment 10 Balazs Kelemen 2012-10-03 05:43:47 PDT
Created attachment 166871 [details]
Patch

Rather not bothering with the constness here as it affects exported symbols.
Comment 11 Build Bot 2012-10-03 05:53:38 PDT
Comment on attachment 166871 [details]
Patch

Attachment 166871 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14126749
Comment 12 Balazs Kelemen 2012-10-03 05:57:43 PDT
I was wrong, this is about the setForceCompositingMode became non-inline so it should been exported.
Comment 13 Balazs Kelemen 2012-10-03 06:04:05 PDT
Created attachment 166873 [details]
Patch
Comment 14 Balazs Kelemen 2012-10-03 06:07:02 PDT
Comment on attachment 166873 [details]
Patch

Ops, forget about gtk...
Comment 15 Balazs Kelemen 2012-10-03 06:15:21 PDT
Created attachment 166874 [details]
Patch
Comment 16 Build Bot 2012-10-03 06:48:36 PDT
Comment on attachment 166874 [details]
Patch

Attachment 166874 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14152115

New failing tests:
http/tests/workers/terminate-during-sync-operation.html
Comment 17 Build Bot 2012-10-03 06:48:40 PDT
Comment on attachment 166874 [details]
Patch

Attachment 166874 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/14137596
Comment 18 Balazs Kelemen 2012-10-03 07:15:09 PDT
Could you help me fixing the build? Things that I don't know:

 * I added the new symbol to symbol.filters but the Gtk build is still not happy. Is the symbol I added correct? I constructed the mandled by cloning it from another function with the same signature and changed the name. Should I edit any other file for the Gtk build?
 * Which file should I edit for the Windows build?

Both platforms want to use setAcceleratedCompositingEnabled from InternalSettings.cpp (libWebCoreTestSupport).
Comment 19 Balazs Kelemen 2012-10-04 01:38:48 PDT
(In reply to comment #18)
> Could you help me fixing the build? Things that I don't know:
> 
>  * I added the new symbol to symbol.filters but the Gtk build is still not happy. Is the symbol I added correct? I constructed the mangled name by cloning it from another function with the same signature and changed the name. Should I edit any other file for the Gtk build?
>  * Which file should I edit for the Windows build?
> 
> Both platforms want to use setAcceleratedCompositingEnabled from InternalSettings.cpp (libWebCoreTestSupport).

Added more people in hope that they could help me with this :)
Comment 20 Jocelyn Turcotte 2012-10-04 02:45:26 PDT
(In reply to comment #18)
>  * I added the new symbol to symbol.filters but the Gtk build is still not happy. Is the symbol I added correct? I constructed the mandled by cloning it from another function with the same signature and changed the name. Should I edit any other file for the Gtk build?
setMockScrollbarsEnabled is static, it's not the same signature.
By looking at methods present in both symbols.filter and WebCore.exp.in it seems like the only difference in mangling is the extra underscore at the beginning.

>  * Which file should I edit for the Windows build?
> 
I'm just guessing but it seems to be Source/WebKit2/win/WebKit2.def and Source/WebKit2/win/WebKit2CFLite.def.
The WebKit2 dll seems to links in their WebKit1 API as well.
Comment 21 Balazs Kelemen 2012-10-04 05:53:25 PDT
Created attachment 167087 [details]
Patch
Comment 22 Balazs Kelemen 2012-10-04 06:41:58 PDT
Comment on attachment 167087 [details]
Patch

Clearing flags on attachment: 167087

Committed r130389: <http://trac.webkit.org/changeset/130389>
Comment 23 Balazs Kelemen 2012-10-04 06:42:04 PDT
All reviewed patches have been landed.  Closing bug.
Comment 24 James Robinson 2012-10-11 16:09:10 PDT
This broke chromium.
Comment 25 Vangelis Kokkevis 2012-10-11 16:20:38 PDT
(In reply to comment #24)
> This broke chromium.

It's also a bad idea to change the value of one setting based on that of another. There's logic in RenderLayerCompositor::cacheAcceleratedCompositingFlags() to set the value of m_forceCompositingMode based on a handful of conditions (including the isAcceleratedCompositingEnabled Setting). 

This seems like an awkward fix to a problem that lies elsewhere in the code.
Comment 26 Balazs Kelemen 2012-10-12 02:00:24 PDT
(In reply to comment #24)
> This broke chromium.

Give some info about how it broke it, please!
Comment 27 Balazs Kelemen 2012-10-12 02:11:46 PDT
(In reply to comment #25)
> (In reply to comment #24)
> > This broke chromium.
> 
> It's also a bad idea to change the value of one setting based on that of another. There's logic in RenderLayerCompositor::cacheAcceleratedCompositingFlags() to set the value of m_forceCompositingMode based on a handful of conditions (including the isAcceleratedCompositingEnabled Setting). 
> 
> This seems like an awkward fix to a problem that lies elsewhere in the code.

This function only sets m_forceCompositingMode to true if acceleratedCompositingEnabled is true so I think it doesn't conflict with the patch. This patch can break things in two cases:
 * if you set forceCompositingMode somewhere and expect that acceleratedCompositing is not necessarily true
 * if you want to disable acceleratedCompositing while forceCompositingMode is true

Both situations seem to be a bit strange.
Anyway, I'm going to roll out the patch because it seems to be a bad idea to add such logic to Settings instead of letting it's users handle that.
Comment 28 Balazs Kelemen 2012-10-12 02:25:44 PDT
Reverted in http://trac.webkit.org/changeset/131162
Comment 29 Vangelis Kokkevis 2012-10-12 09:35:14 PDT
(In reply to comment #28)
> Reverted in http://trac.webkit.org/changeset/131162

Thank you for reverting! Chrome uses the two flags independently and isAcceleratedCompositingEnabled is somewhat of a master switch (most often triggered by our GPU blacklist) to turn all other compositing off.