Changeset 77139 in webkit
- Timestamp:
- Jan 31, 2011 10:08:11 AM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r77104 r77139 1 2011-01-31 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Adam Roben. 4 5 Make LayerTreeHost an abstract base class and make LayerTreeHostMac inherit from it 6 https://bugs.webkit.org/show_bug.cgi?id=53432 7 8 * WebKit2.xcodeproj/project.pbxproj: 9 Add LayerTreeHostMac.h. 10 11 * WebProcess/WebPage/DrawingAreaImpl.cpp: 12 * WebProcess/WebPage/DrawingAreaImpl.h: 13 Make m_layerTreeHost an OwnPtr and initialize/destroy it appropriately. 14 15 * WebProcess/WebPage/LayerTreeHost.cpp: 16 (WebKit::LayerTreeHost::create): 17 On Mac, create a LayerTreeHostMac instance. 18 19 (WebKit::LayerTreeHost::~LayerTreeHost): 20 No need to call platformInvalidate anymore. 21 22 * WebProcess/WebPage/LayerTreeHost.h: 23 * WebProcess/WebPage/mac/LayerTreeHostMac.h: Added. 24 * WebProcess/WebPage/mac/LayerTreeHostMac.mm: 25 (WebKit::LayerTreeHostMac::~LayerTreeHostMac): 26 Invalidate the run loop observer here instead of in platformInvalidate. 27 28 (WebKit::LayerTreeHostMac::scheduleLayerFlush): 29 (WebKit::LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback): 30 These are now members of LayerTreeHostMac. 31 1 32 2011-01-30 Geoffrey Garen <ggaren@apple.com> 2 33 -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r77012 r77139 144 144 1A64256912DE42EC00CAAE2C /* BackingStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A64256712DE42EC00CAAE2C /* BackingStore.cpp */; }; 145 145 1A64292D12DE5F9800CAAE2C /* BackingStoreMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A64292C12DE5F9800CAAE2C /* BackingStoreMac.mm */; }; 146 1A690D1712F39E3300ECD289 /* LayerTreeHostMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A690D1612F39E3300ECD289 /* LayerTreeHostMac.h */; }; 146 147 1A6F9F9011E13EFC00DB1371 /* CommandLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */; }; 147 148 1A6F9FB711E1408500DB1371 /* CommandLineMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6F9FB611E1408500DB1371 /* CommandLineMac.cpp */; }; … … 890 891 1A64256712DE42EC00CAAE2C /* BackingStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackingStore.cpp; sourceTree = "<group>"; }; 891 892 1A64292C12DE5F9800CAAE2C /* BackingStoreMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BackingStoreMac.mm; sourceTree = "<group>"; }; 893 1A690D1612F39E3300ECD289 /* LayerTreeHostMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerTreeHostMac.h; sourceTree = "<group>"; }; 892 894 1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommandLine.h; sourceTree = "<group>"; }; 893 895 1A6F9FB611E1408500DB1371 /* CommandLineMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommandLineMac.cpp; sourceTree = "<group>"; }; … … 2576 2578 BC5F7BB8118237990052C02C /* ChunkedUpdateDrawingAreaMac.cpp */, 2577 2579 0F5265B511DD37700006D33C /* LayerBackedDrawingAreaMac.mm */, 2580 1A690D1612F39E3300ECD289 /* LayerTreeHostMac.h */, 2578 2581 1A18718412EF9877008E5F37 /* LayerTreeHostMac.mm */, 2579 2582 1C8E2DAD1278C5B200BC7BD0 /* WebInspectorMac.mm */, … … 3116 3119 1A9636BD12F348490078A062 /* ShareableSurface.h in Headers */, 3117 3120 1A9639F712F38ECD0078A062 /* CoreAnimationRenderer.h in Headers */, 3121 1A690D1712F39E3300ECD289 /* LayerTreeHostMac.h in Headers */, 3118 3122 ); 3119 3123 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
r76916 r77139 57 57 , m_isPaintingSuspended(!parameters.isVisible) 58 58 , m_displayTimer(WebProcess::shared().runLoop(), this, &DrawingAreaImpl::display) 59 , m_layerTreeHost(webPage)60 59 { 61 60 } … … 129 128 { 130 129 if (graphicsLayer) 131 m_layerTreeHost .attachRootCompositingLayer(graphicsLayer);130 m_layerTreeHost = LayerTreeHost::create(m_webPage, graphicsLayer); 132 131 else 133 m_layerTreeHost .detachRootCompositingLayer();132 m_layerTreeHost = nullptr; 134 133 } 135 134 136 135 void DrawingAreaImpl::scheduleCompositingLayerSync() 137 136 { 138 m_layerTreeHost.scheduleLayerFlush(); 137 if (!m_layerTreeHost) 138 return; 139 m_layerTreeHost->scheduleLayerFlush(); 139 140 } 140 141 -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
r76649 r77139 79 79 RunLoop::Timer<DrawingAreaImpl> m_displayTimer; 80 80 81 // The layer tree host whichhandles accelerated compositing.82 LayerTreeHostm_layerTreeHost;81 // The layer tree host that handles accelerated compositing. 82 OwnPtr<LayerTreeHost> m_layerTreeHost; 83 83 }; 84 84 -
trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
r76991 r77139 32 32 #include "WebPage.h" 33 33 34 #if !PLATFORM(MAC) 34 #if PLATFORM(MAC) 35 #include "LayerTreeHostMac.h" 36 #else 35 37 #error "This class is not ready for use by other ports yet." 36 38 #endif … … 39 41 40 42 namespace WebKit { 43 44 PassOwnPtr<LayerTreeHost> LayerTreeHost::create(WebPage* webPage, GraphicsLayer* graphicsLayer) 45 { 46 #if PLATFORM(MAC) 47 return adoptPtr(static_cast<LayerTreeHost*>(new LayerTreeHostMac(webPage, graphicsLayer))); 48 #endif 49 50 return 0; 51 } 41 52 42 53 LayerTreeHost::LayerTreeHost(WebPage* webPage) … … 47 58 LayerTreeHost::~LayerTreeHost() 48 59 { 49 platformInvalidate();50 }51 52 void LayerTreeHost::attachRootCompositingLayer(GraphicsLayer* graphicsLayer)53 {54 // FIXME: Implement.55 }56 57 void LayerTreeHost::detachRootCompositingLayer()58 {59 // FIXME: Implement.60 60 } 61 61 -
trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
r76653 r77139 28 28 29 29 #include <wtf/Noncopyable.h> 30 #include <wtf/PassOwnPtr.h> 30 31 31 32 #if PLATFORM(MAC) … … 45 46 46 47 public: 48 static PassOwnPtr<LayerTreeHost> create(WebPage*, WebCore::GraphicsLayer*); 49 virtual ~LayerTreeHost(); 50 51 virtual void scheduleLayerFlush() = 0; 52 53 protected: 47 54 explicit LayerTreeHost(WebPage*); 48 ~LayerTreeHost(); 49 50 void attachRootCompositingLayer(WebCore::GraphicsLayer*); 51 void detachRootCompositingLayer(); 52 53 void scheduleLayerFlush(); 55 bool flushPendingLayerChanges(); 54 56 55 57 private: 56 58 void platformInvalidate(); 57 58 bool flushPendingLayerChanges();59 60 #if PLATFORM(MAC)61 static void flushPendingLayerChangesRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void*);62 void flushPendingLayerChangesRunLoopObserverCallback();63 64 RetainPtr<CFRunLoopObserverRef> m_flushPendingLayerChangesRunLoopObserver;65 #endif66 59 67 60 WebPage* m_webPage; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.mm
r76991 r77139 25 25 26 26 #import "config.h" 27 #import "LayerTreeHost.h" 27 #import "LayerTreeHostMac.h" 28 29 using namespace WebCore; 28 30 29 31 namespace WebKit { 30 32 31 void LayerTreeHost::scheduleLayerFlush() 33 LayerTreeHostMac::LayerTreeHostMac(WebPage* webPage, GraphicsLayer* graphicsLayer) 34 : LayerTreeHost(webPage) 35 { 36 } 37 38 LayerTreeHostMac::~LayerTreeHostMac() 39 { 40 if (m_flushPendingLayerChangesRunLoopObserver) 41 CFRunLoopObserverInvalidate(m_flushPendingLayerChangesRunLoopObserver.get()); 42 } 43 44 void LayerTreeHostMac::scheduleLayerFlush() 32 45 { 33 46 CFRunLoopRef currentRunLoop = CFRunLoopGetCurrent(); … … 47 60 } 48 61 49 void LayerTreeHost ::platformInvalidate()62 void LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void* context) 50 63 { 51 if (m_flushPendingLayerChangesRunLoopObserver) 52 CFRunLoopObserverInvalidate(m_flushPendingLayerChangesRunLoopObserver.get()); 64 static_cast<LayerTreeHostMac*>(context)->flushPendingLayerChangesRunLoopObserverCallback(); 53 65 } 54 66 55 void LayerTreeHost::flushPendingLayerChangesRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void* context) 56 { 57 static_cast<LayerTreeHost*>(context)->flushPendingLayerChangesRunLoopObserverCallback(); 58 } 59 60 void LayerTreeHost::flushPendingLayerChangesRunLoopObserverCallback() 67 void LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback() 61 68 { 62 69 if (!flushPendingLayerChanges())
Note: See TracChangeset
for help on using the changeset viewer.