Changeset 127672 in webkit


Ignore:
Timestamp:
Sep 5, 2012 6:16:45 PM (12 years ago)
Author:
jamesr@google.com
Message:

[chromium] Move static WebCompositor functions to WebCompositorSupport
https://bugs.webkit.org/show_bug.cgi?id=95785

Reviewed by Darin Fisher.

The statics on WebCompositor need to be moved to WebCompositorSupport so the embedder can inject an
implementation for these via PlatformSupport. This adds the interface for the statics to WebCompositorSupport.
After an implementation of these lands on the chromium side, I'll switch all callers over to use these and
remove the WebCompositor interface from the API.

  • chromium/public/WebCompositorSupport.h:

(WebCompositorSupport):
(WebKit::WebCompositorSupport::initialize):
(WebKit::WebCompositorSupport::threadingEnabled):
(WebKit::WebCompositorSupport::shutdown):
(WebKit::WebCompositorSupport::setPerTilePaintingEnabled):
(WebKit::WebCompositorSupport::setPartialSwapEnabled):
(WebKit::WebCompositorSupport::setAcceleratedAnimationEnabled):

Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/Platform/ChangeLog

    r127623 r127672  
     12012-09-05  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Move static WebCompositor functions to WebCompositorSupport
     4        https://bugs.webkit.org/show_bug.cgi?id=95785
     5
     6        Reviewed by Darin Fisher.
     7
     8        The statics on WebCompositor need to be moved to WebCompositorSupport so the embedder can inject an
     9        implementation for these via PlatformSupport. This adds the interface for the statics to WebCompositorSupport.
     10        After an implementation of these lands on the chromium side, I'll switch all callers over to use these and
     11        remove the WebCompositor interface from the API.
     12
     13        * chromium/public/WebCompositorSupport.h:
     14        (WebCompositorSupport):
     15        (WebKit::WebCompositorSupport::initialize):
     16        (WebKit::WebCompositorSupport::threadingEnabled):
     17        (WebKit::WebCompositorSupport::shutdown):
     18        (WebKit::WebCompositorSupport::setPerTilePaintingEnabled):
     19        (WebKit::WebCompositorSupport::setPartialSwapEnabled):
     20        (WebKit::WebCompositorSupport::setAcceleratedAnimationEnabled):
     21
    1222012-09-05  Mark Pilgrim  <pilgrim@chromium.org>
    223
  • trunk/Source/Platform/chromium/public/WebCompositor.h

    r125339 r127672  
    4545
    4646    // Returns whether the compositor was initialized with threading enabled.
    47     WEBKIT_EXPORT static bool threadingEnabled();
     47    WEBKIT_EXPORT static bool isThreadingEnabled();
    4848
    4949    // Shuts down the compositor. This must be called when all compositor data
  • trunk/Source/Platform/chromium/public/WebCompositorSupport.h

    r127225 r127672  
    4747class WebScrollbarThemeGeometry;
    4848class WebSolidColorLayer;
     49class WebThread;
    4950class WebTransformAnimationCurve;
    5051class WebVideoFrameProvider;
     
    5354class WebCompositorSupport {
    5455public:
     56    // Initializes the compositor. Threaded compositing is enabled by passing in
     57    // a non-null WebThread. No compositor classes or methods should be used
     58    // prior to calling initialize.
     59    virtual void initialize(WebThread*) { }
     60
     61    // Returns whether the compositor was initialized with threading enabled.
     62    virtual bool isThreadingEnabled() { return false; }
     63
     64    // Shuts down the compositor. This must be called when all compositor data
     65    // types have been deleted. No compositor classes or methods should be used
     66    // after shutdown.
     67    virtual void shutdown() { }
     68
     69    // These may only be called before initialize.
     70    virtual void setPerTilePaintingEnabled(bool) { }
     71    virtual void setPartialSwapEnabled(bool) { }
     72    virtual void setAcceleratedAnimationEnabled(bool) { }
     73
    5574    // May return 0 if initialization fails.
    5675    virtual WebLayerTreeView* createLayerTreeView(WebLayerTreeViewClient*, const WebLayer& root, const WebLayerTreeView::Settings&) { return 0; }
  • trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.cpp

    r125932 r127672  
    4848}
    4949
    50 bool WebCompositor::threadingEnabled()
     50bool WebCompositor::isThreadingEnabled()
    5151{
    52     return WebCompositorImpl::threadingEnabled();
     52    return WebCompositorImpl::isThreadingEnabled();
    5353}
    5454
     
    9191}
    9292
    93 bool WebCompositorImpl::threadingEnabled()
     93bool WebCompositorImpl::isThreadingEnabled()
    9494{
    9595    return s_implThread;
  • trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.h

    r125339 r127672  
    5050    friend class WebCompositor;
    5151    static void initialize(WebThread* implThread);
    52     static bool threadingEnabled();
     52    static bool isThreadingEnabled();
    5353    static void shutdown();
    5454
  • trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp

    r127225 r127672  
    5252    // on GPU resource monitoring and other factors to chose between single
    5353    // and double buffering.
    54     , m_useDoubleBuffering(WebKit::WebCompositor::threadingEnabled() && deferralMode == NonDeferred)
     54    , m_useDoubleBuffering(WebKit::WebCompositor::isThreadingEnabled() && deferralMode == NonDeferred)
    5555    , m_frontBufferTexture(0)
    5656    , m_backBufferTexture(textureId)
     
    8383
    8484    m_layer->setTextureId(textureId);
    85     m_layer->setRateLimitContext(!WebKit::WebCompositor::threadingEnabled() || m_useDoubleBuffering);
     85    m_layer->setRateLimitContext(!WebKit::WebCompositor::isThreadingEnabled() || m_useDoubleBuffering);
    8686    GraphicsLayerChromium::registerContentsLayer(m_layer->layer());
    8787}
  • trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp

    r127225 r127672  
    8585    , m_colorBuffer(0)
    8686    , m_frontColorBuffer(0)
    87     , m_separateFrontTexture(m_preserveDrawingBuffer == Preserve || WebKit::WebCompositor::threadingEnabled())
     87    , m_separateFrontTexture(m_preserveDrawingBuffer == Preserve || WebKit::WebCompositor::isThreadingEnabled())
    8888    , m_depthStencilBuffer(0)
    8989    , m_depthBuffer(0)
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r127494 r127672  
    18191819{
    18201820#if USE(ACCELERATED_COMPOSITING)
    1821     if (WebCompositor::threadingEnabled())
     1821    if (WebCompositor::isThreadingEnabled())
    18221822        m_layerTreeView->setNeedsRedraw();
    18231823    else {
     
    37353735{
    37363736    if (isAcceleratedCompositingActive()) {
    3737         if (WebCompositor::threadingEnabled()) {
     3737        if (WebCompositor::isThreadingEnabled()) {
    37383738            ASSERT(m_layerTreeView);
    37393739            m_layerTreeView->setNeedsAnimate();
     
    39683968void WebViewImpl::scheduleComposite()
    39693969{
    3970     ASSERT(!WebCompositor::threadingEnabled());
     3970    ASSERT(!WebCompositor::isThreadingEnabled());
    39713971    m_client->scheduleComposite();
    39723972}
Note: See TracChangeset for help on using the changeset viewer.