Changeset 248885 in webkit


Ignore:
Timestamp:
Aug 19, 2019 6:57:56 PM (5 years ago)
Author:
Fujii Hironori
Message:

[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):

Location:
trunk/Source/WebKitLegacy/win
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKitLegacy/win/ChangeLog

    r248856 r248885  
     12019-08-19  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [WinCairo][WK1] A browser window starts as an inactive window because AcceleratedCompositingContext::acceleratedCompositingAvailable creates temporary window
     4        https://bugs.webkit.org/show_bug.cgi?id=200493
     5
     6        Reviewed by Ross Kirsling.
     7
     8        Reverted r179962.
     9
     10        * WebCoreSupport/AcceleratedCompositingContext.cpp:
     11        (AcceleratedCompositingContext::acceleratedCompositingAvailable): Deleted.
     12        * WebCoreSupport/AcceleratedCompositingContext.h:
     13        * WebView.cpp:
     14        (WebView::notifyPreferencesChanged):
     15
    1162019-08-19  Sihui Liu  <sihui_liu@apple.com>
    217
  • trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp

    r245950 r248885  
    3030#include "WebView.h"
    3131
    32 #include <WebCore/DefWndProcWindowClass.h>
    3332#include <WebCore/Document.h>
    3433#include <WebCore/Frame.h>
    3534#include <WebCore/FrameView.h>
    3635#include <WebCore/GraphicsLayerTextureMapper.h>
    37 #include <WebCore/HWndDC.h>
    3836#include <WebCore/Page.h>
    3937#include <WebCore/Settings.h>
     
    266264}
    267265
    268 bool AcceleratedCompositingContext::acceleratedCompositingAvailable()
    269 {
    270     const int width = 10;
    271     const int height = 10;
    272 
    273     // ANGLE requires Win7 or later.
    274     if (windowsVersion() < Windows7)
    275         return false;
    276 
    277     // Create test window to render texture in.
    278     HWND testWindow = ::CreateWindowEx(WS_EX_NOACTIVATE, defWndProcWindowClassName(), L"AcceleratedCompositingTesterWindow", WS_POPUP | WS_VISIBLE | WS_DISABLED, -width, -height, width, height, 0, 0, 0, 0);
    279 
    280     if (!testWindow)
    281         return false;
    282 
    283     // Create GL context.
    284     std::unique_ptr<WebCore::GLContext> context = GLContext::createContextForWindow(testWindow);
    285 
    286     if (!context) {
    287         ::DestroyWindow(testWindow);
    288         return false;
    289     }
    290 
    291     context->makeContextCurrent();
    292 
    293     std::unique_ptr<WebCore::TextureMapper> textureMapper = TextureMapperGL::create();
    294 
    295     if (!textureMapper) {
    296         ::DestroyWindow(testWindow);
    297         return false;
    298     }
    299 
    300     // Create texture.
    301     RefPtr<BitmapTexture> texture = textureMapper->createTexture();
    302 
    303     if (!texture) {
    304         ::DestroyWindow(testWindow);
    305         return false;
    306     }
    307 
    308     texture->reset(IntSize(width, height));
    309 
    310     // Copy bitmap data to texture.
    311     const int bitmapSize = width * height;
    312     int data[bitmapSize];
    313     const COLORREF colorRed = RGB(255, 0, 0);
    314     const COLORREF colorGreen = RGB(0, 255, 0);
    315     for (int i = 0; i < bitmapSize; i++)
    316         data[i] = colorGreen;
    317     IntRect targetRect(0, 0, width, height);
    318     IntPoint offset(0, 0);
    319     int bytesPerLine = width * 4;
    320     texture->updateContents(data, targetRect, offset, bytesPerLine);
    321 
    322     // Render texture.
    323     textureMapper->beginPainting();
    324     FloatRect rect(0, 0, width, height);
    325     textureMapper->drawTexture(*texture, rect);
    326     textureMapper->endPainting();
    327 
    328     // Set color of pixel (0, 0) to red, to make sure it is different from the bitmap color.
    329     HWndDC hdc(testWindow);
    330     ::SetPixel(hdc, 0, 0, colorRed);
    331 
    332     context->swapBuffers();
    333 
    334     // Check if pixel (0, 0) has expected color.
    335     COLORREF pixelColor = ::GetPixel(hdc, 0, 0);
    336 
    337     ::DestroyWindow(testWindow);
    338 
    339     return pixelColor == colorGreen;
    340 }
    341 
    342266void AcceleratedCompositingContext::scheduleLayerFlush()
    343267{
  • trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.h

    r248762 r248885  
    6767    void scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
    6868
    69     static bool acceleratedCompositingAvailable();
    70 
    7169private:
    7270    WebView& m_webView;
  • trunk/Source/WebKitLegacy/win/WebView.cpp

    r248846 r248885  
    54785478    if (FAILED(hr))
    54795479        return hr;
    5480 #if USE(TEXTURE_MAPPER_GL)
    5481     static bool acceleratedCompositingAvailable = AcceleratedCompositingContext::acceleratedCompositingAvailable();
    5482     enabled = enabled && acceleratedCompositingAvailable;
    5483 #elif USE(DIRECT2D)
     5480#if USE(DIRECT2D)
    54845481    // Disable accelerated compositing for now.
    54855482    enabled = false;
Note: See TracChangeset for help on using the changeset viewer.