[WinCairo][WK1] A browser window starts as an inactive window because AcceleratedComp...
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Aug 2019 01:57:56 +0000 (01:57 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Aug 2019 01:57:56 +0000 (01:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200493

Reviewed by Ross Kirsling.

Reverted r179962.

* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::acceleratedCompositingAvailable): Deleted.
* WebCoreSupport/AcceleratedCompositingContext.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248885 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp
Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.h
Source/WebKitLegacy/win/WebView.cpp

index 24b6e8b..1723906 100644 (file)
@@ -1,3 +1,18 @@
+2019-08-19  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [WinCairo][WK1] A browser window starts as an inactive window because AcceleratedCompositingContext::acceleratedCompositingAvailable creates temporary window
+        https://bugs.webkit.org/show_bug.cgi?id=200493
+
+        Reviewed by Ross Kirsling.
+
+        Reverted r179962.
+
+        * WebCoreSupport/AcceleratedCompositingContext.cpp:
+        (AcceleratedCompositingContext::acceleratedCompositingAvailable): Deleted.
+        * WebCoreSupport/AcceleratedCompositingContext.h:
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged):
+
 2019-08-19  Sihui Liu  <sihui_liu@apple.com>
 
         Remove IDB-specific quota
index fb169fd..dfa560e 100644 (file)
 
 #include "WebView.h"
 
-#include <WebCore/DefWndProcWindowClass.h>
 #include <WebCore/Document.h>
 #include <WebCore/Frame.h>
 #include <WebCore/FrameView.h>
 #include <WebCore/GraphicsLayerTextureMapper.h>
-#include <WebCore/HWndDC.h>
 #include <WebCore/Page.h>
 #include <WebCore/Settings.h>
 #include <WebCore/SystemInfo.h>
@@ -265,80 +263,6 @@ void AcceleratedCompositingContext::scrollNonCompositedContents(const IntRect& s
     scheduleLayerFlush();
 }
 
-bool AcceleratedCompositingContext::acceleratedCompositingAvailable()
-{
-    const int width = 10;
-    const int height = 10;
-
-    // ANGLE requires Win7 or later.
-    if (windowsVersion() < Windows7)
-        return false;
-
-    // Create test window to render texture in.
-    HWND testWindow = ::CreateWindowEx(WS_EX_NOACTIVATE, defWndProcWindowClassName(), L"AcceleratedCompositingTesterWindow", WS_POPUP | WS_VISIBLE | WS_DISABLED, -width, -height, width, height, 0, 0, 0, 0);
-
-    if (!testWindow)
-        return false;
-
-    // Create GL context.
-    std::unique_ptr<WebCore::GLContext> context = GLContext::createContextForWindow(testWindow);
-
-    if (!context) {
-        ::DestroyWindow(testWindow);
-        return false;
-    }
-
-    context->makeContextCurrent();
-
-    std::unique_ptr<WebCore::TextureMapper> textureMapper = TextureMapperGL::create();
-
-    if (!textureMapper) {
-        ::DestroyWindow(testWindow);
-        return false;
-    }
-
-    // Create texture.
-    RefPtr<BitmapTexture> texture = textureMapper->createTexture();
-
-    if (!texture) {
-        ::DestroyWindow(testWindow);
-        return false;
-    }
-
-    texture->reset(IntSize(width, height));
-
-    // Copy bitmap data to texture.
-    const int bitmapSize = width * height;
-    int data[bitmapSize];
-    const COLORREF colorRed = RGB(255, 0, 0);
-    const COLORREF colorGreen = RGB(0, 255, 0);
-    for (int i = 0; i < bitmapSize; i++)
-        data[i] = colorGreen;
-    IntRect targetRect(0, 0, width, height);
-    IntPoint offset(0, 0);
-    int bytesPerLine = width * 4;
-    texture->updateContents(data, targetRect, offset, bytesPerLine);
-
-    // Render texture.
-    textureMapper->beginPainting();
-    FloatRect rect(0, 0, width, height);
-    textureMapper->drawTexture(*texture, rect);
-    textureMapper->endPainting();
-
-    // Set color of pixel (0, 0) to red, to make sure it is different from the bitmap color.
-    HWndDC hdc(testWindow);
-    ::SetPixel(hdc, 0, 0, colorRed);
-
-    context->swapBuffers();
-
-    // Check if pixel (0, 0) has expected color.
-    COLORREF pixelColor = ::GetPixel(hdc, 0, 0);
-
-    ::DestroyWindow(testWindow);
-
-    return pixelColor == colorGreen;
-}
-
 void AcceleratedCompositingContext::scheduleLayerFlush()
 {
     if (!enabled())
index c41f86e..a7e1a2c 100644 (file)
@@ -66,8 +66,6 @@ public:
     bool flushPendingLayerChangesSoon();
     void scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
 
-    static bool acceleratedCompositingAvailable();
-
 private:
     WebView& m_webView;
     std::unique_ptr<WebCore::GLContext> m_context;
index 1439002..734de84 100644 (file)
@@ -5477,10 +5477,7 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
     hr = prefsPrivate->acceleratedCompositingEnabled(&enabled);
     if (FAILED(hr))
         return hr;
-#if USE(TEXTURE_MAPPER_GL)
-    static bool acceleratedCompositingAvailable = AcceleratedCompositingContext::acceleratedCompositingAvailable();
-    enabled = enabled && acceleratedCompositingAvailable;
-#elif USE(DIRECT2D)
+#if USE(DIRECT2D)
     // Disable accelerated compositing for now.
     enabled = false;
 #endif