Changeset 82675 in webkit


Ignore:
Timestamp:
Apr 1, 2011 6:26:52 AM (13 years ago)
Author:
Adam Roben
Message:

Split LayerTreeHostCA into a base class and derived Mac and Win classes

This will make it easier to customize the Mac and Windows implementations without adding too
many #ifdefs.

Fixes <http://webkit.org/b/57606> Windows and Mac should use separate LayerTreeHost classes

Reviewed by Anders Carlsson.

  • WebKit2.xcodeproj/project.pbxproj: Added LayerTreeHostCAMac.h.
  • WebProcess/WebPage/LayerTreeHost.cpp:

(WebKit::LayerTreeHost::create): Create a LayerTreeHostCAMac on Mac, and LayerTreeHostCAWin
on Windows.

  • WebProcess/WebPage/ca/LayerTreeHostCA.cpp:

(WebKit::LayerTreeHostCA::LayerTreeHostCA): Moved some code from here...
(WebKit::LayerTreeHostCA::initialize): ...to here. This function will be called after the
constructor returns, and thus can safely call functions that are pure virtual in this class
and its base class. We now pass our LayerTreeContext to platformInitialize so that our
derived classes can initialize it.
(WebKit::LayerTreeHostCA::~LayerTreeHostCA): Removed Mac-specific code.

(WebKit::LayerTreeHostCA::invalidate):
(WebKit::LayerTreeHostCA::sizeDidChange):
(WebKit::LayerTreeHostCA::forceRepaint):
(WebKit::LayerTreeHostCA::didPerformScheduledLayerFlush):
Removed platform* calls. Derived classes can just override these functions to do what they
need.

  • WebProcess/WebPage/ca/LayerTreeHostCA.h: Removed Mac-specific pieces. Made some functions

virtual so that derived classes can override them.

  • WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h: Added.
  • WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:

(WebKit::LayerTreeHostCAMac::create): Create and initialize a host.
(WebKit::LayerTreeHostCAMac::LayerTreeHostCAMac): Simple constructor.
(WebKit::LayerTreeHostCAMac::~LayerTreeHostCAMac): Moved code here from LayerTreeHostCA
destructor.
(WebKit::LayerTreeHostCAMac::platformInitialize): Removed direct uses of LayerTreeHostCA
data members.

(WebKit::LayerTreeHostCAMac::invalidate):
(WebKit::LayerTreeHostCAMac::sizeDidChange):
(WebKit::LayerTreeHostCAMac::forceRepaint):
(WebKit::LayerTreeHostCAMac::didPerformScheduledLayerFlush):
Renamed from platform*. Now call up to the base class.

(WebKit::LayerTreeHostCAMac::flushPendingLayerChangesRunLoopObserverCallback): Updated type.

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

(WebKit::LayerTreeHostCAWin::create): Create and initialize a host.

(WebKit::LayerTreeHostCAWin::LayerTreeHostCAWin):
(WebKit::LayerTreeHostCAWin::~LayerTreeHostCAWin):
(WebKit::LayerTreeHostCAWin::platformInitialize):
(WebKit::LayerTreeHostCAWin::scheduleLayerFlush):
Stubbed out.

  • WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h: Added.
  • win/WebKit2.vcproj: Added LayerTreeHostCAWin.h
  • win/WebKit2Apple.vsprops: Added WebProcess/WebPage/ca/win to the include path.
Location:
trunk/Source/WebKit2
Files:
9 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r82660 r82675  
     12011-03-31  Adam Roben  <aroben@apple.com>
     2
     3        Split LayerTreeHostCA into a base class and derived Mac and Win classes
     4
     5        This will make it easier to customize the Mac and Windows implementations without adding too
     6        many #ifdefs.
     7
     8        Fixes <http://webkit.org/b/57606> Windows and Mac should use separate LayerTreeHost classes
     9
     10        Reviewed by Anders Carlsson.
     11
     12        * WebKit2.xcodeproj/project.pbxproj: Added LayerTreeHostCAMac.h.
     13
     14        * WebProcess/WebPage/LayerTreeHost.cpp:
     15        (WebKit::LayerTreeHost::create): Create a LayerTreeHostCAMac on Mac, and LayerTreeHostCAWin
     16        on Windows.
     17
     18        * WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
     19        (WebKit::LayerTreeHostCA::LayerTreeHostCA): Moved some code from here...
     20        (WebKit::LayerTreeHostCA::initialize): ...to here. This function will be called after the
     21        constructor returns, and thus can safely call functions that are pure virtual in this class
     22        and its base class. We now pass our LayerTreeContext to platformInitialize so that our
     23        derived classes can initialize it.
     24        (WebKit::LayerTreeHostCA::~LayerTreeHostCA): Removed Mac-specific code.
     25
     26        (WebKit::LayerTreeHostCA::invalidate):
     27        (WebKit::LayerTreeHostCA::sizeDidChange):
     28        (WebKit::LayerTreeHostCA::forceRepaint):
     29        (WebKit::LayerTreeHostCA::didPerformScheduledLayerFlush):
     30        Removed platform* calls. Derived classes can just override these functions to do what they
     31        need.
     32
     33        * WebProcess/WebPage/ca/LayerTreeHostCA.h: Removed Mac-specific pieces. Made some functions
     34        virtual so that derived classes can override them.
     35
     36        * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h: Added.
     37
     38        * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:
     39        (WebKit::LayerTreeHostCAMac::create): Create and initialize a host.
     40        (WebKit::LayerTreeHostCAMac::LayerTreeHostCAMac): Simple constructor.
     41        (WebKit::LayerTreeHostCAMac::~LayerTreeHostCAMac): Moved code here from LayerTreeHostCA
     42        destructor.
     43        (WebKit::LayerTreeHostCAMac::platformInitialize): Removed direct uses of LayerTreeHostCA
     44        data members.
     45
     46        (WebKit::LayerTreeHostCAMac::invalidate):
     47        (WebKit::LayerTreeHostCAMac::sizeDidChange):
     48        (WebKit::LayerTreeHostCAMac::forceRepaint):
     49        (WebKit::LayerTreeHostCAMac::didPerformScheduledLayerFlush):
     50        Renamed from platform*. Now call up to the base class.
     51
     52        (WebKit::LayerTreeHostCAMac::flushPendingLayerChangesRunLoopObserverCallback): Updated type.
     53
     54        * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
     55        (WebKit::LayerTreeHostCAWin::create): Create and initialize a host.
     56
     57        (WebKit::LayerTreeHostCAWin::LayerTreeHostCAWin):
     58        (WebKit::LayerTreeHostCAWin::~LayerTreeHostCAWin):
     59        (WebKit::LayerTreeHostCAWin::platformInitialize):
     60        (WebKit::LayerTreeHostCAWin::scheduleLayerFlush):
     61        Stubbed out.
     62
     63        * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h: Added.
     64
     65        * win/WebKit2.vcproj: Added LayerTreeHostCAWin.h
     66
     67        * win/WebKit2Apple.vsprops: Added WebProcess/WebPage/ca/win to the include path.
     68
    1692011-03-31  Brent Fulgham  <bfulgham@webkit.org>
    270
  • trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r82465 r82675  
    763763                C0E3AA7B1209E83500A49D01 /* Module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0E3AA451209E2BA00A49D01 /* Module.cpp */; };
    764764                C0E3AA7C1209E83C00A49D01 /* Module.h in Headers */ = {isa = PBXBuildFile; fileRef = C0E3AA441209E2BA00A49D01 /* Module.h */; };
     765                C0FA52431345694A0028E8C2 /* LayerTreeHostCAMac.h in Headers */ = {isa = PBXBuildFile; fileRef = C0FA52421345694A0028E8C2 /* LayerTreeHostCAMac.h */; };
    765766                C517388112DF8F4F00EE3F47 /* DragControllerAction.h in Headers */ = {isa = PBXBuildFile; fileRef = C517388012DF8F4F00EE3F47 /* DragControllerAction.h */; };
    766767                C5237F6012441CA300780472 /* WebEditorClientMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C5237F5F12441CA300780472 /* WebEditorClientMac.mm */; };
     
    16721673                C0E3AA451209E2BA00A49D01 /* Module.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Module.cpp; sourceTree = "<group>"; };
    16731674                C0E3AA481209E45000A49D01 /* ModuleMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ModuleMac.mm; sourceTree = "<group>"; };
     1675                C0FA52421345694A0028E8C2 /* LayerTreeHostCAMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerTreeHostCAMac.h; sourceTree = "<group>"; };
    16741676                C517388012DF8F4F00EE3F47 /* DragControllerAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragControllerAction.h; sourceTree = "<group>"; };
    16751677                C5237F5F12441CA300780472 /* WebEditorClientMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEditorClientMac.mm; sourceTree = "<group>"; };
     
    31093111                        isa = PBXGroup;
    31103112                        children = (
     3113                                C0FA52421345694A0028E8C2 /* LayerTreeHostCAMac.h */,
    31113114                                C03A136B133BEBF900D767D1 /* LayerTreeHostCAMac.mm */,
    31123115                        );
     
    36523655                                5110AE0D133C16CB0072717A /* WKIconDatabase.h in Headers */,
    36533656                                5123CF1C133D260A0056F800 /* WKIconDatabaseCG.h in Headers */,
     3657                                C0FA52431345694A0028E8C2 /* LayerTreeHostCAMac.h in Headers */,
    36543658                        );
    36553659                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp

    r81902 r82675  
    2828
    2929#if PLATFORM(MAC)
    30 #include "LayerTreeHostCA.h"
    31 #endif
    32 
    33 #if !PLATFORM(MAC) && !PLATFORM(WIN)
     30#include "LayerTreeHostCAMac.h"
     31#elif PLATFORM(WIN)
     32#include "LayerTreeHostCAWin.h"
     33#else
    3434#error "This class is not ready for use by other ports yet."
    3535#endif
     
    4242{
    4343#if PLATFORM(MAC)
    44     return LayerTreeHostCA::create(webPage);
     44    return LayerTreeHostCAMac::create(webPage);
     45#elif PLATFORM(WIN)
     46    return LayerTreeHostCAWin::create(webPage);
    4547#endif
    46 
    47     return 0;
    4848}
    4949
  • trunk/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp

    r81903 r82675  
    3939namespace WebKit {
    4040
    41 PassRefPtr<LayerTreeHostCA> LayerTreeHostCA::create(WebPage* webPage)
    42 {
    43     return adoptRef(new LayerTreeHostCA(webPage));
    44 }
    45 
    4641LayerTreeHostCA::LayerTreeHostCA(WebPage* webPage)
    4742    : LayerTreeHost(webPage)
     
    4944    , m_notifyAfterScheduledLayerFlush(false)
    5045{
    51 
     46}
     47
     48void LayerTreeHostCA::initialize()
     49{
    5250    // Create a root layer.
    5351    m_rootLayer = GraphicsLayer::create(this);
     
    5654#endif
    5755    m_rootLayer->setDrawsContent(false);
    58     m_rootLayer->setSize(webPage->size());
     56    m_rootLayer->setSize(m_webPage->size());
    5957
    6058    m_nonCompositedContentLayer = GraphicsLayer::create(this);
     
    6462    m_nonCompositedContentLayer->setDrawsContent(true);
    6563    m_nonCompositedContentLayer->setContentsOpaque(m_webPage->drawsBackground() && !m_webPage->drawsTransparentBackground());
    66     m_nonCompositedContentLayer->setSize(webPage->size());
     64    m_nonCompositedContentLayer->setSize(m_webPage->size());
    6765    if (m_webPage->corePage()->settings()->acceleratedDrawingEnabled())
    6866        m_nonCompositedContentLayer->setAcceleratesDrawing(true);
     
    7371        createPageOverlayLayer();
    7472
    75     platformInitialize();
     73    platformInitialize(m_layerTreeContext);
    7674
    7775    scheduleLayerFlush();
     
    8280    ASSERT(!m_isValid);
    8381    ASSERT(!m_rootLayer);
    84 #if PLATFORM(MAC)
    85     ASSERT(!m_flushPendingLayerChangesRunLoopObserver);
    86     ASSERT(!m_remoteLayerClient);
    87 #endif
    8882}
    8983
     
    110104{
    111105    ASSERT(m_isValid);
    112     platformInvalidate();
    113106    m_rootLayer = nullptr;
    114107    m_isValid = false;
     
    139132    scheduleLayerFlush();
    140133    flushPendingLayerChanges();
    141 
    142     platformSizeDidChange();
    143134}
    144135
     
    147138    scheduleLayerFlush();
    148139    flushPendingLayerChanges();
    149 
    150     platformForceRepaint();
    151140}   
    152141
     
    219208void LayerTreeHostCA::didPerformScheduledLayerFlush()
    220209{
    221     platformDidPerformScheduledLayerFlush();
    222 
    223210    if (m_notifyAfterScheduledLayerFlush) {
    224211        // Let the drawing area know that we've done a flush of the layer changes.
  • trunk/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h

    r81903 r82675  
    3232#include <wtf/OwnPtr.h>
    3333
    34 #if PLATFORM(MAC)
    35 #include <wtf/RetainPtr.h>
    36 #endif
    37 
    38 #if PLATFORM(MAC)
    39 typedef struct __WKCARemoteLayerClientRef* WKCARemoteLayerClientRef;
    40 #endif
    41 
    4234namespace WebKit {
    4335
    4436class LayerTreeHostCA : public LayerTreeHost, WebCore::GraphicsLayerClient {
    4537public:
    46     static PassRefPtr<LayerTreeHostCA> create(WebPage*);
    47     ~LayerTreeHostCA();
     38    virtual ~LayerTreeHostCA();
    4839   
    49 private:
     40protected:
    5041    explicit LayerTreeHostCA(WebPage*);
    5142
     43    WebCore::GraphicsLayer* rootLayer() const { return m_rootLayer.get(); }
     44
     45    void initialize();
     46    void performScheduledLayerFlush();
     47
     48    // LayerTreeHost.
     49    virtual void invalidate();
     50    virtual void sizeDidChange(const WebCore::IntSize& newSize);
     51    virtual void forceRepaint();
     52
     53    // LayerTreeHostCA
     54    virtual void didPerformScheduledLayerFlush();
     55
     56private:
    5257    // LayerTreeHost.
    5358    virtual const LayerTreeContext& layerTreeContext();
    54     virtual void scheduleLayerFlush();
    5559    virtual void setShouldNotifyAfterNextScheduledLayerFlush(bool);
    5660    virtual void setRootCompositingLayer(WebCore::GraphicsLayer*);
    57     virtual void invalidate();
    5861
    5962    virtual void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&);
    6063    virtual void scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
    61     virtual void sizeDidChange(const WebCore::IntSize& newSize);
    62     virtual void forceRepaint();
    6364
    6465    virtual void didInstallPageOverlay();
     
    7374    virtual bool showRepaintCounter() const;
    7475
    75     void platformInitialize();
    76     void platformInvalidate();
    77     void platformSizeDidChange();
    78     void platformForceRepaint();
     76    // LayerTreeHostCA
     77    virtual void platformInitialize(LayerTreeContext&) = 0;
    7978
    80     void performScheduledLayerFlush();
    81     void didPerformScheduledLayerFlush();
    82     void platformDidPerformScheduledLayerFlush();
    8379    bool flushPendingLayerChanges();
    8480
    8581    void createPageOverlayLayer();
    8682    void destroyPageOverlayLayer();
    87 
    88 #if PLATFORM(MAC)
    89     static void flushPendingLayerChangesRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void*);
    90 #endif
    9183
    9284    // The context for this layer tree.
     
    108100    // The page overlay layer. Will be null if there's no page overlay.
    109101    OwnPtr<WebCore::GraphicsLayer> m_pageOverlayLayer;
    110 
    111 #if PLATFORM(MAC)
    112     RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient;
    113     RetainPtr<CFRunLoopObserverRef> m_flushPendingLayerChangesRunLoopObserver;
    114 #endif
    115102};
    116103
  • trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h

    r82673 r82675  
    2424 */
    2525
    26 #include "config.h"
     26#ifndef LayerTreeHostCAMac_h
     27#define LayerTreeHostCAMac_h
     28
    2729#include "LayerTreeHostCA.h"
     30#include <wtf/RetainPtr.h>
    2831
    29 #include <WebCore/NotImplemented.h>
     32typedef struct __WKCARemoteLayerClientRef* WKCARemoteLayerClientRef;
    3033
    3134namespace WebKit {
    3235
    33 void LayerTreeHostCA::platformInitialize()
    34 {
    35     // FIXME: <http://webkit.org/b/45567> Implement this!
    36     notImplemented();
    37 }
     36class LayerTreeHostCAMac : public LayerTreeHostCA {
     37public:
     38    static PassRefPtr<LayerTreeHostCAMac> create(WebPage*);
     39    virtual ~LayerTreeHostCAMac();
    3840
    39 void LayerTreeHostCA::scheduleLayerFlush()
    40 {
    41     // FIXME: <http://webkit.org/b/45567> Implement this!
    42     notImplemented();
    43 }
     41private:
     42    explicit LayerTreeHostCAMac(WebPage*);
    4443
    45 void LayerTreeHostCA::platformInvalidate()
    46 {
    47     // FIXME: <http://webkit.org/b/45567> Implement this!
    48     notImplemented();
    49 }
     44    // LayerTreeHost.
     45    virtual void scheduleLayerFlush();
     46    virtual void invalidate();
     47    virtual void sizeDidChange(const WebCore::IntSize& newSize);
     48    virtual void forceRepaint();
    5049
    51 void LayerTreeHostCA::platformSizeDidChange()
    52 {
    53     // FIXME: <http://webkit.org/b/45567> Implement this!
    54     notImplemented();
    55 }
     50    // LayerTreeHostCA
     51    virtual void platformInitialize(LayerTreeContext&);
     52    virtual void didPerformScheduledLayerFlush();
    5653
    57 void LayerTreeHostCA::platformForceRepaint()
    58 {
    59     // FIXME: <http://webkit.org/b/45567> Implement this!
    60     notImplemented();
    61 }
     54    static void flushPendingLayerChangesRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void*);
    6255
    63 void LayerTreeHostCA::platformDidPerformScheduledLayerFlush()
    64 {
    65     // FIXME: <http://webkit.org/b/45567> Implement this!
    66     notImplemented();
    67 }
     56    RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient;
     57    RetainPtr<CFRunLoopObserverRef> m_flushPendingLayerChangesRunLoopObserver;
     58};
    6859
    6960} // namespace WebKit
     61
     62#endif // LayerTreeHostCAMac_h
  • trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm

    r81903 r82675  
    2525
    2626#import "config.h"
    27 #import "LayerTreeHostCA.h"
     27#import "LayerTreeHostCAMac.h"
    2828
    2929#import "WebProcess.h"
     
    3131#import <WebCore/GraphicsLayer.h>
    3232#import <WebKitSystemInterface.h>
     33
     34using namespace WebCore;
    3335
    3436@interface CATransaction (Details)
     
    3840namespace WebKit {
    3941
    40 void LayerTreeHostCA::platformInitialize()
     42PassRefPtr<LayerTreeHostCAMac> LayerTreeHostCAMac::create(WebPage* webPage)
     43{
     44    RefPtr<LayerTreeHostCAMac> host = adoptRef(new LayerTreeHostCAMac(webPage));
     45    host->initialize();
     46    return host.release();
     47}
     48
     49LayerTreeHostCAMac::LayerTreeHostCAMac(WebPage* webPage)
     50    : LayerTreeHostCA(webPage)
     51{
     52}
     53
     54LayerTreeHostCAMac::~LayerTreeHostCAMac()
     55{
     56    ASSERT(!m_flushPendingLayerChangesRunLoopObserver);
     57    ASSERT(!m_remoteLayerClient);
     58}
     59
     60void LayerTreeHostCAMac::platformInitialize(LayerTreeContext& layerTreeContext)
    4161{
    4262    mach_port_t serverPort = WebProcess::shared().compositingRenderServerPort();
    4363    m_remoteLayerClient = WKCARemoteLayerClientMakeWithServerPort(serverPort);
    4464
    45     [m_rootLayer->platformLayer() setGeometryFlipped:YES];
     65    [rootLayer()->platformLayer() setGeometryFlipped:YES];
    4666
    47     WKCARemoteLayerClientSetLayer(m_remoteLayerClient.get(), m_rootLayer->platformLayer());
     67    WKCARemoteLayerClientSetLayer(m_remoteLayerClient.get(), rootLayer()->platformLayer());
    4868
    49     m_layerTreeContext.contextID = WKCARemoteLayerClientGetClientId(m_remoteLayerClient.get());
     69    layerTreeContext.contextID = WKCARemoteLayerClientGetClientId(m_remoteLayerClient.get());
    5070}
    5171
    52 void LayerTreeHostCA::scheduleLayerFlush()
     72void LayerTreeHostCAMac::scheduleLayerFlush()
    5373{
    5474    CFRunLoopRef currentRunLoop = CFRunLoopGetCurrent();
     
    6888}
    6989
    70 void LayerTreeHostCA::platformInvalidate()
     90void LayerTreeHostCAMac::invalidate()
    7191{
    7292    if (m_flushPendingLayerChangesRunLoopObserver) {
     
    7797    WKCARemoteLayerClientInvalidate(m_remoteLayerClient.get());
    7898    m_remoteLayerClient = nullptr;
     99
     100    LayerTreeHostCA::invalidate();
    79101}
    80102
    81 void LayerTreeHostCA::platformSizeDidChange()
     103void LayerTreeHostCAMac::sizeDidChange(const IntSize& newSize)
    82104{
     105    LayerTreeHostCA::sizeDidChange(newSize);
    83106    [CATransaction flush];
    84107    [CATransaction synchronize];
    85108}
    86109
    87 void LayerTreeHostCA::platformForceRepaint()
     110void LayerTreeHostCAMac::forceRepaint()
    88111{
     112    LayerTreeHostCA::forceRepaint();
    89113    [CATransaction flush];
    90114    [CATransaction synchronize];
    91115}   
    92116
    93 void LayerTreeHostCA::flushPendingLayerChangesRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void* context)
     117void LayerTreeHostCAMac::flushPendingLayerChangesRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void* context)
    94118{
    95119    // This gets called outside of the normal event loop so wrap in an autorelease pool
    96120    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    97     static_cast<LayerTreeHostCA*>(context)->performScheduledLayerFlush();
     121    static_cast<LayerTreeHostCAMac*>(context)->performScheduledLayerFlush();
    98122    [pool drain];
    99123}
    100124
    101 void LayerTreeHostCA::platformDidPerformScheduledLayerFlush()
     125void LayerTreeHostCAMac::didPerformScheduledLayerFlush()
    102126{
    103127    // We successfully flushed the pending layer changes, remove the run loop observer.
     
    105129    CFRunLoopObserverInvalidate(m_flushPendingLayerChangesRunLoopObserver.get());
    106130    m_flushPendingLayerChangesRunLoopObserver = 0;
     131
     132    LayerTreeHostCA::didPerformScheduledLayerFlush();
    107133}
    108134
  • trunk/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp

    r81912 r82675  
    2525
    2626#include "config.h"
    27 #include "LayerTreeHostCA.h"
     27#include "LayerTreeHostCAWin.h"
    2828
    2929#include <WebCore/NotImplemented.h>
     30#include <wtf/RefPtr.h>
    3031
    3132namespace WebKit {
    3233
    33 void LayerTreeHostCA::platformInitialize()
     34PassRefPtr<LayerTreeHostCAWin> LayerTreeHostCAWin::create(WebPage* webPage)
     35{
     36    RefPtr<LayerTreeHostCAWin> host = adoptRef(new LayerTreeHostCAWin(webPage));
     37    host->initialize();
     38    return host.release();
     39}
     40
     41LayerTreeHostCAWin::LayerTreeHostCAWin(WebPage* webPage)
     42    : LayerTreeHostCA(webPage)
     43{
     44}
     45
     46LayerTreeHostCAWin::~LayerTreeHostCAWin()
     47{
     48}
     49
     50void LayerTreeHostCAWin::platformInitialize(LayerTreeContext&)
    3451{
    3552    // FIXME: <http://webkit.org/b/45567> Implement this!
     
    3754}
    3855
    39 void LayerTreeHostCA::scheduleLayerFlush()
    40 {
    41     // FIXME: <http://webkit.org/b/45567> Implement this!
    42     notImplemented();
    43 }
    44 
    45 void LayerTreeHostCA::platformInvalidate()
    46 {
    47     // FIXME: <http://webkit.org/b/45567> Implement this!
    48     notImplemented();
    49 }
    50 
    51 void LayerTreeHostCA::platformSizeDidChange()
    52 {
    53     // FIXME: <http://webkit.org/b/45567> Implement this!
    54     notImplemented();
    55 }
    56 
    57 void LayerTreeHostCA::platformForceRepaint()
    58 {
    59     // FIXME: <http://webkit.org/b/45567> Implement this!
    60     notImplemented();
    61 }
    62 
    63 void LayerTreeHostCA::platformDidPerformScheduledLayerFlush()
     56void LayerTreeHostCAWin::scheduleLayerFlush()
    6457{
    6558    // FIXME: <http://webkit.org/b/45567> Implement this!
  • trunk/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h

    r82673 r82675  
    2424 */
    2525
    26 #include "config.h"
    27 #include "LayerTreeHost.h"
     26#ifndef LayerTreeHostCAWin_h
     27#define LayerTreeHostCAWin_h
    2828
    29 #if PLATFORM(MAC)
    3029#include "LayerTreeHostCA.h"
    31 #endif
    32 
    33 #if !PLATFORM(MAC) && !PLATFORM(WIN)
    34 #error "This class is not ready for use by other ports yet."
    35 #endif
    36 
    37 using namespace WebCore;
    3830
    3931namespace WebKit {
    4032
    41 PassRefPtr<LayerTreeHost> LayerTreeHost::create(WebPage* webPage)
    42 {
    43 #if PLATFORM(MAC)
    44     return LayerTreeHostCA::create(webPage);
    45 #endif
     33class LayerTreeHostCAWin : public LayerTreeHostCA {
     34public:
     35    static PassRefPtr<LayerTreeHostCAWin> create(WebPage*);
     36    virtual ~LayerTreeHostCAWin();
    4637
    47     return 0;
    48 }
     38private:
     39    explicit LayerTreeHostCAWin(WebPage*);
    4940
    50 LayerTreeHost::LayerTreeHost(WebPage* webPage)
    51     : m_webPage(webPage)
    52 {
    53 }
     41    // LayerTreeHost
     42    virtual void scheduleLayerFlush();
    5443
    55 LayerTreeHost::~LayerTreeHost()
    56 {
    57 }
     44    // LayerTreeHostCA
     45    virtual void platformInitialize(LayerTreeContext&);
     46};
    5847
    5948} // namespace WebKit
     49
     50#endif // LayerTreeHostCAWin_h
  • trunk/Source/WebKit2/win/WebKit2.vcproj

    r82477 r82675  
    19641964                                                        </FileConfiguration>
    19651965                                                </File>
     1966                                                <File
     1967                                                        RelativePath="..\WebProcess\WebPage\ca\win\LayerTreeHostCAWin.h"
     1968                                                        >
     1969                                                </File>
    19661970                                        </Filter>
    19671971                                </Filter>
  • trunk/Source/WebKit2/win/WebKit2Apple.vsprops

    r81912 r82675  
    77        <Tool
    88                Name="VCCLCompilerTool"
    9                 AdditionalIncludeDirectories="&quot;$(ProjectDir)..\WebProcess\WebPage\ca&quot;"
     9                AdditionalIncludeDirectories="&quot;$(ProjectDir)..\WebProcess\WebPage\ca&quot;;&quot;$(ProjectDir)..\WebProcess\WebPage\ca\win&quot;"
    1010        />
    1111        <Tool
Note: See TracChangeset for help on using the changeset viewer.