[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

aroben at apple.com aroben at apple.com
Mon Feb 21 00:04:43 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit d8841389652b9a6c23d2b930466c54cf6f87628e
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 27 23:26:27 2011 +0000

    Split CACFLayerTreeHost into base and derived classes
    
    The derived class, LegacyCACFLayerTreeHost, contains all the D3D-related code. A later patch
    will add a new derived class that replaces the D3D code with a different rendering API.
    
    For now, LegacyCACFLayerTreeHost lives in CACFLayerTreeHost.cpp. This keeps the diff a
    little smaller. A later patch will move it to its own source files.
    
    Preparation for <http://webkit.org/b/53251> <rdar://problem/8925496> CACFLayerTreeHost
    should use WKCACFView for rendering
    
    Reviewed by Simon Fraser.
    
    * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
    (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable): Clear the window before
    destroying the host, as that is now the API contract that clients must fulfill.
    (WebCore::LegacyCACFLayerTreeHost::create): Added. Simple creator.
    (WebCore::CACFLayerTreeHost::create): Now instantiates a LegacyCACFLayerTreeHost. Calls the
    new initialize function to perform initialization that has to happen after the vtable has
    been set up.
    
    (WebCore::LegacyCACFLayerTreeHost::LegacyCACFLayerTreeHost):
    (WebCore::CACFLayerTreeHost::CACFLayerTreeHost):
    (WebCore::LegacyCACFLayerTreeHost::initializeContext):
    (WebCore::CACFLayerTreeHost::initialize):
    Moved some initialization code from the CACFLayerTreeHost constructor into these new
    functions.
    
    (WebCore::LegacyCACFLayerTreeHost::~LegacyCACFLayerTreeHost): Added. Moved code here from
    ~CACFLayerTreeHost.
    (WebCore::CACFLayerTreeHost::~CACFLayerTreeHost): Rather than clearing the window at this
    point (which would be too late, since we won't be able to call into the derived class's
    virtual functions), just assert that it has already been cleared (or was never set in the
    first place).
    (WebCore::LegacyCACFLayerTreeHost::createRenderer): Renamed from
    CACFLayerTreeHost::createRenderer, and changed to use getters instead of accessing
    CACFLayerTreeHost's data members directly.
    
    (WebCore::LegacyCACFLayerTreeHost::destroyRenderer):
    (WebCore::CACFLayerTreeHost::destroyRenderer):
    Moved some code to the new LegacyCACFLayerTreeHost function.
    
    (WebCore::LegacyCACFLayerTreeHost::resize):
    (WebCore::LegacyCACFLayerTreeHost::renderTimerFired):
    Moved these functions to LegacyCACFLayerTreeHost.
    
    (WebCore::LegacyCACFLayerTreeHost::paint):
    (WebCore::CACFLayerTreeHost::paint):
    Moved some code to the new LegacyCACFLayerTreeHost function.
    
    (WebCore::LegacyCACFLayerTreeHost::render):
    (WebCore::LegacyCACFLayerTreeHost::renderSoon):
    Moved these functions to LegacyCACFLayerTreeHost.
    
    (WebCore::CACFLayerTreeHost::flushPendingLayerChangesNow): Moved code to flush the context
    from here...
    (WebCore::LegacyCACFLayerTreeHost::flushContext): ...to this new function.
    
    (WebCore::LegacyCACFLayerTreeHost::lastCommitTime): Moved code to get the last commit time
    to this new function...
    (WebCore::CACFLayerTreeHost::notifyAnimationsStarted): ...from here.
    
    (WebCore::LegacyCACFLayerTreeHost::initD3DGeometry):
    (WebCore::LegacyCACFLayerTreeHost::resetDevice):
    Moved these functions to LegacyCACFLayerTreeHost.
    
    * platform/graphics/ca/win/CACFLayerTreeHost.h: Made some functions virtual, removed some
    members that have moved to LegacyCACFLayerTreeHost, added some getters used by
    LegacyCACFLayerTreeHost.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76853 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index daa3d83..bd90d7e 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,5 +1,77 @@
 2011-01-27  Adam Roben  <aroben at apple.com>
 
+        Split CACFLayerTreeHost into base and derived classes
+
+        The derived class, LegacyCACFLayerTreeHost, contains all the D3D-related code. A later patch
+        will add a new derived class that replaces the D3D code with a different rendering API.
+
+        For now, LegacyCACFLayerTreeHost lives in CACFLayerTreeHost.cpp. This keeps the diff a
+        little smaller. A later patch will move it to its own source files.
+
+        Preparation for <http://webkit.org/b/53251> <rdar://problem/8925496> CACFLayerTreeHost
+        should use WKCACFView for rendering
+
+        Reviewed by Simon Fraser.
+
+        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
+        (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable): Clear the window before
+        destroying the host, as that is now the API contract that clients must fulfill.
+        (WebCore::LegacyCACFLayerTreeHost::create): Added. Simple creator.
+        (WebCore::CACFLayerTreeHost::create): Now instantiates a LegacyCACFLayerTreeHost. Calls the
+        new initialize function to perform initialization that has to happen after the vtable has
+        been set up.
+
+        (WebCore::LegacyCACFLayerTreeHost::LegacyCACFLayerTreeHost):
+        (WebCore::CACFLayerTreeHost::CACFLayerTreeHost):
+        (WebCore::LegacyCACFLayerTreeHost::initializeContext):
+        (WebCore::CACFLayerTreeHost::initialize):
+        Moved some initialization code from the CACFLayerTreeHost constructor into these new
+        functions.
+
+        (WebCore::LegacyCACFLayerTreeHost::~LegacyCACFLayerTreeHost): Added. Moved code here from
+        ~CACFLayerTreeHost.
+        (WebCore::CACFLayerTreeHost::~CACFLayerTreeHost): Rather than clearing the window at this
+        point (which would be too late, since we won't be able to call into the derived class's
+        virtual functions), just assert that it has already been cleared (or was never set in the
+        first place).
+        (WebCore::LegacyCACFLayerTreeHost::createRenderer): Renamed from
+        CACFLayerTreeHost::createRenderer, and changed to use getters instead of accessing
+        CACFLayerTreeHost's data members directly.
+
+        (WebCore::LegacyCACFLayerTreeHost::destroyRenderer):
+        (WebCore::CACFLayerTreeHost::destroyRenderer):
+        Moved some code to the new LegacyCACFLayerTreeHost function.
+
+        (WebCore::LegacyCACFLayerTreeHost::resize):
+        (WebCore::LegacyCACFLayerTreeHost::renderTimerFired):
+        Moved these functions to LegacyCACFLayerTreeHost.
+
+        (WebCore::LegacyCACFLayerTreeHost::paint):
+        (WebCore::CACFLayerTreeHost::paint):
+        Moved some code to the new LegacyCACFLayerTreeHost function.
+
+        (WebCore::LegacyCACFLayerTreeHost::render):
+        (WebCore::LegacyCACFLayerTreeHost::renderSoon):
+        Moved these functions to LegacyCACFLayerTreeHost.
+
+        (WebCore::CACFLayerTreeHost::flushPendingLayerChangesNow): Moved code to flush the context
+        from here...
+        (WebCore::LegacyCACFLayerTreeHost::flushContext): ...to this new function.
+
+        (WebCore::LegacyCACFLayerTreeHost::lastCommitTime): Moved code to get the last commit time
+        to this new function...
+        (WebCore::CACFLayerTreeHost::notifyAnimationsStarted): ...from here.
+
+        (WebCore::LegacyCACFLayerTreeHost::initD3DGeometry):
+        (WebCore::LegacyCACFLayerTreeHost::resetDevice):
+        Moved these functions to LegacyCACFLayerTreeHost.
+
+        * platform/graphics/ca/win/CACFLayerTreeHost.h: Made some functions virtual, removed some
+        members that have moved to LegacyCACFLayerTreeHost, grouped remaining members more
+        logically, and added some getters used by LegacyCACFLayerTreeHost.
+
+2011-01-27  Adam Roben  <aroben at apple.com>
+
         Move CACFLayerTreeHostClient to its own header file
 
         Rubber-stamped by Steve Falkenburg.
diff --git a/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp b/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
index 5e38af7..ba032d1 100644
--- a/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
+++ b/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
@@ -169,34 +169,102 @@ bool CACFLayerTreeHost::acceleratedCompositingAvailable()
     RefPtr<CACFLayerTreeHost> host = CACFLayerTreeHost::create();
     host->setWindow(testWindow);
     available = host->createRenderer();
+    host->setWindow(0);
     ::DestroyWindow(testWindow);
 
     return available;
 }
 
+// FIXME: Currently there is a LegacyCACFLayerTreeHost for each WebView and each
+// has its own WKCACFContext and Direct3DDevice9, which is inefficient.
+// (https://bugs.webkit.org/show_bug.cgi?id=31855)
+class LegacyCACFLayerTreeHost : public CACFLayerTreeHost {
+public:
+    static PassRefPtr<LegacyCACFLayerTreeHost> create();
+    virtual ~LegacyCACFLayerTreeHost();
+
+private:
+    LegacyCACFLayerTreeHost();
+
+    void initD3DGeometry();
+
+    // Call this when the device window has changed size or when IDirect3DDevice9::Present returns
+    // D3DERR_DEVICELOST. Returns true if the device was recovered, false if rendering must be
+    // aborted and reattempted soon.
+    enum ResetReason { ChangedWindowSize, LostDevice };
+    bool resetDevice(ResetReason);
+
+    void renderSoon();
+    void renderTimerFired(Timer<LegacyCACFLayerTreeHost>*);
+
+    virtual void initializeContext(void* userData, PlatformCALayer*);
+    virtual void resize();
+    virtual bool createRenderer();
+    virtual void destroyRenderer();
+    virtual CFTimeInterval lastCommitTime() const;
+    virtual void flushContext();
+    virtual void paint();
+    virtual void render(const Vector<CGRect>& dirtyRects = Vector<CGRect>());
+
+    Timer<LegacyCACFLayerTreeHost> m_renderTimer;
+    COMPtr<IDirect3DDevice9> m_d3dDevice;
+    WKCACFContext* m_context;
+    bool m_mightBeAbleToCreateDeviceLater;
+    bool m_mustResetLostDeviceBeforeRendering;
+
+#ifndef NDEBUG
+    bool m_printTree;
+#endif
+};
+
+PassRefPtr<LegacyCACFLayerTreeHost> LegacyCACFLayerTreeHost::create()
+{
+    return adoptRef(new LegacyCACFLayerTreeHost);
+}
+
 PassRefPtr<CACFLayerTreeHost> CACFLayerTreeHost::create()
 {
     if (!acceleratedCompositingAvailable())
         return 0;
-    return adoptRef(new CACFLayerTreeHost());
+    RefPtr<CACFLayerTreeHost> host = LegacyCACFLayerTreeHost::create();
+    host->initialize();
+    return host.release();
+}
+
+LegacyCACFLayerTreeHost::LegacyCACFLayerTreeHost()
+    : m_renderTimer(this, &LegacyCACFLayerTreeHost::renderTimerFired)
+    , m_context(wkCACFContextCreate())
+    , m_mightBeAbleToCreateDeviceLater(true)
+    , m_mustResetLostDeviceBeforeRendering(false)
+{
+#ifndef NDEBUG
+    char* printTreeFlag = getenv("CA_PRINT_TREE");
+    m_printTree = printTreeFlag && atoi(printTreeFlag);
+#endif
 }
 
 CACFLayerTreeHost::CACFLayerTreeHost()
     : m_client(0)
-    , m_mightBeAbleToCreateDeviceLater(true)
     , m_rootLayer(PlatformCALayer::create(PlatformCALayer::LayerTypeRootLayer, 0))
-    , m_context(wkCACFContextCreate())
     , m_window(0)
-    , m_renderTimer(this, &CACFLayerTreeHost::renderTimerFired)
-    , m_mustResetLostDeviceBeforeRendering(false)
     , m_shouldFlushPendingGraphicsLayerChanges(false)
     , m_isFlushingLayerChanges(false)
 #if !ASSERT_DISABLED
     , m_state(WindowNotSet)
 #endif
 {
+}
+
+void LegacyCACFLayerTreeHost::initializeContext(void* userData, PlatformCALayer* layer)
+{
+    wkCACFContextSetUserData(m_context, userData);
+    wkCACFContextSetLayer(m_context, layer->platformLayer());
+}
+
+void CACFLayerTreeHost::initialize()
+{
     // Point the CACFContext to this
-    wkCACFContextSetUserData(m_context, this);
+    initializeContext(this, m_rootLayer.get());
 
     // Under the root layer, we have a clipping layer to clip the content,
     // that contains a scroll layer that we use for scrolling the content.
@@ -216,20 +284,16 @@ CACFLayerTreeHost::CACFLayerTreeHost()
     m_rootLayer->setBackgroundColor(debugColor);
     CGColorRelease(debugColor);
 #endif
+}
 
-    if (m_context)
-        wkCACFContextSetLayer(m_context, m_rootLayer->platformLayer());
-
-#ifndef NDEBUG
-    char* printTreeFlag = getenv("CA_PRINT_TREE");
-    m_printTree = printTreeFlag && atoi(printTreeFlag);
-#endif
+LegacyCACFLayerTreeHost::~LegacyCACFLayerTreeHost()
+{
+    wkCACFContextDestroy(m_context);
 }
 
 CACFLayerTreeHost::~CACFLayerTreeHost()
 {
-    setWindow(0);
-    wkCACFContextDestroy(m_context);
+    ASSERT_WITH_MESSAGE(m_state != WindowSet, "Must call setWindow(0) before destroying CACFLayerTreeHost");
 }
 
 void CACFLayerTreeHost::setWindow(HWND window)
@@ -294,7 +358,7 @@ void CACFLayerTreeHost::layerTreeDidChange()
     LayerChangesFlusher::shared().flushPendingLayerChangesSoon(this);
 }
 
-bool CACFLayerTreeHost::createRenderer()
+bool LegacyCACFLayerTreeHost::createRenderer()
 {
     if (m_d3dDevice || !m_mightBeAbleToCreateDeviceLater)
         return m_d3dDevice;
@@ -302,14 +366,14 @@ bool CACFLayerTreeHost::createRenderer()
     m_mightBeAbleToCreateDeviceLater = false;
     D3DPRESENT_PARAMETERS parameters = initialPresentationParameters();
 
-    if (!d3d() || !::IsWindow(m_window))
+    if (!d3d() || !::IsWindow(window()))
         return false;
 
     // D3D doesn't like to make back buffers for 0 size windows. We skirt this problem if we make the
     // passed backbuffer width and height non-zero. The window will necessarily get set to a non-zero
     // size eventually, and then the backbuffer size will get reset.
     RECT rect;
-    GetClientRect(m_window, &rect);
+    GetClientRect(window(), &rect);
 
     if (rect.left-rect.right == 0 || rect.bottom-rect.top == 0) {
         parameters.BackBufferWidth = 1;
@@ -327,7 +391,7 @@ bool CACFLayerTreeHost::createRenderer()
         behaviorFlags |= D3DCREATE_SOFTWARE_VERTEXPROCESSING;
 
     COMPtr<IDirect3DDevice9> device;
-    if (FAILED(d3d()->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, m_window, behaviorFlags, &parameters, &device))) {
+    if (FAILED(d3d()->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window(), behaviorFlags, &parameters, &device))) {
         // In certain situations (e.g., shortly after waking from sleep), Direct3DCreate9() will
         // return an IDirect3D9 for which IDirect3D9::CreateDevice will always fail. In case we
         // have one of these bad IDirect3D9s, get rid of it so we'll fetch a new one the next time
@@ -360,18 +424,16 @@ bool CACFLayerTreeHost::createRenderer()
 
     wkCACFContextSetD3DDevice(m_context, m_d3dDevice.get());
 
-    if (IsWindow(m_window)) {
-        m_rootLayer->setBounds(bounds());
+    if (IsWindow(window())) {
+        rootLayer()->setBounds(bounds());
         wkCACFContextFlush(m_context);
     }
 
     return true;
 }
 
-void CACFLayerTreeHost::destroyRenderer()
+void LegacyCACFLayerTreeHost::destroyRenderer()
 {
-    LayerChangesFlusher::shared().cancelPendingFlush(this);
-
     wkCACFContextSetLayer(m_context, 0);
 
     wkCACFContextSetD3DDevice(m_context, 0);
@@ -380,13 +442,19 @@ void CACFLayerTreeHost::destroyRenderer()
         s_d3d->Release();
 
     s_d3d = 0;
+    m_mightBeAbleToCreateDeviceLater = true;
+
+    CACFLayerTreeHost::destroyRenderer();
+}
+
+void CACFLayerTreeHost::destroyRenderer()
+{
     m_rootLayer = 0;
     m_rootChildLayer = 0;
-
-    m_mightBeAbleToCreateDeviceLater = true;
+    LayerChangesFlusher::shared().cancelPendingFlush(this);
 }
 
-void CACFLayerTreeHost::resize()
+void LegacyCACFLayerTreeHost::resize()
 {
     if (!m_d3dDevice)
         return;
@@ -395,8 +463,8 @@ void CACFLayerTreeHost::resize()
     // reset the device the next time we try to render.
     resetDevice(ChangedWindowSize);
 
-    if (m_rootLayer) {
-        m_rootLayer->setBounds(bounds());
+    if (rootLayer()) {
+        rootLayer()->setBounds(bounds());
         wkCACFContextFlush(m_context);
     }
 }
@@ -431,12 +499,12 @@ static void getDirtyRects(HWND window, Vector<CGRect>& outRects)
         outRects[i] = winRectToCGRect(*rect, clientRect);
 }
 
-void CACFLayerTreeHost::renderTimerFired(Timer<CACFLayerTreeHost>*)
+void LegacyCACFLayerTreeHost::renderTimerFired(Timer<LegacyCACFLayerTreeHost>*)
 {
     paint();
 }
 
-void CACFLayerTreeHost::paint()
+void LegacyCACFLayerTreeHost::paint()
 {
     createRenderer();
     if (!m_d3dDevice) {
@@ -445,12 +513,17 @@ void CACFLayerTreeHost::paint()
         return;
     }
 
+    CACFLayerTreeHost::paint();
+}
+
+void CACFLayerTreeHost::paint()
+{
     Vector<CGRect> dirtyRects;
     getDirtyRects(m_window, dirtyRects);
     render(dirtyRects);
 }
 
-void CACFLayerTreeHost::render(const Vector<CGRect>& windowDirtyRects)
+void LegacyCACFLayerTreeHost::render(const Vector<CGRect>& windowDirtyRects)
 {
     ASSERT(m_d3dDevice);
 
@@ -517,7 +590,7 @@ void CACFLayerTreeHost::render(const Vector<CGRect>& windowDirtyRects)
 
 #ifndef NDEBUG
     if (m_printTree)
-        m_rootLayer->printTree();
+        rootLayer()->printTree();
 #endif
 
     // If timeToNextRender is not infinity, it means animations are running, so queue up to render again
@@ -525,7 +598,7 @@ void CACFLayerTreeHost::render(const Vector<CGRect>& windowDirtyRects)
         renderSoon();
 }
 
-void CACFLayerTreeHost::renderSoon()
+void LegacyCACFLayerTreeHost::renderSoon()
 {
     if (!m_renderTimer.isActive())
         m_renderTimer.startOneShot(0);
@@ -552,9 +625,7 @@ void CACFLayerTreeHost::flushPendingLayerChangesNow()
     }
 
     // Flush changes stored up in PlatformCALayers to the context so they will be rendered.
-    wkCACFContextFlush(m_context);
-
-    renderSoon();
+    flushContext();
 
     // All pending animations will have been started with the flush. Fire the animationStarted calls.
     notifyAnimationsStarted();
@@ -562,10 +633,21 @@ void CACFLayerTreeHost::flushPendingLayerChangesNow()
     m_isFlushingLayerChanges = false;
 }
 
+void LegacyCACFLayerTreeHost::flushContext()
+{
+    wkCACFContextFlush(m_context);
+    renderSoon();
+}
+
+CFTimeInterval LegacyCACFLayerTreeHost::lastCommitTime() const
+{
+    return wkCACFContextGetLastCommitTime(m_context);
+}
+
 void CACFLayerTreeHost::notifyAnimationsStarted()
 {
     double currentTime = WTF::currentTime();
-    double time = currentTime + wkCACFContextGetLastCommitTime(m_context) - CACurrentMediaTime();
+    double time = currentTime + lastCommitTime() - CACurrentMediaTime();
     ASSERT(time <= currentTime);
 
     HashSet<RefPtr<PlatformCALayer> >::iterator end = m_pendingAnimatedLayers.end();
@@ -583,7 +665,7 @@ CGRect CACFLayerTreeHost::bounds() const
     return winRectToCGRect(clientRect);
 }
 
-void CACFLayerTreeHost::initD3DGeometry()
+void LegacyCACFLayerTreeHost::initD3DGeometry()
 {
     ASSERT(m_d3dDevice);
 
@@ -600,7 +682,7 @@ void CACFLayerTreeHost::initD3DGeometry()
     m_d3dDevice->SetTransform(D3DTS_PROJECTION, &projection);
 }
 
-bool CACFLayerTreeHost::resetDevice(ResetReason reason)
+bool LegacyCACFLayerTreeHost::resetDevice(ResetReason reason)
 {
     ASSERT(m_d3dDevice);
     ASSERT(m_context);
diff --git a/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h b/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h
index 443482c..395e1fb 100644
--- a/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h
+++ b/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h
@@ -50,69 +50,53 @@ namespace WebCore {
 class CACFLayerTreeHostClient;
 class PlatformCALayer;
 
-// FIXME: Currently there is a CACFLayerTreeHost for each WebView and each
-// has its own CARenderOGLContext and Direct3DDevice9, which is inefficient.
-// (https://bugs.webkit.org/show_bug.cgi?id=31855)
 class CACFLayerTreeHost : public RefCounted<CACFLayerTreeHost> {
     friend PlatformCALayer;
 
 public:
     static PassRefPtr<CACFLayerTreeHost> create();
-    ~CACFLayerTreeHost();
+    virtual ~CACFLayerTreeHost();
 
     static bool acceleratedCompositingAvailable();
 
     void setClient(CACFLayerTreeHostClient* client) { m_client = client; }
 
     void setRootChildLayer(PlatformCALayer*);
-    void layerTreeDidChange();
     void setWindow(HWND);
-    void paint();
-    void resize();
+    virtual void paint();
+    virtual void resize() = 0;
     void flushPendingGraphicsLayerChangesSoon();
     void flushPendingLayerChangesNow();
 
 protected:
-    PlatformCALayer* rootLayer() const;
-    void addPendingAnimatedLayer(PassRefPtr<PlatformCALayer>);
-
-private:
     CACFLayerTreeHost();
 
-    bool createRenderer();
-    void destroyRenderer();
-    void renderSoon();
-    void renderTimerFired(Timer<CACFLayerTreeHost>*);
-    void notifyAnimationsStarted();
-
     CGRect bounds() const;
+    PlatformCALayer* rootLayer() const;
+    HWND window() const { return m_window; }
+    void notifyAnimationsStarted();
 
-    void initD3DGeometry();
+    virtual bool createRenderer() = 0;
+    virtual void destroyRenderer();
 
-    // Call this when the device window has changed size or when IDirect3DDevice9::Present returns
-    // D3DERR_DEVICELOST. Returns true if the device was recovered, false if rendering must be
-    // aborted and reattempted soon.
-    enum ResetReason { ChangedWindowSize, LostDevice };
-    bool resetDevice(ResetReason);
+private:
+    void initialize();
+    void addPendingAnimatedLayer(PassRefPtr<PlatformCALayer>);
+    void layerTreeDidChange();
 
-    void render(const Vector<CGRect>& dirtyRects = Vector<CGRect>());
+    virtual void flushContext() = 0;
+    virtual CFTimeInterval lastCommitTime() const = 0;
+    virtual void render(const Vector<CGRect>& dirtyRects = Vector<CGRect>()) = 0;
+    virtual void initializeContext(void* userData, PlatformCALayer*) = 0;
 
     CACFLayerTreeHostClient* m_client;
-    bool m_mightBeAbleToCreateDeviceLater;
-    COMPtr<IDirect3DDevice9> m_d3dDevice;
     RefPtr<PlatformCALayer> m_rootLayer;
     RefPtr<PlatformCALayer> m_rootChildLayer;
-    WKCACFContext* m_context;
+    HashSet<RefPtr<PlatformCALayer> > m_pendingAnimatedLayers;
     HWND m_window;
-    Timer<CACFLayerTreeHost> m_renderTimer;
-    bool m_mustResetLostDeviceBeforeRendering;
     bool m_shouldFlushPendingGraphicsLayerChanges;
     bool m_isFlushingLayerChanges;
-    HashSet<RefPtr<PlatformCALayer> > m_pendingAnimatedLayers;
 
-#ifndef NDEBUG
-    bool m_printTree;
-#endif
 #if !ASSERT_DISABLED
     enum { WindowNotSet, WindowSet, WindowCleared } m_state;
 #endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list