Changeset 82966 in webkit


Ignore:
Timestamp:
Apr 5, 2011 12:33:44 PM (13 years ago)
Author:
Adam Roben
Message:

Disable accelerated compositing on Windows machines that don't support it

This includes machines without the necessary graphics hardware, and machines without
WebKitQuartzCoreAdditions (like the Windows 7 Release (WebKit2 Tests) bots).

Fixes <http://webkit.org/b/57870> REGRESSION (r82960): Lots of tests crashing in
DrawingAreaImpl::enterAcceleratedCompositingMode on Windows 7 Release (WebKit2 Tests)

Reviewed by Anders Carlsson.

  • WebProcess/WebPage/LayerTreeHost.h:

(WebKit::LayerTreeHost::supportsAcceleratedCompositing): Added. On platforms other than
Windows, this always returns true.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::updatePreferences): Only enable accelerated compositing-related
preferences if the machine supports accelerated compositing.

  • WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:

(WebKit::LayerTreeHostCAWin::supportsAcceleratedCompositing): Added. Creates a view, asks it
if it can draw, and returns the result.

  • WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h: Added supportsAcceleratedCompositing.
  • WebProcess/WebPage/win/LayerTreeHostWin.cpp: Added.

(WebKit::LayerTreeHost::supportsAcceleratedCompositing): Added. Calls through to
LayerTreeHostCAWin in configurations that support that class. Otherwise just returns false.

  • win/WebKit2.vcproj: Added LayerTreeHostWin.cpp. Let VS reorder some other files.
Location:
trunk/Source/WebKit2
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r82960 r82966  
     12011-04-05  Adam Roben  <aroben@apple.com>
     2
     3        Disable accelerated compositing on Windows machines that don't support it
     4
     5        This includes machines without the necessary graphics hardware, and machines without
     6        WebKitQuartzCoreAdditions (like the Windows 7 Release (WebKit2 Tests) bots).
     7
     8        Fixes <http://webkit.org/b/57870> REGRESSION (r82960): Lots of tests crashing in
     9        DrawingAreaImpl::enterAcceleratedCompositingMode on Windows 7 Release (WebKit2 Tests)
     10
     11        Reviewed by Anders Carlsson.
     12
     13        * WebProcess/WebPage/LayerTreeHost.h:
     14        (WebKit::LayerTreeHost::supportsAcceleratedCompositing): Added. On platforms other than
     15        Windows, this always returns true.
     16
     17        * WebProcess/WebPage/WebPage.cpp:
     18        (WebKit::WebPage::updatePreferences): Only enable accelerated compositing-related
     19        preferences if the machine supports accelerated compositing.
     20
     21        * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
     22        (WebKit::LayerTreeHostCAWin::supportsAcceleratedCompositing): Added. Creates a view, asks it
     23        if it can draw, and returns the result.
     24
     25        * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h: Added supportsAcceleratedCompositing.
     26
     27        * WebProcess/WebPage/win/LayerTreeHostWin.cpp: Added.
     28        (WebKit::LayerTreeHost::supportsAcceleratedCompositing): Added. Calls through to
     29        LayerTreeHostCAWin in configurations that support that class. Otherwise just returns false.
     30
     31        * win/WebKit2.vcproj: Added LayerTreeHostWin.cpp. Let VS reorder some other files.
     32
    1332011-04-05  Adam Roben  <aroben@apple.com>
    234
  • trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h

    r82959 r82966  
    4747    virtual ~LayerTreeHost();
    4848
     49    static bool supportsAcceleratedCompositing();
     50
    4951    virtual const LayerTreeContext& layerTreeContext() = 0;
    5052    virtual void scheduleLayerFlush() = 0;
     
    7577};
    7678
     79#if !PLATFORM(WIN)
     80inline bool LayerTreeHost::supportsAcceleratedCompositing()
     81{
     82    return true;
     83}
     84#endif
     85
    7786} // namespace WebKit
    7887
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r82960 r82966  
    3333#include "InjectedBundle.h"
    3434#include "InjectedBundleBackForwardList.h"
     35#include "LayerTreeHost.h"
    3536#include "MessageID.h"
    3637#include "NetscapePlugin.h"
     
    14121413    settings->setDefaultFixedFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFixedFontSizeKey()));
    14131414
    1414     settings->setAcceleratedCompositingEnabled(store.getBoolValueForKey(WebPreferencesKey::acceleratedCompositingEnabledKey()));
    1415     settings->setAcceleratedDrawingEnabled(store.getBoolValueForKey(WebPreferencesKey::acceleratedDrawingEnabledKey()));
    1416     settings->setCanvasUsesAcceleratedDrawing(store.getBoolValueForKey(WebPreferencesKey::canvasUsesAcceleratedDrawingKey()));
     1415    settings->setAcceleratedCompositingEnabled(store.getBoolValueForKey(WebPreferencesKey::acceleratedCompositingEnabledKey()) && LayerTreeHost::supportsAcceleratedCompositing());
     1416    settings->setAcceleratedDrawingEnabled(store.getBoolValueForKey(WebPreferencesKey::acceleratedDrawingEnabledKey()) && LayerTreeHost::supportsAcceleratedCompositing());
     1417    settings->setCanvasUsesAcceleratedDrawing(store.getBoolValueForKey(WebPreferencesKey::canvasUsesAcceleratedDrawingKey()) && LayerTreeHost::supportsAcceleratedCompositing());
    14171418    settings->setShowDebugBorders(store.getBoolValueForKey(WebPreferencesKey::compositingBordersVisibleKey()));
    14181419    settings->setShowRepaintCounter(store.getBoolValueForKey(WebPreferencesKey::compositingRepaintCountersVisibleKey()));
  • trunk/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp

    r82960 r82966  
    7777}
    7878
     79bool LayerTreeHostCAWin::supportsAcceleratedCompositing()
     80{
     81    static bool initialized;
     82    static bool supportsAcceleratedCompositing;
     83    if (initialized)
     84        return supportsAcceleratedCompositing;
     85    initialized = true;
     86
     87    ASSERT(!dummyWindow);
     88    dummyWindow = createDummyWindow();
     89    RetainPtr<WKCACFViewRef> view(AdoptCF, WKCACFViewCreate(kWKCACFViewDrawingDestinationImage));
     90    CGRect fakeBounds = CGRectMake(0, 0, 10, 10);
     91    WKCACFViewUpdate(view.get(), dummyWindow, &fakeBounds);
     92
     93    supportsAcceleratedCompositing = WKCACFViewCanDraw(view.get());
     94
     95    WKCACFViewUpdate(view.get(), 0, 0);
     96    ::DestroyWindow(dummyWindow);
     97    dummyWindow = 0;
     98
     99    return supportsAcceleratedCompositing;
     100}
     101
    79102PassRefPtr<LayerTreeHostCAWin> LayerTreeHostCAWin::create(WebPage* webPage)
    80103{
  • trunk/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h

    r82960 r82966  
    4242class LayerTreeHostCAWin : public LayerTreeHostCA, private WebCore::AbstractCACFLayerTreeHost {
    4343public:
     44    static bool supportsAcceleratedCompositing();
     45
    4446    static PassRefPtr<LayerTreeHostCAWin> create(WebPage*);
    4547    virtual ~LayerTreeHostCAWin();
  • trunk/Source/WebKit2/win/WebKit2.vcproj

    r82839 r82966  
    19061906                                        </File>
    19071907                                        <File
     1908                                                RelativePath="..\WebProcess\WebPage\win\LayerTreeHostWin.cpp"
     1909                                                >
     1910                                        </File>
     1911                                        <File
    19081912                                                RelativePath="..\WebProcess\WebPage\win\WebInspectorWin.cpp"
    19091913                                                >
     
    27682772                        </File>
    27692773                        <File
     2774                                RelativePath="..\UIProcess\WebIconDatabase.messages.in"
     2775                                >
     2776                        </File>
     2777                        <File
    27702778                                RelativePath="..\UIProcess\WebIconDatabaseClient.cpp"
    27712779                                >
     
    27732781                        <File
    27742782                                RelativePath="..\UIProcess\WebIconDatabaseClient.h"
    2775                                 >
    2776                         </File>
    2777                         <File
    2778                                 RelativePath="..\UIProcess\WebIconDatabase.messages.in"
    27792783                                >
    27802784                        </File>
Note: See TracChangeset for help on using the changeset viewer.