Changeset 112338 in webkit
- Timestamp:
- Mar 27, 2012 5:16:52 PM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r112312 r112338 1 2012-03-27 Anders Carlsson <andersca@apple.com> 2 3 Plug-ins using the Core Animation drawing model should work when hosting the layer tree in the window server 4 https://bugs.webkit.org/show_bug.cgi?id=82387 5 <rdar://problem/11031942> 6 7 Reviewed by Sam Weinig. 8 9 * PluginProcess/PluginControllerProxy.cpp: 10 (WebKit::PluginControllerProxy::PluginControllerProxy): 11 (WebKit::PluginControllerProxy::initialize): 12 Remove m_pluginCreationParameters; it was used by the old NPRuntime short-circuit code. 13 Make platformInitialize take creation parameters. 14 15 * PluginProcess/PluginControllerProxy.messages.in: 16 Add SetLayerHostingMode message. 17 18 * PluginProcess/gtk/PluginControllerProxyGtk.cpp: 19 (WebKit::PluginControllerProxy::platformInitialize): 20 Make platformInitialize take creation parameters. 21 22 * PluginProcess/mac/PluginControllerProxyMac.mm: 23 (WebKit::PluginControllerProxy::platformInitialize): 24 Call updateLayerHostingContext. 25 26 (WebKit::PluginControllerProxy::setLayerHostingMode): 27 Call updateLayerHostingContext and send back the new context ID. 28 29 (WebKit::PluginControllerProxy::updateLayerHostingContext): 30 Create a new LayerHostingContext given the layer hosting mode. 31 32 * PluginProcess/qt/PluginControllerProxyQt.cpp: 33 (WebKit::PluginControllerProxy::platformInitialize): 34 Make platformInitialize take creation parameters. 35 36 * WebProcess/Plugins/Netscape/NetscapePlugin.h: 37 * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: 38 (WebKit::NetscapePlugin::setLayerHostingMode): 39 Add stub. 40 41 * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm: 42 (WebKit::makeRenderLayer): 43 Add helper function for creating a new render layer. 44 45 (WebKit::PluginProxy::pluginLayer): 46 Call makeRenderLayer. 47 48 (WebKit::PluginProxy::setLayerHostingMode): 49 Send a message to the plug-in process. 50 51 (WebKit::PluginProxy::setLayerHostingContextID): 52 Update the context ID and make a new render layer. 53 54 * WebProcess/Plugins/PDF/BuiltInPDFView.cpp: 55 (WebKit::BuiltInPDFView::setLayerHostingMode): 56 Add stub. 57 * WebProcess/Plugins/PDF/BuiltInPDFView.h: 58 59 * WebProcess/Plugins/Plugin.cpp: 60 (WebKit::Plugin::Parameters::encode): 61 (WebKit::Plugin::Parameters::decode): 62 * WebProcess/Plugins/Plugin.h: 63 Add the layer hosting mode as a parameter. Add a new setLayerHostingMode pure virtual member function. 64 65 * WebProcess/Plugins/PluginProxy.messages.in: 66 Add a SetLayerHostingContextID message. 67 68 * WebProcess/Plugins/PluginView.cpp: 69 (WebKit::PluginView::setLayerHostingMode): 70 Call down to the plug-in. 71 72 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 73 (WebKit::WebFrameLoaderClient::createPlugin): 74 Set the layer hosting mode of the page. 75 76 * WebProcess/WebPage/WebPage.cpp: 77 (WebKit::WebPage::WebPage): 78 Initialize m_layerHostingMode to false. 79 80 * WebProcess/WebPage/WebPage.h: 81 (WebKit::WebPage::layerHostingMode): 82 Add m_layerHostingMode and a getter. 83 84 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 85 (WebKit::TiledCoreAnimationDrawingArea::setLayerHostingMode): 86 Call WebPage::setLayerHostingMode. 87 88 * WebProcess/WebPage/mac/WebPageMac.mm: 89 (WebKit::WebPage::setLayerHostingMode): 90 Tell all plug-ins that the layer hosting mode changed. 91 1 92 2012-03-27 Timothy Hatcher <timothy@apple.com> 2 93 -
trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
r111822 r112338 70 70 , m_pluginDestructionProtectCount(0) 71 71 , m_pluginDestroyTimer(RunLoop::main(), this, &PluginControllerProxy::destroy) 72 , m_pluginCreationParameters(0)73 72 , m_waitingForDidUpdate(false) 74 73 , m_pluginCanceledManualStreamLoad(false) … … 107 106 ASSERT(m_windowNPObject); 108 107 109 m_pluginCreationParameters = &creationParameters;110 108 bool returnValue = m_plugin->initialize(this, creationParameters.parameters); 111 m_pluginCreationParameters = 0;112 109 113 110 if (!returnValue) { … … 123 120 } 124 121 125 platformInitialize( );122 platformInitialize(creationParameters); 126 123 127 124 return true; -
trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h
r111822 r112338 134 134 void windowVisibilityChanged(bool); 135 135 void sendComplexTextInput(const String& textInput); 136 void setLayerHostingMode(uint32_t); 137 138 void updateLayerHostingContext(LayerHostingMode); 136 139 #endif 137 140 … … 139 142 void getFormValue(bool& returnValue, String& formValue); 140 143 141 bool inInitialize() const { return m_pluginCreationParameters; } 142 143 void platformInitialize(); 144 void platformInitialize(const PluginCreationParameters&); 144 145 void platformDestroy(); 145 146 void platformGeometryDidChange(); … … 169 170 WebCore::RunLoop::Timer<PluginControllerProxy> m_pluginDestroyTimer; 170 171 171 // Will point to the plug-in creation parameters of the plug-in we're currently initializing and will be null when we're done initializing.172 const PluginCreationParameters* m_pluginCreationParameters;173 174 172 // Whether we're waiting for the plug-in proxy in the web process to draw the contents of its 175 173 // backing store into the web process backing store. -
trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.messages.in
r99242 r112338 99 99 # Sent when the containing NSWindow's visibility changes 100 100 WindowVisibilityChanged(bool isVisible) 101 102 # Sent when the containing window's layer hosting mode changes 103 SetLayerHostingMode(uint32_t layerHostingMode) 101 104 #endif 102 105 -
trunk/Source/WebKit2/PluginProcess/gtk/PluginControllerProxyGtk.cpp
r95901 r112338 35 35 namespace WebKit { 36 36 37 void PluginControllerProxy::platformInitialize( )37 void PluginControllerProxy::platformInitialize(const PluginCreationParameters&) 38 38 { 39 39 notImplemented(); -
trunk/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm
r109804 r112338 30 30 31 31 #import "LayerHostingContext.h" 32 #import "PluginCreationParameters.h" 32 33 #import "PluginProcess.h" 33 34 #import "PluginProxyMessages.h" … … 54 55 } 55 56 56 void PluginControllerProxy::platformInitialize( )57 void PluginControllerProxy::platformInitialize(const PluginCreationParameters& creationParameters) 57 58 { 58 CALayer * platformLayer = m_plugin->pluginLayer();59 if (!platformLayer)60 return;61 62 59 ASSERT(!m_layerHostingContext); 63 m_layerHostingContext = LayerHostingContext::createForPort(PluginProcess::shared().compositingRenderServerPort()); 64 m_layerHostingContext->setRootLayer(platformLayer); 60 updateLayerHostingContext(creationParameters.parameters.layerHostingMode); 65 61 } 66 62 … … 113 109 } 114 110 111 void PluginControllerProxy::setLayerHostingMode(uint32_t opaqueLayerHostingMode) 112 { 113 LayerHostingMode layerHostingMode = static_cast<LayerHostingMode>(opaqueLayerHostingMode); 114 updateLayerHostingContext(layerHostingMode); 115 116 m_connection->connection()->send(Messages::PluginProxy::SetLayerHostingContextID(m_layerHostingContext->contextID()), m_pluginInstanceID); 117 } 118 119 void PluginControllerProxy::updateLayerHostingContext(LayerHostingMode layerHostingMode) 120 { 121 CALayer *platformLayer = m_plugin->pluginLayer(); 122 if (!platformLayer) 123 return; 124 125 if (m_layerHostingContext) { 126 if (m_layerHostingContext->layerHostingMode() == layerHostingMode) 127 return; 128 129 m_layerHostingContext->invalidate(); 130 } 131 132 switch (layerHostingMode) { 133 case LayerHostingModeDefault: 134 m_layerHostingContext = LayerHostingContext::createForPort(PluginProcess::shared().compositingRenderServerPort()); 135 break; 136 #if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER) 137 case LayerHostingModeInWindowServer: 138 m_layerHostingContext = LayerHostingContext::createForWindowServer(); 139 break; 140 #endif 141 } 142 143 m_layerHostingContext->setRootLayer(platformLayer); 144 } 145 115 146 } // namespace WebKit 116 147 -
trunk/Source/WebKit2/PluginProcess/qt/PluginControllerProxyQt.cpp
r95901 r112338 36 36 namespace WebKit { 37 37 38 void PluginControllerProxy::platformInitialize( )38 void PluginControllerProxy::platformInitialize(const PluginCreationParameters&) 39 39 { 40 40 notImplemented(); -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
r111822 r112338 206 206 virtual uint64_t pluginComplexTextInputIdentifier() const; 207 207 virtual void sendComplexTextInput(const String& textInput); 208 virtual void setLayerHostingMode(LayerHostingMode) OVERRIDE; 208 209 209 210 void pluginFocusOrWindowFocusChanged(); -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
r108920 r112338 1023 1023 } 1024 1024 1025 void NetscapePlugin::setLayerHostingMode(LayerHostingMode) 1026 { 1027 } 1028 1025 1029 void NetscapePlugin::pluginFocusOrWindowFocusChanged() 1026 1030 { -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm
r95901 r112338 30 30 31 31 #import "PluginController.h" 32 #import "PluginControllerProxyMessages.h" 33 #import "PluginProcessConnection.h" 32 34 #import <WebKitSystemInterface.h> 33 35 34 36 namespace WebKit { 35 37 38 static void makeRenderLayer(CALayer *pluginLayer, uint32_t layerHostingContextID) 39 { 40 CALayer *renderLayer = WKMakeRenderLayer(layerHostingContextID); 41 [renderLayer setFrame:[pluginLayer bounds]]; 42 [renderLayer setAutoresizingMask:kCALayerWidthSizable | kCALayerHeightSizable]; 43 [pluginLayer setSublayers:[NSArray arrayWithObject:renderLayer]]; 44 } 45 36 46 PlatformLayer* PluginProxy::pluginLayer() 37 47 { 38 48 if (!m_pluginLayer && m_remoteLayerClientID) { 39 CALayer *renderLayer = WKMakeRenderLayer(m_remoteLayerClientID);40 41 49 // Create a layer with flipped geometry and add the real plug-in layer as a sublayer 42 50 // so the coordinate system will match the event coordinate system. 43 51 m_pluginLayer.adoptNS([[CALayer alloc] init]); 44 52 [m_pluginLayer.get() setGeometryFlipped:YES]; 45 46 [renderLayer setAutoresizingMask:kCALayerWidthSizable | kCALayerHeightSizable]; 47 [m_pluginLayer.get() addSublayer:renderLayer]; 53 54 makeRenderLayer(m_pluginLayer.get(), m_remoteLayerClientID); 48 55 } 49 56 … … 66 73 } 67 74 75 void PluginProxy::setLayerHostingMode(LayerHostingMode layerHostingMode) 76 { 77 m_connection->connection()->send(Messages::PluginControllerProxy::SetLayerHostingMode(layerHostingMode), m_pluginInstanceID); 78 } 79 80 void PluginProxy::setLayerHostingContextID(uint32_t layerHostingContextID) 81 { 82 ASSERT(m_pluginLayer.get()); 83 84 m_remoteLayerClientID = layerHostingContextID; 85 makeRenderLayer(m_pluginLayer.get(), m_remoteLayerClientID); 86 } 87 88 68 89 } // namespace WebKit 69 90 -
trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp
r109405 r112338 641 641 } 642 642 643 void BuiltInPDFView::setLayerHostingMode(LayerHostingMode) 644 { 645 } 646 643 647 #endif 644 648 -
trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h
r109405 r112338 106 106 virtual uint64_t pluginComplexTextInputIdentifier() const; 107 107 virtual void sendComplexTextInput(const String& textInput); 108 virtual void setLayerHostingMode(LayerHostingMode) OVERRIDE; 108 109 #endif 109 110 -
trunk/Source/WebKit2/WebProcess/Plugins/Plugin.cpp
r111822 r112338 40 40 encoder->encode(mimeType); 41 41 encoder->encode(loadManually); 42 #if PLATFORM(MAC) 43 encoder->encodeEnum(layerHostingMode); 44 #endif 42 45 } 43 46 … … 58 61 if (!decoder->decode(parameters.loadManually)) 59 62 return false; 60 63 #if PLATFORM(MAC) 64 if (!decoder->decodeEnum(parameters.layerHostingMode)) 65 return false; 66 #endif 61 67 if (parameters.names.size() != parameters.values.size()) { 62 68 decoder->markInvalid(); -
trunk/Source/WebKit2/WebProcess/Plugins/Plugin.h
r111822 r112338 34 34 #include <wtf/Vector.h> 35 35 36 #if PLATFORM(MAC) 37 #include "LayerHostingContext.h" 38 #endif 39 36 40 struct NPObject; 37 41 … … 66 70 String mimeType; 67 71 bool loadManually; 72 #if PLATFORM(MAC) 73 LayerHostingMode layerHostingMode; 74 #endif 68 75 69 76 void encode(CoreIPC::ArgumentEncoder*) const; … … 194 201 // Send the complex text input to the plug-in. 195 202 virtual void sendComplexTextInput(const String& textInput) = 0; 203 204 // Tells the plug-in about changes to the layer hosting mode. 205 virtual void setLayerHostingMode(LayerHostingMode) = 0; 196 206 #endif 197 207 -
trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h
r99241 r112338 101 101 virtual uint64_t pluginComplexTextInputIdentifier() const; 102 102 virtual void sendComplexTextInput(const String& textInput); 103 virtual void setLayerHostingMode(LayerHostingMode) OVERRIDE; 103 104 #endif 104 105 … … 133 134 void pluginFocusOrWindowFocusChanged(bool); 134 135 void setComplexTextInputState(uint64_t); 136 void setLayerHostingContextID(uint32_t); 135 137 #endif 136 138 -
trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.messages.in
r98928 r112338 61 61 PluginFocusOrWindowFocusChanged(bool pluginHasFocusAndWindowHasFocus) 62 62 63 # Change whether complex ttext input is enabled for this plug-in.63 # Change whether complex text input is enabled for this plug-in. 64 64 SetComplexTextInputState(uint64_t complexTextInputState) 65 66 # Update the layer hosting context ID. Called whenever the layer hosting state changes. 67 SetLayerHostingContextID(uint32_t layerHostingContextID) 65 68 #endif 66 69 } -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
r111822 r112338 435 435 } 436 436 437 void PluginView::setLayerHostingMode(LayerHostingMode layerHostingMode) 438 { 439 if (!m_plugin) 440 return; 441 442 m_plugin->setLayerHostingMode(layerHostingMode); 443 } 444 437 445 #endif 438 446 -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h
r111822 r112338 66 66 void windowAndViewFramesChanged(const WebCore::IntRect& windowFrameInScreenCoordinates, const WebCore::IntRect& viewFrameInWindowCoordinates); 67 67 bool sendComplexTextInput(uint64_t pluginComplexTextInputIdentifier, const String& textInput); 68 void setLayerHostingMode(LayerHostingMode); 68 69 #endif 69 70 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r112184 r112338 1268 1268 parameters.mimeType = mimeType; 1269 1269 parameters.loadManually = loadManually; 1270 #if PLATFORM(MAC) 1271 parameters.layerHostingMode = webPage->layerHostingMode(); 1272 #endif 1270 1273 1271 1274 #if PLUGIN_ARCHITECTURE(X11) -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r112084 r112338 189 189 , m_windowIsVisible(false) 190 190 , m_isSmartInsertDeleteEnabled(parameters.isSmartInsertDeleteEnabled) 191 , m_layerHostingMode(LayerHostingModeDefault) 191 192 , m_keyboardEventBeingInterpreted(0) 192 193 #elif PLATFORM(WIN) … … 2452 2453 (*it)->windowAndViewFramesChanged(windowFrameInScreenCoordinates, viewFrameInWindowCoordinates); 2453 2454 } 2454 2455 2455 #endif 2456 2456 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r111276 r112338 82 82 #if PLATFORM(MAC) 83 83 #include "DictionaryPopupInfo.h" 84 #include "LayerHostingContext.h" 84 85 #include <wtf/RetainPtr.h> 85 86 OBJC_CLASS NSDictionary; … … 300 301 void removePluginView(PluginView*); 301 302 303 LayerHostingMode layerHostingMode() const { return m_layerHostingMode; } 304 void setLayerHostingMode(LayerHostingMode); 305 302 306 bool windowIsVisible() const { return m_windowIsVisible; } 303 307 const WebCore::IntRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; } … … 701 705 HashSet<PluginView*> m_pluginViews; 702 706 707 // The layer hosting mode. 708 LayerHostingMode m_layerHostingMode; 709 703 710 RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement; 704 711 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
r112175 r112338 324 324 m_layerHostingContext->setRootLayer(m_rootLayer.get()); 325 325 326 m_webPage->setLayerHostingMode(layerHostingMode); 327 326 328 // Finally, inform the UIProcess that the context has changed. 327 329 LayerTreeContext layerTreeContext; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
r111125 r112338 712 712 } 713 713 714 void WebPage::setLayerHostingMode(LayerHostingMode layerHostingMode) 715 { 716 m_layerHostingMode = layerHostingMode; 717 718 for (HashSet<PluginView*>::const_iterator it = m_pluginViews.begin(), end = m_pluginViews.end(); it != end; ++it) 719 (*it)->setLayerHostingMode(layerHostingMode); 720 } 721 714 722 } // namespace WebKit
Note: See TracChangeset
for help on using the changeset viewer.