Changeset 122676 in webkit


Ignore:
Timestamp:
Jul 14, 2012 7:19:00 PM (12 years ago)
Author:
eric.carlson@apple.com
Message:

Enable AVCF hardware video decoding
https://bugs.webkit.org/show_bug.cgi?id=90015
<rdar://problem/10770317>

Reviewed by Anders Carlsson.

Source/WebCore:

  • html/HTMLMediaElement.cpp:

(WebCore):
(WebCore::HTMLMediaElement::mediaPlayerGraphicsDeviceAdapter): New, return the client's graphics

device adapter.

  • html/HTMLMediaElement.h:
  • page/ChromeClient.h:

(WebCore::ChromeClient::graphicsDeviceAdapter): New.

  • platform/graphics/MediaPlayer.cpp:

(WebCore::MediaPlayer::graphicsDeviceAdapter): New, ask the media element for the graphics

device adapter.

  • platform/graphics/MediaPlayer.h:
  • platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Soft-link AVCFPlayerSetDirect3DDevice

and AVCFPlayerEnableHardwareAcceleratedVideoDecoderKey.

  • platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:

(WebCore::MediaPlayerPrivateAVFoundationCF::createAVAssetForURL): Pass the current d3d9

device interface to the AVFWrapper.

(WebCore::AVFWrapper::createAssetForURL): If the d3d9 device implements IDirect3DDevice9Ex,

tell the AVAsset to enable hardware video decoding.

(WebCore::AVFWrapper::createPlayer): Pass the d3d9 device to the player if it implements IDirect3DDevice9Ex.

  • platform/graphics/ca/win/CACFLayerTreeHost.h:

(WebCore::CACFLayerTreeHost::graphicsDeviceAdapter): New, default implementation.

  • platform/graphics/ca/win/LegacyCACFLayerTreeHost.h:

(WebCore::LegacyCACFLayerTreeHost::graphicsDeviceAdapter): New, default implementation.

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

(WebCore::WKCACFViewLayerTreeHost::graphicsDeviceAdapter): New.

  • platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
  • platform/win/SoftLinking.h: Define SOFT_LINK_DLL_IMPORT_OPTIONAL, SOFT_LINK_LOADED_LIBRARY,

and SOFT_LINK_VARIABLE_DLL_IMPORT_OPTIONAL.

Source/WebKit/win:

  • WebCoreSupport/WebChromeClient.cpp:

(WebChromeClient::graphicsDeviceAdapter): New, return the view's graphics adapter.

  • WebCoreSupport/WebChromeClient.h:

(WebChromeClient):

  • WebView.cpp:

(WebView::graphicsDeviceAdapter): New, return the layer tree host's graphics adapter.

  • WebView.h:

(WebCore):
(WebView):

Source/WebKit2:

  • DerivedSources.make: Define HAVE_AVCF if necessary.
  • WebProcess/WebCoreSupport/WebChromeClient.cpp:

(WebKit):
(WebKit::WebChromeClient::graphicsDeviceAdapter): New, return the layer tree host's

graphics adapter.

  • WebProcess/WebCoreSupport/WebChromeClient.h:

(WebChromeClient):

  • WebProcess/WebPage/LayerTreeHost.h:

(WebCore):
(LayerTreeHost):
(WebKit::LayerTreeHost::graphicsDeviceAdapter): New, default implementation.

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

(LayerTreeHostCAWin):

Location:
trunk/Source
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r122674 r122676  
     12012-07-14  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Enable AVCF hardware video decoding
     4        https://bugs.webkit.org/show_bug.cgi?id=90015
     5        <rdar://problem/10770317>
     6
     7        Reviewed by Anders Carlsson.
     8
     9        * html/HTMLMediaElement.cpp:
     10        (WebCore):
     11        (WebCore::HTMLMediaElement::mediaPlayerGraphicsDeviceAdapter): New, return the client's graphics
     12            device adapter.
     13        * html/HTMLMediaElement.h:
     14
     15        * page/ChromeClient.h:
     16        (WebCore::ChromeClient::graphicsDeviceAdapter): New.
     17
     18        * platform/graphics/MediaPlayer.cpp:
     19        (WebCore::MediaPlayer::graphicsDeviceAdapter): New, ask the media element for the graphics
     20            device adapter.
     21        * platform/graphics/MediaPlayer.h:
     22
     23        * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Soft-link AVCFPlayerSetDirect3DDevice
     24            and AVCFPlayerEnableHardwareAcceleratedVideoDecoderKey.
     25
     26        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
     27        (WebCore::MediaPlayerPrivateAVFoundationCF::createAVAssetForURL): Pass the current d3d9
     28            device interface to the AVFWrapper.
     29        (WebCore::AVFWrapper::createAssetForURL): If the d3d9 device implements IDirect3DDevice9Ex,
     30            tell the AVAsset to enable hardware video decoding.
     31        (WebCore::AVFWrapper::createPlayer): Pass the d3d9 device to the player if it implements IDirect3DDevice9Ex.
     32
     33        * platform/graphics/ca/win/CACFLayerTreeHost.h:
     34        (WebCore::CACFLayerTreeHost::graphicsDeviceAdapter): New, default implementation.
     35
     36        * platform/graphics/ca/win/LegacyCACFLayerTreeHost.h:
     37        (WebCore::LegacyCACFLayerTreeHost::graphicsDeviceAdapter): New, default implementation.
     38        * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
     39        (WebCore::WKCACFViewLayerTreeHost::graphicsDeviceAdapter): New.
     40        * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
     41
     42        * platform/win/SoftLinking.h: Define SOFT_LINK_DLL_IMPORT_OPTIONAL, SOFT_LINK_LOADED_LIBRARY,
     43            and SOFT_LINK_VARIABLE_DLL_IMPORT_OPTIONAL.
     44
    1452012-07-14  Ryosuke Niwa  <rniwa@webkit.org>
    246
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r122432 r122676  
    34863486#endif
    34873487
     3488#if PLATFORM(WIN) && USE(AVFOUNDATION)
     3489GraphicsDeviceAdapter* HTMLMediaElement::mediaPlayerGraphicsDeviceAdapter(const MediaPlayer*) const
     3490{
     3491    if (!document() || !document()->page())
     3492        return 0;
     3493
     3494    return document()->page()->chrome()->client()->graphicsDeviceAdapter();
     3495}
     3496#endif
     3497
    34883498void HTMLMediaElement::mediaPlayerEngineUpdated(MediaPlayer*)
    34893499{
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r122432 r122676  
    433433    virtual String mediaPlayerDocumentHost() const OVERRIDE;
    434434
     435#if PLATFORM(WIN) && USE(AVFOUNDATION)
     436    virtual GraphicsDeviceAdapter* mediaPlayerGraphicsDeviceAdapter(const MediaPlayer*) const OVERRIDE;
     437#endif
     438
    435439    void loadTimerFired(Timer<HTMLMediaElement>*);
    436440    void progressEventTimerFired(Timer<HTMLMediaElement>*);
  • trunk/Source/WebCore/page/ChromeClient.h

    r122558 r122676  
    11/*
    2  * Copyright (C) 2006, 2007, 2008, 2009 Apple, Inc. All rights reserved.
     2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple, Inc. All rights reserved.
    33 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44 * Copyright (C) 2012 Samsung Electronics. All rights reserved.
     
    8383#endif
    8484
     85#if PLATFORM(WIN) && USE(AVFOUNDATION)
     86    struct GraphicsDeviceAdapter;
     87#endif
     88
    8589    class ChromeClient {
    8690    public:
     
    276280        // Returns a bitfield indicating conditions that can trigger the compositor.
    277281        virtual CompositingTriggerFlags allowedCompositingTriggers() const { return static_cast<CompositingTriggerFlags>(AllTriggers); }
     282#endif
     283
     284#if PLATFORM(WIN) && USE(AVFOUNDATION)
     285        virtual GraphicsDeviceAdapter* graphicsDeviceAdapter() const { return 0; }
    278286#endif
    279287
  • trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp

    r121053 r122676  
    11/*
    2  * Copyright (C) 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    209209
    210210#if USE(AVFOUNDATION)
    211         if (Settings::isAVFoundationEnabled()) {
     211        if (1 /* @@Settings::isAVFoundationEnabled() @@ */) {
    212212#if PLATFORM(MAC)
    213213            MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(addMediaEngine);
     
    10691069}
    10701070
    1071 }
    1072 
    1073 #endif
     1071#if PLATFORM(WIN) && USE(AVFOUNDATION)
     1072GraphicsDeviceAdapter* MediaPlayer::graphicsDeviceAdapter() const
     1073{
     1074    if (!m_mediaPlayerClient)
     1075        return 0;
     1076   
     1077    return m_mediaPlayerClient->mediaPlayerGraphicsDeviceAdapter(this);
     1078}
     1079#endif
     1080
     1081}
     1082
     1083#endif
  • trunk/Source/WebCore/platform/graphics/MediaPlayer.h

    r121053 r122676  
    11/*
    2  * Copyright (C) 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    100100class TimeRanges;
    101101
     102#if PLATFORM(WIN) && USE(AVFOUNDATION)
     103struct GraphicsDeviceAdapter;
     104#endif
     105
    102106class MediaPlayerClient {
    103107public:
     
    164168    // availability of the platformLayer().
    165169    virtual void mediaPlayerRenderingModeChanged(MediaPlayer*) { }
     170#endif
     171
     172#if PLATFORM(WIN) && USE(AVFOUNDATION)
     173    virtual GraphicsDeviceAdapter* mediaPlayerGraphicsDeviceAdapter(const MediaPlayer*) const { return 0; }
    166174#endif
    167175
     
    355363    // called when the rendering system flips the into or out of accelerated rendering mode.
    356364    void acceleratedRenderingStateChanged();
     365#endif
     366
     367#if PLATFORM(WIN) && USE(AVFOUNDATION)
     368    GraphicsDeviceAdapter* graphicsDeviceAdapter() const;
    357369#endif
    358370
  • trunk/Source/WebCore/platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h

    r93459 r122676  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    178178#define AVCFURLAssetCreateWithURLAndOptions softLink_AVCFURLAssetCreateWithURLAndOptions
    179179
     180SOFT_LINK_DLL_IMPORT_OPTIONAL(AVFoundationCF, AVCFPlayerSetDirect3DDevice, void, __cdecl, (AVCFPlayerRef player, IDirect3DDevice9* d3dDevice))
     181
    180182// Variables
    181183
     
    245247SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFPlayerRateChangedNotification, const CFStringRef);
    246248#define AVCFPlayerRateChangedNotification get_AVCFPlayerRateChangedNotification()
     249
     250SOFT_LINK_VARIABLE_DLL_IMPORT_OPTIONAL(AVFoundationCF, AVCFPlayerEnableHardwareAcceleratedVideoDecoderKey, const CFStringRef);
     251#define AVCFPlayerEnableHardwareAcceleratedVideoDecoderKey get_AVCFPlayerEnableHardwareAcceleratedVideoDecoderKey()
  • trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp

    r121053 r122676  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3333
    3434#include "ApplicationCacheResource.h"
     35#include "COMPtr.h"
    3536#include "FloatConversion.h"
    3637#include "FrameView.h"
     
    4546#include <AVFoundationCF/AVFoundationCF.h>
    4647#include <CoreMedia/CoreMedia.h>
    47 
    4848#include <delayimp.h>
    4949#include <dispatch/dispatch.h>
     50#include <WebKitQuartzCoreAdditions/WKCACFTypes.h>
    5051#include <wtf/HashMap.h>
    5152#include <wtf/Threading.h>
     
    8889    void setAsset(AVCFURLAssetRef);
    8990   
    90     void createPlayer();
     91    void createPlayer(IDirect3DDevice9*);
    9192    void createPlayerItem();
    9293   
     
    138139
    139140    OwnPtr<LayerClient> m_layerClient;
     141    COMPtr<IDirect3DDevice9Ex> m_d3dDevice;
    140142};
    141143
     
    340342   
    341343    setDelayCallbacks(true);
    342     m_avfWrapper->createPlayer();
     344    m_avfWrapper->createPlayer(reinterpret_cast<IDirect3DDevice9*>(player()->graphicsDeviceAdapter()));
    343345    setDelayCallbacks(false);
    344346}
     
    356358{
    357359    ASSERT(!m_avfWrapper);
    358    
     360
    359361    setDelayCallbacks(true);
     362
    360363    m_avfWrapper = new AVFWrapper(this);
    361364    m_avfWrapper->createAssetForURL(url);
     
    956959{
    957960    ASSERT(!avAsset());
    958    
     961
    959962    RetainPtr<CFURLRef> urlRef(AdoptCF, KURL(ParsedURLString, url).createCFURL());
     963
    960964    AVCFURLAssetRef assetRef = AVCFURLAssetCreateWithURLAndOptions(kCFAllocatorDefault, urlRef.get(), 0, m_notificationQueue);
    961965    m_avAsset.adoptCF(assetRef);
    962966}
    963967
    964 void AVFWrapper::createPlayer()
     968void AVFWrapper::createPlayer(IDirect3DDevice9* d3dDevice)
    965969{
    966970    ASSERT(!avPlayer() && avPlayerItem());
    967971
     972    RetainPtr<CFMutableDictionaryRef> optionsRef(AdoptCF, CFDictionaryCreateMutable(kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
     973
     974    if (d3dDevice) {
     975        // QI for an IDirect3DDevice9Ex interface, it is required to do HW video decoding.
     976        COMPtr<IDirect3DDevice9Ex> d3dEx(Query, d3dDevice);
     977        m_d3dDevice = d3dEx;
     978    } else
     979        m_d3dDevice = 0;
     980
     981    if (m_d3dDevice && AVCFPlayerEnableHardwareAcceleratedVideoDecoderKey)
     982        CFDictionarySetValue(optionsRef.get(), AVCFPlayerEnableHardwareAcceleratedVideoDecoderKey, kCFBooleanTrue);
     983
    968984    // FIXME: We need a way to create a AVPlayer without an AVPlayerItem, see <rdar://problem/9877730>.
    969     AVCFPlayerRef playerRef = AVCFPlayerCreateWithPlayerItemAndOptions(kCFAllocatorDefault, avPlayerItem(), 0, m_notificationQueue);
     985    AVCFPlayerRef playerRef = AVCFPlayerCreateWithPlayerItemAndOptions(kCFAllocatorDefault, avPlayerItem(), optionsRef.get(), m_notificationQueue);
    970986    m_avPlayer.adoptCF(playerRef);
     987
     988    if (m_d3dDevice && AVCFPlayerSetDirect3DDevicePtr())
     989        AVCFPlayerSetDirect3DDevicePtr()(playerRef, m_d3dDevice.get());
    971990
    972991    CFNotificationCenterRef center = CFNotificationCenterGetLocalCenter();
  • trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h

    r107603 r122676  
    11/*
    2  * Copyright (C) 2009 Apple Inc. All rights reserved.
     2 * Copyright (C) 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4747typedef struct CGImage* CGImageRef;
    4848
     49#if USE(AVFOUNDATION)
     50struct GraphicsDeviceAdapter;
     51#endif
     52
    4953namespace WebCore {
    5054
     
    6771    void flushPendingGraphicsLayerChangesSoon();
    6872    virtual void setShouldInvertColors(bool);
     73#if USE(AVFOUNDATION)
     74    virtual GraphicsDeviceAdapter* graphicsDeviceAdapter() const { return 0; }
     75#endif
    6976
    7077    // AbstractCACFLayerTreeHost
  • trunk/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h

    r95901 r122676  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    6565    virtual void render(const Vector<CGRect>& dirtyRects = Vector<CGRect>());
    6666
     67#if USE(AVFOUNDATION)
     68    virtual GraphicsDeviceAdapter* graphicsDeviceAdapter() const OVERRIDE { return 0; }
     69#endif
     70
    6771    Timer<LegacyCACFLayerTreeHost> m_renderTimer;
    6872    COMPtr<IDirect3DDevice9> m_d3dDevice;
  • trunk/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp

    r107603 r122676  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    6262SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewSetContextUserData, void, __cdecl, (WKCACFViewRef view, void* userData), (view, userData))
    6363SOFT_LINK_OPTIONAL(WebKitQuartzCoreAdditions, WKCACFViewSetShouldInvertColors, void, _cdecl, (WKCACFViewRef view, bool shouldInvertColors))
     64SOFT_LINK_OPTIONAL(WebKitQuartzCoreAdditions, WKCACFViewGetD3DDevice9, IDirect3DDevice9*, _cdecl, (WKCACFViewRef view))
    6465
    6566PassRefPtr<WKCACFViewLayerTreeHost> WKCACFViewLayerTreeHost::create()
     
    176177}
    177178
     179#if USE(AVFOUNDATION)
     180GraphicsDeviceAdapter* WKCACFViewLayerTreeHost::graphicsDeviceAdapter() const
     181{
     182    if (!WKCACFViewGetD3DDevice9Ptr())
     183        return 0;
     184
     185    return reinterpret_cast<GraphicsDeviceAdapter*>(WKCACFViewGetD3DDevice9Ptr()(m_view.get()));
     186}
     187#endif
     188
    178189} // namespace WebCore
    179190
  • trunk/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h

    r107603 r122676  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    5555    virtual CFTimeInterval lastCommitTime() const;
    5656    virtual void setShouldInvertColors(bool);
     57#if USE(AVFOUNDATION)
     58    virtual GraphicsDeviceAdapter* graphicsDeviceAdapter() const OVERRIDE;
     59#endif
    5760
    5861    RetainPtr<WKCACFViewRef> m_view;
  • trunk/Source/WebCore/platform/win/SoftLinking.h

    r93363 r122676  
    8080    }\
    8181
     82#define SOFT_LINK_LOADED_LIBRARY(library, functionName, resultType, callingConvention, parameterDeclarations) \
     83    typedef resultType (callingConvention *functionName##PtrType) parameterDeclarations; \
     84    static functionName##PtrType functionName##Ptr() \
     85    { \
     86        static functionName##PtrType ptr; \
     87        static bool initialized; \
     88        \
     89        if (initialized) \
     90            return ptr; \
     91        initialized = true; \
     92        \
     93        static HINSTANCE libraryInstance = ::GetModuleHandle(L#library); \
     94        \
     95        ptr = reinterpret_cast<functionName##PtrType>(SOFT_LINK_GETPROCADDRESS(libraryInstance, #functionName)); \
     96        return ptr; \
     97    }\
     98
    8299/*
    83100    In order to soft link against functions decorated with __declspec(dllimport), we prepend "softLink_" to the function names.
     
    103120    }
    104121
     122#define SOFT_LINK_DLL_IMPORT_OPTIONAL(library, functionName, resultType, callingConvention, parameterDeclarations) \
     123    typedef resultType (callingConvention *functionName##PtrType) parameterDeclarations; \
     124    static functionName##PtrType functionName##Ptr() \
     125    { \
     126        static functionName##PtrType ptr; \
     127        static bool initialized; \
     128        \
     129        if (initialized) \
     130            return ptr; \
     131        initialized = true; \
     132        \
     133        ptr = reinterpret_cast<resultType(callingConvention*)parameterDeclarations>(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName)); \
     134        return ptr; \
     135    }\
     136
     137#define SOFT_LINK_DLL_IMPORT_OPTIONAL(library, functionName, resultType, callingConvention, parameterDeclarations) \
     138    typedef resultType (callingConvention *functionName##PtrType) parameterDeclarations; \
     139    static functionName##PtrType functionName##Ptr() \
     140    { \
     141        static functionName##PtrType ptr; \
     142        static bool initialized; \
     143        \
     144        if (initialized) \
     145            return ptr; \
     146        initialized = true; \
     147        \
     148        ptr = reinterpret_cast<resultType(callingConvention*)parameterDeclarations>(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName)); \
     149        return ptr; \
     150    }\
     151
    105152/*
    106153    Variables exported by a DLL need to be accessed through a function.
     
    118165    }\
    119166
     167/*
     168    Note that this will only work for variable types for which a return value of 0 can signal an error.
     169 */
     170#define SOFT_LINK_VARIABLE_DLL_IMPORT_OPTIONAL(library, variableName, variableType) \
     171    static variableType get_##variableName() \
     172    { \
     173        static variableType* ptr = reinterpret_cast<variableType*>(SOFT_LINK_GETPROCADDRESS(library##Library(), #variableName)); \
     174        if (!ptr) \
     175            return 0; \
     176        return *ptr; \
     177    }\
     178
    120179#endif // SoftLinking_h
  • trunk/Source/WebKit/win/ChangeLog

    r122280 r122676  
     12012-07-14  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Enable AVCF hardware video decoding
     4        https://bugs.webkit.org/show_bug.cgi?id=90015
     5        <rdar://problem/10770317>
     6
     7        Reviewed by Anders Carlsson.
     8
     9        * WebCoreSupport/WebChromeClient.cpp:
     10        (WebChromeClient::graphicsDeviceAdapter): New, return the view's graphics adapter.
     11        * WebCoreSupport/WebChromeClient.h:
     12        (WebChromeClient):
     13
     14        * WebView.cpp:
     15        (WebView::graphicsDeviceAdapter): New, return the layer tree host's graphics adapter.
     16        * WebView.h:
     17        (WebCore):
     18        (WebView):
     19
    1202012-07-10  Adam Barth  <abarth@webkit.org>
    221
  • trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp

    r116687 r122676  
    753753    m_webView->flushPendingGraphicsLayerChangesSoon();
    754754}
    755 
     755#endif
     756
     757#if PLATFORM(WIN) && USE(AVFOUNDATION)
     758WebCore::GraphicsDeviceAdapter* WebChromeClient::graphicsDeviceAdapter() const
     759{
     760    return m_webView->graphicsDeviceAdapter();
     761}
    756762#endif
    757763
  • trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h

    r116687 r122676  
    143143#endif
    144144
     145#if PLATFORM(WIN) && USE(AVFOUNDATION)
     146    virtual WebCore::GraphicsDeviceAdapter* graphicsDeviceAdapter() const OVERRIDE;
     147#endif
     148
    145149    virtual void scrollRectIntoView(const WebCore::IntRect&) const { }
    146150
  • trunk/Source/WebKit/win/WebView.cpp

    r122280 r122676  
    11/*
    2  * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple, Inc.  All rights reserved.
     2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple, Inc.  All rights reserved.
    33 * Copyright (C) 2009, 2010, 2011 Appcelerator, Inc. All rights reserved.
    44 * Copyright (C) 2011 Brent Fulgham. All rights reserved.
     
    65306530#endif
    65316531
     6532#if PLATFORM(WIN) && USE(AVFOUNDATION)
     6533WebCore::GraphicsDeviceAdapter* WebView::graphicsDeviceAdapter() const
     6534{
     6535    if (!m_layerTreeHost)
     6536        return 0;
     6537    return m_layerTreeHost->graphicsDeviceAdapter();
     6538}
     6539#endif
     6540
    65326541HRESULT WebView::unused1()
    65336542{
  • trunk/Source/WebKit/win/WebView.h

    r118594 r122676  
    11/*
    2  * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.  All rights reserved.
     2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.  All rights reserved.
    33 * Copyright (C) 2009, 2010, 2011 Appcelerator, Inc. All rights reserved.
    44 * Copyright (C) 2011 Brent Fulgham. All rights reserved.
     
    5656#endif
    5757    class FullScreenController;
     58#if PLATFORM(WIN) && USE(AVFOUNDATION)
     59    struct GraphicsDeviceAdapter;
     60#endif
    5861}
    5962
     
    948951#endif
    949952
     953#if PLATFORM(WIN) && USE(AVFOUNDATION)
     954    WebCore::GraphicsDeviceAdapter* graphicsDeviceAdapter() const;
     955#endif
     956
    950957    void enterFullscreenForNode(WebCore::Node*);
    951958    void exitFullscreen();
  • trunk/Source/WebKit2/ChangeLog

    r122601 r122676  
     12012-07-14  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Enable AVCF hardware video decoding
     4        https://bugs.webkit.org/show_bug.cgi?id=90015
     5        <rdar://problem/10770317>
     6
     7        Reviewed by Anders Carlsson.
     8
     9        * DerivedSources.make: Define HAVE_AVCF if necessary.
     10
     11        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     12        (WebKit):
     13        (WebKit::WebChromeClient::graphicsDeviceAdapter): New, return the layer tree host's
     14            graphics adapter.
     15        * WebProcess/WebCoreSupport/WebChromeClient.h:
     16        (WebChromeClient):
     17        * WebProcess/WebPage/LayerTreeHost.h:
     18        (WebCore):
     19        (LayerTreeHost):
     20        (WebKit::LayerTreeHost::graphicsDeviceAdapter): New, default implementation.
     21
     22        * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h:
     23        (LayerTreeHostCAWin):
     24
    1252012-07-13  Thiago Marcos P. Santos  <thiago.santos@intel.com>
    226
  • trunk/Source/WebKit2/DerivedSources.make

    r114069 r122676  
    1 # Copyright (C) 2010 Apple Inc. All rights reserved.
     1# Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
    22#
    33# Redistribution and use in source and binary forms, with or without
     
    147147HeaderDetection.h : DerivedSources.make
    148148        if [ -f "$(WEBKITLIBRARIESDIR)/include/WebKitQuartzCoreAdditions/WebKitQuartzCoreAdditionsBase.h" ] && [ ! -f "$(WEBKITLIBRARIESDIR)/include/cairo/cairo.h" ]; then echo "#define HAVE_WKQCA 1" > $@; else echo > $@; fi
     149        if [ -f "$(WEBKITLIBRARIESDIR)/include/AVFoundationCF/AVCFBase.h" ]; then echo "#define HAVE_AVCF 1" >> $@; else echo >> $@; fi
    149150
    150151endif # Windows_NT
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r120890 r122676  
    11/*
    2  * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
    33 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44 *
     
    697697#endif
    698698
     699#if PLATFORM(WIN) && USE(AVFOUNDATION)
     700WebCore::GraphicsDeviceAdapter* WebChromeClient::graphicsDeviceAdapter() const
     701{
     702    if (!m_page->drawingArea())
     703        return 0;
     704    return m_page->drawingArea()->layerTreeHost()->graphicsDeviceAdapter();
     705}
     706#endif
     707
    699708#if ENABLE(TOUCH_EVENTS)
    700709void WebChromeClient::needTouchEvents(bool needTouchEvents)
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h

    r121897 r122676  
    11/*
    2  * Copyright (C) 2010 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
    33 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44 *
     
    190190#endif
    191191
     192#if PLATFORM(WIN) && USE(AVFOUNDATION)
     193    virtual WebCore::GraphicsDeviceAdapter* graphicsDeviceAdapter() const OVERRIDE;
     194#endif
     195
    192196#if ENABLE(TOUCH_EVENTS)
    193197    virtual void needTouchEvents(bool) OVERRIDE;
  • trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h

    r121221 r122676  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4242class IntSize;
    4343class GraphicsLayer;
     44
     45#if PLATFORM(WIN) && USE(AVFOUNDATION)
     46struct GraphicsDeviceAdapter;
     47#endif
    4448}
    4549
     
    98102#endif
    99103
     104#if PLATFORM(WIN) && USE(AVFOUNDATION)
     105    virtual WebCore::GraphicsDeviceAdapter* graphicsDeviceAdapter() const { return 0; }
     106#endif
     107
    100108protected:
    101109    explicit LayerTreeHost(WebPage*);
  • trunk/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp

    r116478 r122676  
    3737#include <WebCore/LayerChangesFlusher.h>
    3838#include <WebCore/PlatformCALayer.h>
     39#include <WebCore/SoftLinking.h>
    3940#include <WebCore/WebCoreInstanceHandle.h>
    4041#include <WebKitQuartzCoreAdditions/WKCACFImage.h>
     
    4445
    4546#ifdef DEBUG_ALL
    46 #pragma comment(lib, "WebKitQuartzCoreAdditions_debug")
     47#define MODULE_NAME "WebKitQuartzCoreAdditions_debug"
    4748#else
    48 #pragma comment(lib, "WebKitQuartzCoreAdditions")
     49#define MODULE_NAME "WebKitQuartzCoreAdditions"
     50#endif
     51
     52#pragma comment(lib, MODULE_NAME)
     53
     54#if USE(AVFOUNDATION)
     55SOFT_LINK_LOADED_LIBRARY(MODULE_NAME, WKCACFViewGetD3DDevice9, IDirect3DDevice9*, _cdecl, (WKCACFViewRef view))
    4956#endif
    5057
     
    259266}
    260267
     268#if USE(AVFOUNDATION)
     269WebCore::GraphicsDeviceAdapter* LayerTreeHostCAWin::graphicsDeviceAdapter() const
     270{
     271    if (!WKCACFViewGetD3DDevice9Ptr())
     272        return 0;
     273
     274    return reinterpret_cast<GraphicsDeviceAdapter*>(WKCACFViewGetD3DDevice9Ptr()(m_view.get()));
     275}
     276#endif
     277
    261278} // namespace WebKit
    262279
     280
    263281#endif // HAVE(WKQCA)
  • trunk/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h

    r116492 r122676  
    5050    virtual ~LayerTreeHostCAWin();
    5151
     52#if USE(AVFOUNDATION)
     53    virtual WebCore::GraphicsDeviceAdapter* graphicsDeviceAdapter() const OVERRIDE;
     54#endif
     55
    5256private:
    5357    explicit LayerTreeHostCAWin(WebPage*);
Note: See TracChangeset for help on using the changeset viewer.