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.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/WebCore/plugins/PluginView.cpp') diff --git a/Source/WebCore/plugins/PluginView.cpp b/Source/WebCore/plugins/PluginView.cpp index 861372f9d..cdf8a78bb 100644 --- a/Source/WebCore/plugins/PluginView.cpp +++ b/Source/WebCore/plugins/PluginView.cpp @@ -847,7 +847,7 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p , m_wmPrintHDC(0) , m_haveUpdatedPluginWidget(false) #endif -#if (PLATFORM(QT) && OS(WINDOWS)) || defined(XP_MACOSX) || PLATFORM(EFL) +#if (PLATFORM(QT) && OS(WINDOWS)) || PLATFORM(EFL) , m_window(0) #endif #if defined(XP_MACOSX) -- cgit v1.2.1