Changeset 189974 in webkit


Ignore:
Timestamp:
Sep 18, 2015 11:23:29 AM (9 years ago)
Author:
Brent Fulgham
Message:

[Win] Use tiled drawing for main background layer
https://bugs.webkit.org/show_bug.cgi?id=149347
<rdar://problem/22759632>

Reviewed by Alex Christensen.

Source/WebCore:

Turn on tiled drawing for the root layer when using
accelerated compositing on Windows.

  • page/Frame.h: Export the 'isMainFrame' method so that

it can be used by WebKit.dll.

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::getDebugBorderInfo): Use a full
pixel width on Windows, since it doesn't support High DPI (yet).

  • platform/graphics/ca/win/PlatformCALayerWin.cpp:

(PlatformCALayerWin::create): Use nullptr.
(toCACFFilterType): Ditto.
(layerTreeHostForLayer): Ditto.
(PlatformCALayer::platformCALayer): Ditto.

(PlatformCALayerWin::PlatformCALayerWin): Use the correct contents scaling

factor for new layers.
(PlatformCALayerWin::animationForKey): Use nullptr.

  • platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:

(WebTiledBackingLayerWin::displayCallback): Update assertion to
recognize LayerTypePageTiledBackingLayer as a valid layer to be used
in this display routine.

Source/WebKit/win:

Instruct WebCore to use tiled drawing for the root layer
of the display.

  • WebCoreSupport/WebChromeClient.cpp:

(WebChromeClient::shouldUseTiledBackingForFrameView): Added.

  • WebCoreSupport/WebChromeClient.h:
Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r189971 r189974  
     12015-09-18  Brent Fulgham  <bfulgham@apple.com>
     2
     3        [Win] Use tiled drawing for main background layer
     4        https://bugs.webkit.org/show_bug.cgi?id=149347
     5        <rdar://problem/22759632>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Turn on tiled drawing for the root layer when using
     10        accelerated compositing on Windows.
     11
     12        * page/Frame.h: Export the 'isMainFrame' method so that
     13        it can be used by WebKit.dll.
     14        * platform/graphics/ca/GraphicsLayerCA.cpp:
     15        (WebCore::GraphicsLayerCA::getDebugBorderInfo): Use a full
     16        pixel width on Windows, since it doesn't support High DPI (yet).
     17        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
     18        (PlatformCALayerWin::create): Use nullptr.
     19        (toCACFFilterType): Ditto.
     20        (layerTreeHostForLayer): Ditto.
     21        (PlatformCALayer::platformCALayer): Ditto.
     22         (PlatformCALayerWin::PlatformCALayerWin): Use the correct contents scaling
     23        factor for new layers.
     24        (PlatformCALayerWin::animationForKey): Use nullptr.
     25        * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
     26        (WebTiledBackingLayerWin::displayCallback): Update assertion to
     27        recognize LayerTypePageTiledBackingLayer as a valid layer to be used
     28        in this display routine.
     29
    1302015-09-18  Chris Dumez  <cdumez@apple.com>
    231
  • trunk/Source/WebCore/page/Frame.h

    r186684 r189974  
    139139
    140140        MainFrame& mainFrame() const;
    141         bool isMainFrame() const;
     141        WEBCORE_EXPORT bool isMainFrame() const;
    142142
    143143        Page* page() const;
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r188647 r189974  
    32493249    if (isPageTiledBackingLayer()) {
    32503250        color = Color(0, 0, 128, 128); // tile cache layer: dark blue
     3251#if OS(WINDOWS)
     3252        width = 1.0;
     3253#else
    32513254        width = 0.5;
     3255#endif
    32523256        return;
    32533257    }
  • trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp

    r189833 r189974  
    3030#include "AbstractCACFLayerTreeHost.h"
    3131#include "FontCascade.h"
     32#include "GDIUtilities.h"
    3233#include "GraphicsContext.h"
    3334#include "PlatformCAAnimationWin.h"
     
    4748PassRefPtr<PlatformCALayer> PlatformCALayerWin::create(LayerType layerType, PlatformCALayerClient* owner)
    4849{
    49     return adoptRef(new PlatformCALayerWin(layerType, 0, owner));
     50    return adoptRef(new PlatformCALayerWin(layerType, nullptr, owner));
    5051}
    5152
     
    6667    case PlatformCALayer::Nearest: return kCACFFilterNearest;
    6768    case PlatformCALayer::Trilinear: return kCACFFilterTrilinear;
    68     default: return 0;
     69    default: return nullptr;
    6970    }
    7071}
     
    7576    void* userData = wkCACFLayerGetContextUserData(layer->platformLayer());
    7677    if (!userData)
    77         return 0;
     78        return nullptr;
    7879
    7980    return static_cast<AbstractCACFLayerTreeHost*>(userData);
     
    9394{
    9495    if (!platformLayer)
    95         return 0;
     96        return nullptr;
    9697   
    9798    PlatformCALayerWinInternal* layerIntern = intern(platformLayer);
    98     return layerIntern ? layerIntern->owner() : 0;
     99    return layerIntern ? layerIntern->owner() : nullptr;
    99100}
    100101
     
    142143
    143144#if HAVE(CACFLAYER_SETCONTENTSSCALE)
    144     CACFLayerSetContentsScale(m_layer.get(), owner ? owner->platformCALayerDeviceScaleFactor() : 1.0f);
     145    CACFLayerSetContentsScale(m_layer.get(), owner ? owner->platformCALayerDeviceScaleFactor() : deviceScaleFactorForWindow(nullptr));
    145146#endif
    146147
     
    355356    HashMap<String, RefPtr<PlatformCAAnimation> >::iterator it = m_animations.find(key);
    356357    if (it == m_animations.end())
    357         return 0;
     358        return nullptr;
    358359
    359360    return it->value;
  • trunk/Source/WebCore/platform/graphics/ca/win/WebTiledBackingLayerWin.cpp

    r189821 r189974  
    8383    CGRect layerBounds = owner()->bounds();
    8484    PlatformCALayer::LayerType layerType = owner()->layerType();
    85     ASSERT(layerType == PlatformCALayer::LayerTypeTiledBackingLayer);
     85    ASSERT(layerType == PlatformCALayer::LayerTypeTiledBackingLayer || layerType == PlatformCALayer::LayerTypePageTiledBackingLayer);
    8686
    8787    PlatformCALayerClient* client = owner()->owner();
  • trunk/Source/WebKit/win/ChangeLog

    r189970 r189974  
     12015-09-18  Brent Fulgham  <bfulgham@apple.com>
     2
     3        [Win] Use tiled drawing for main background layer
     4        https://bugs.webkit.org/show_bug.cgi?id=149347
     5        <rdar://problem/22759632>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Instruct WebCore to use tiled drawing for the root layer
     10        of the display.
     11
     12        * WebCoreSupport/WebChromeClient.cpp:
     13        (WebChromeClient::shouldUseTiledBackingForFrameView): Added.
     14        * WebCoreSupport/WebChromeClient.h:
     15
    1162015-09-17  Brian Burg  <bburg@apple.com>
    217
  • trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp

    r188386 r189974  
    11/*
    2  * Copyright (C) 2006, 2007, 2008, 2013 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006-2008, 2013, 2015 Apple Inc. All rights reserved.
    33 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44 *
     
    851851        delegate->fireFrameLoadFinishedEvents();
    852852}
     853
     854bool WebChromeClient::shouldUseTiledBackingForFrameView(const FrameView* frameView) const
     855{
     856    return frameView && frameView->frame().isMainFrame();
     857}
  • trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h

    r187132 r189974  
    11/*
    2  * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006-2009, 2015 Apple Inc. All rights reserved.
    33 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44 *
     
    172172    virtual void AXFinishFrameLoad();
    173173
     174    bool shouldUseTiledBackingForFrameView(const WebCore::FrameView*) const override;
     175
    174176private:
    175177    COMPtr<IWebUIDelegate> uiDelegate();
Note: See TracChangeset for help on using the changeset viewer.