From 57626c5f3624b3b55d3b5a49118bca8a5baad8b3 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Mon, 3 Jun 2013 13:12:31 +0000 Subject: [Qt][Mac] Remove Carbon and QuickDraw support for plugins. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://bugs.webkit.org/show_bug.cgi?id=116619 Reviewed by Tor Arne Vestbø. They are only enabled for 32bit builds of QtWebKit and are rarely tested. Other browsers support them through a 32bit host process. PluginViewMac.mm is only used by Qt since the Wx port was removed. - Only support the Cocoa event model - Only support the CoreGraphics drawing model - Remove all NP_NO_CARBON and NP_NO_QUICKDRAW blocks in PluginViewMac.mm * plugins/PluginView.cpp: (WebCore::PluginView::setValue): (WebCore::PluginView::PluginView): * plugins/PluginView.h: * plugins/mac/PluginViewMac.mm: (WebCore::PluginView::platformStart): (WebCore::PluginView::platformDestroy): (WebCore::PluginView::platformGetValueStatic): (WebCore::PluginView::setFocus): (WebCore::PluginView::setNPWindowIfNeeded): (WebCore::PluginView::paint): (WebCore::PluginView::handleWheelEvent): (WebCore::PluginView::handleMouseEvent): (WebCore::PluginView::handleKeyboardEvent): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151106 268f45cc-cd09-0410-ab3c-d52691b4dbfc Conflicts: Source/WebCore/plugins/mac/PluginViewMac.mm Change-Id: Id4939dfe00a306299ab54c28b03f949ce4beb4d8 Reviewed-by: Allan Sandfeld Jensen --- Source/WebCore/plugins/PluginView.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'Source/WebCore/plugins/PluginView.h') diff --git a/Source/WebCore/plugins/PluginView.h b/Source/WebCore/plugins/PluginView.h index 84e62d8ae..821c16161 100644 --- a/Source/WebCore/plugins/PluginView.h +++ b/Source/WebCore/plugins/PluginView.h @@ -323,10 +323,8 @@ namespace WebCore { void lifeSupportTimerFired(Timer*); Timer m_lifeSupportTimer; -#ifndef NP_NO_CARBON #if ENABLE(NETSCAPE_PLUGIN_API) bool dispatchNPEvent(NPEvent&); -#endif // ENABLE(NETSCAPE_PLUGIN_API) #endif #if defined(XP_MACOSX) && ENABLE(NETSCAPE_PLUGIN_API) int16_t dispatchNPCocoaEvent(NPCocoaEvent&); @@ -411,20 +409,12 @@ private: void setNPWindowIfNeeded(); #elif defined(XP_MACOSX) NP_CGContext m_npCgContext; - OwnPtr > m_nullEventTimer; - NPDrawingModel m_drawingModel; - NPEventModel m_eventModel; CGContextRef m_contextRef; - WindowRef m_fakeWindow; #if PLATFORM(QT) QPixmap m_pixmap; #endif - Point m_lastMousePos; void setNPWindowIfNeeded(); - void nullEventTimerFired(Timer*); - Point globalMousePosForPlugin() const; - Point mousePosForPlugin(MouseEvent* event = 0) const; #endif #if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API) -- cgit v1.2.1 From f64d11fc6fd0798fae2a1ecc7565b9d2efd385bc Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Mon, 3 Jun 2013 13:12:48 +0000 Subject: [Qt][Mac] Allow drawing plugins with QWindow by always using an intermediate bitmap. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://bugs.webkit.org/show_bug.cgi?id=116620 Reviewed by Tor Arne Vestbø. The isolation of QWidget along with QPA in Qt5 is abstracting away the native CGContext of a QWidget and we would need to create a non-public API to be able to achieve it. Instead of adding complexity to this rarely touched code, always draw into an intermediate bitmap that we then paint into our QPainter afterward. - Use CGBitmapContextCreate to allocate a buffer directly instead of creating a QPixmap and extract an CGContextRef out of it. - Get rid of the "if (platformPluginWidget())" code path since we don't paint directly into the QWidget's backing store anymore. - Always use m_contextRef to draw the plugin instead of alternating between direct and indirect drawing. * plugins/PluginView.cpp: (WebCore::PluginView::PluginView): * plugins/PluginView.h: * plugins/mac/PluginViewMac.mm: (WebCore::createBitmapContext): (WebCore::PluginView::platformStart): (WebCore::PluginView::platformDestroy): (WebCore::PluginView::setFocus): (WebCore::PluginView::setNPWindowIfNeeded): (WebCore::PluginView::updatePluginWidget): (WebCore::PluginView::paint): (WebCore::PluginView::invalidateRect): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151107 268f45cc-cd09-0410-ab3c-d52691b4dbfc Conflicts: Source/WebCore/plugins/PluginView.h Source/WebCore/plugins/mac/PluginViewMac.mm Change-Id: I1006dcf3c08c14ca0d144532372de33f815fbc23 Reviewed-by: Allan Sandfeld Jensen --- Source/WebCore/plugins/PluginView.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'Source/WebCore/plugins/PluginView.h') diff --git a/Source/WebCore/plugins/PluginView.h b/Source/WebCore/plugins/PluginView.h index 821c16161..361c286db 100644 --- a/Source/WebCore/plugins/PluginView.h +++ b/Source/WebCore/plugins/PluginView.h @@ -52,9 +52,6 @@ typedef struct HWND__* HWND; typedef HWND PlatformPluginWidget; #else typedef PlatformWidget PlatformPluginWidget; -#if defined(XP_MACOSX) && PLATFORM(QT) -#include -#endif #endif #if PLATFORM(QT) #if USE(TEXTURE_MAPPER) @@ -330,7 +327,6 @@ namespace WebCore { int16_t dispatchNPCocoaEvent(NPCocoaEvent&); bool m_updatedCocoaTextInputRequested; bool m_keyDownSent; - bool m_usePixmap; uint16_t m_disregardKeyUpCounter; #endif @@ -390,7 +386,7 @@ namespace WebCore { bool m_haveUpdatedPluginWidget; #endif -#if ((PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(WX)) && OS(WINDOWS)) || defined(XP_MACOSX) || PLATFORM(EFL) +#if ((PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(WX)) && OS(WINDOWS)) || PLATFORM(EFL) // On Mac OSX and Qt/Windows the plugin does not have its own native widget, // but is using the containing window as its reference for positioning/painting. PlatformPluginWidget m_window; @@ -410,9 +406,6 @@ private: #elif defined(XP_MACOSX) NP_CGContext m_npCgContext; CGContextRef m_contextRef; -#if PLATFORM(QT) - QPixmap m_pixmap; -#endif void setNPWindowIfNeeded(); #endif -- cgit v1.2.1