Bug 1525183 - Supress touch event and allocating bitmap
authorsotaro <sotaro.ikeda.g@gmail.com>
Tue, 12 Feb 2019 14:34:52 +0900
changeset 458628 b7efc3a909bef179bdd2aea433925a13c7f3f84f
parent 458627 c0d540e06ce3f60d32e25672456e828f162d4940
child 458629 134b85ae973cb92917cedc21ac624e75a8f27406
push id111859
push usersikeda@mozilla.com
push dateTue, 12 Feb 2019 05:35:58 +0000
treeherdermozilla-inbound@b7efc3a909be [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1525183
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1525183 - Supress touch event and allocating bitmap Chromium does workaround for scrolling with touch and avoid bitmap allocation when child window is used for DirectComposition. It improves performance of WebRender. Differential Revision: https://phabricator.services.mozilla.com/D18659
widget/windows/WinCompositorWindowThread.cpp
--- a/widget/windows/WinCompositorWindowThread.cpp
+++ b/widget/windows/WinCompositorWindowThread.cpp
@@ -5,16 +5,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "base/platform_thread.h"
 #include "WinCompositorWindowThread.h"
 #include "mozilla/layers/SynchronousTask.h"
 #include "mozilla/StaticPtr.h"
 #include "mtransport/runnable_utils.h"
 
+#if WINVER < 0x0602
+#define WS_EX_NOREDIRECTIONBITMAP 0x00200000L
+#endif
+
 namespace mozilla {
 namespace widget {
 
 static StaticRefPtr<WinCompositorWindowThread> sWinCompositorWindowThread;
 
 WinCompositorWindowThread::WinCompositorWindowThread(base::Thread* aThread)
     : mThread(aThread) {}
 
@@ -143,17 +147,18 @@ void InitializeWindowClass() {
         // parent window, so instead create it with a temporary placeholder parent.
         // Its parent is set as main window in UI process.
         initialParentWnd = ::CreateWindowEx(
             WS_EX_TOOLWINDOW, kClassNameCompositorInitalParent, nullptr,
             WS_POPUP | WS_DISABLED, 0, 0, 1, 1, nullptr,
             0, GetModuleHandle(nullptr), 0);
 
         compositorWnd = ::CreateWindowEx(
-            WS_EX_NOPARENTNOTIFY, kClassNameCompositor, nullptr,
+            WS_EX_NOPARENTNOTIFY | WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_NOREDIRECTIONBITMAP,
+            kClassNameCompositor, nullptr,
             WS_CHILDWINDOW | WS_DISABLED | WS_VISIBLE, 0, 0, 1, 1, initialParentWnd,
             0, GetModuleHandle(nullptr), 0);
       });
 
   Loop()->PostTask(runnable.forget());
 
   task.Wait();