summaryrefslogtreecommitdiffstats
path: root/WebCore/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/plugins')
-rw-r--r--WebCore/plugins/DOMMimeTypeArray.cpp2
-rw-r--r--WebCore/plugins/DOMPlugin.cpp2
-rw-r--r--WebCore/plugins/DOMPluginArray.cpp2
-rw-r--r--WebCore/plugins/PluginDatabase.h3
-rw-r--r--WebCore/plugins/PluginPackage.cpp2
-rw-r--r--WebCore/plugins/PluginPackage.h2
-rw-r--r--WebCore/plugins/PluginStream.h2
-rw-r--r--WebCore/plugins/PluginView.cpp10
-rw-r--r--WebCore/plugins/PluginView.h10
-rw-r--r--WebCore/plugins/qt/PluginViewQt.cpp86
-rw-r--r--WebCore/plugins/symbian/PluginViewSymbian.cpp5
-rw-r--r--WebCore/plugins/win/PluginPackageWin.cpp2
12 files changed, 110 insertions, 18 deletions
diff --git a/WebCore/plugins/DOMMimeTypeArray.cpp b/WebCore/plugins/DOMMimeTypeArray.cpp
index f36f2a2..8c81bb7 100644
--- a/WebCore/plugins/DOMMimeTypeArray.cpp
+++ b/WebCore/plugins/DOMMimeTypeArray.cpp
@@ -20,11 +20,11 @@
#include "config.h"
#include "DOMMimeTypeArray.h"
-#include "AtomicString.h"
#include "DOMPlugin.h"
#include "Frame.h"
#include "Page.h"
#include "PluginData.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/plugins/DOMPlugin.cpp b/WebCore/plugins/DOMPlugin.cpp
index 11ec929..ac4fd03 100644
--- a/WebCore/plugins/DOMPlugin.cpp
+++ b/WebCore/plugins/DOMPlugin.cpp
@@ -19,9 +19,9 @@
#include "config.h"
#include "DOMPlugin.h"
-#include "AtomicString.h"
#include "PluginData.h"
#include "Frame.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/plugins/DOMPluginArray.cpp b/WebCore/plugins/DOMPluginArray.cpp
index fb11da8..3717f32 100644
--- a/WebCore/plugins/DOMPluginArray.cpp
+++ b/WebCore/plugins/DOMPluginArray.cpp
@@ -20,11 +20,11 @@
#include "config.h"
#include "DOMPluginArray.h"
-#include "AtomicString.h"
#include "DOMPlugin.h"
#include "Frame.h"
#include "Page.h"
#include "PluginData.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/plugins/PluginDatabase.h b/WebCore/plugins/PluginDatabase.h
index ea3559d..287857e 100644
--- a/WebCore/plugins/PluginDatabase.h
+++ b/WebCore/plugins/PluginDatabase.h
@@ -30,10 +30,9 @@
#include "PlatformString.h"
#include "PluginPackage.h"
-#include "StringHash.h"
-
#include <wtf/HashSet.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
#if defined(ANDROID_PLUGINS)
namespace android {
diff --git a/WebCore/plugins/PluginPackage.cpp b/WebCore/plugins/PluginPackage.cpp
index c7d8b22..48c44f0 100644
--- a/WebCore/plugins/PluginPackage.cpp
+++ b/WebCore/plugins/PluginPackage.cpp
@@ -191,7 +191,6 @@ void PluginPackage::determineQuirks(const String& mimeType)
#if PLATFORM(QT)
m_quirks.add(PluginQuirkRequiresGtkToolKit);
#endif
- m_quirks.add(PluginQuirkRequiresDefaultScreenDepth);
} else {
// Flash 9 and older requests windowless plugins if we return a mozilla user agent
m_quirks.add(PluginQuirkWantsMozillaUserAgent);
@@ -201,6 +200,7 @@ void PluginPackage::determineQuirks(const String& mimeType)
#endif
}
+ m_quirks.add(PluginQuirkRequiresDefaultScreenDepth);
m_quirks.add(PluginQuirkThrottleInvalidate);
m_quirks.add(PluginQuirkThrottleWMUserPlusOneMessages);
m_quirks.add(PluginQuirkFlashURLNotifyBug);
diff --git a/WebCore/plugins/PluginPackage.h b/WebCore/plugins/PluginPackage.h
index 659f5ff..92a9c52 100644
--- a/WebCore/plugins/PluginPackage.h
+++ b/WebCore/plugins/PluginPackage.h
@@ -30,11 +30,11 @@
#include "FileSystem.h"
#include "PlatformString.h"
#include "PluginQuirkSet.h"
-#include "StringHash.h"
#include "Timer.h"
#include "npruntime_internal.h"
#include <wtf/HashMap.h>
#include <wtf/RefCounted.h>
+#include <wtf/text/StringHash.h>
#if OS(SYMBIAN)
class QPluginLoader;
diff --git a/WebCore/plugins/PluginStream.h b/WebCore/plugins/PluginStream.h
index f9f927e..ae69539 100644
--- a/WebCore/plugins/PluginStream.h
+++ b/WebCore/plugins/PluginStream.h
@@ -34,7 +34,6 @@
#include "PluginQuirkSet.h"
#include "ResourceRequest.h"
#include "ResourceResponse.h"
-#include "StringHash.h"
#include "Timer.h"
#include "npruntime_internal.h"
#include <wtf/HashMap.h>
@@ -42,6 +41,7 @@
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
class Frame;
diff --git a/WebCore/plugins/PluginView.cpp b/WebCore/plugins/PluginView.cpp
index 2f5f342..5a33b78 100644
--- a/WebCore/plugins/PluginView.cpp
+++ b/WebCore/plugins/PluginView.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2008 Collabora Ltd. All rights reserved.
+ * Copyright (C) 2010 Girish Ramakrishnan <girish@forwardbias.in>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -708,6 +709,12 @@ NPError PluginView::setValue(NPPVariable variable, void* value)
}
#endif // defined(XP_MACOSX)
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ case NPPVpluginWindowlessLocalBool:
+ m_renderToImage = true;
+ return NPERR_NO_ERROR;
+#endif
+
default:
#ifdef PLUGIN_PLATFORM_SETVALUE
return platformSetValue(variable, value);
@@ -919,6 +926,9 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p
, m_colormap(0)
, m_pluginDisplay(0)
#endif
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ , m_renderToImage(false)
+#endif
, m_loadManually(loadManually)
, m_manualStream(0)
, m_isJavaScriptPaused(false)
diff --git a/WebCore/plugins/PluginView.h b/WebCore/plugins/PluginView.h
index cc36665..2b272ec 100644
--- a/WebCore/plugins/PluginView.h
+++ b/WebCore/plugins/PluginView.h
@@ -62,6 +62,10 @@ typedef PlatformWidget PlatformPluginWidget;
#include <QPixmap>
#endif
#endif
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+#include <QImage>
+class QPainter;
+#endif
#if USE(JSC)
namespace JSC {
@@ -420,6 +424,12 @@ private:
void initXEvent(XEvent* event);
#endif
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ QImage m_image;
+ bool m_renderToImage;
+ void paintUsingImageSurfaceExtension(QPainter* painter, const IntRect& exposedRect);
+#endif
+
IntRect m_clipRect; // The clip rect to apply to a windowed plug-in
IntRect m_windowRect; // Our window rect.
#ifdef ANDROID_PLUGINS
diff --git a/WebCore/plugins/qt/PluginViewQt.cpp b/WebCore/plugins/qt/PluginViewQt.cpp
index 0ca356b..3b41072 100644
--- a/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/WebCore/plugins/qt/PluginViewQt.cpp
@@ -111,12 +111,20 @@ void PluginView::updatePluginWidget()
return;
if (!m_isWindowed && m_windowRect.size() != oldWindowRect.size()) {
- if (m_drawable)
- XFreePixmap(QX11Info::display(), m_drawable);
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ // On Maemo5, Flash always renders to 16-bit buffer
+ if (m_renderToImage)
+ m_image = QImage(m_windowRect.width(), m_windowRect.height(), QImage::Format_RGB16);
+ else
+#endif
+ {
+ if (m_drawable)
+ XFreePixmap(QX11Info::display(), m_drawable);
- m_drawable = XCreatePixmap(QX11Info::display(), QX11Info::appRootWindow(), m_windowRect.width(), m_windowRect.height(),
- ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth);
- QApplication::syncX(); // make sure that the server knows about the Drawable
+ m_drawable = XCreatePixmap(QX11Info::display(), QX11Info::appRootWindow(), m_windowRect.width(), m_windowRect.height(),
+ ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth);
+ QApplication::syncX(); // make sure that the server knows about the Drawable
+ }
}
// do not call setNPWindowIfNeeded immediately, will be called on paint()
@@ -160,6 +168,48 @@ void PluginView::hide()
Widget::hide();
}
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+void PluginView::paintUsingImageSurfaceExtension(QPainter* painter, const IntRect& exposedRect)
+{
+ if (m_isTransparent) {
+ // On Maemo5, Flash expects the buffer to contain the contents that are below it.
+ // We don't support transparency, so clean the image before giving to Flash.
+ QPainter imagePainter(&m_image);
+ imagePainter.fillRect(exposedRect, Qt::white);
+ }
+
+ NPImageExpose imageExpose;
+ imageExpose.data = reinterpret_cast<char*>(m_image.bits());
+ imageExpose.stride = m_image.bytesPerLine();
+ imageExpose.depth = m_image.depth();
+ imageExpose.x = exposedRect.x();
+ imageExpose.y = exposedRect.y();
+ imageExpose.width = exposedRect.width();
+ imageExpose.height = exposedRect.height();
+ imageExpose.dataSize.width = m_image.width();
+ imageExpose.dataSize.height = m_image.height();
+ imageExpose.translateX = 0;
+ imageExpose.translateY = 0;
+ imageExpose.scaleX = 1;
+ imageExpose.scaleY = 1;
+
+ XEvent xevent;
+ memset(&xevent, 0, sizeof(XEvent));
+ XGraphicsExposeEvent& exposeEvent = xevent.xgraphicsexpose;
+ exposeEvent.type = GraphicsExpose;
+ exposeEvent.display = 0;
+ exposeEvent.drawable = reinterpret_cast<XID>(&imageExpose);
+ exposeEvent.x = exposedRect.x();
+ exposeEvent.y = exposedRect.y();
+ exposeEvent.width = exposedRect.width();
+ exposeEvent.height = exposedRect.height();
+
+ dispatchNPEvent(xevent);
+
+ painter->drawImage(QPoint(frameRect().x() + exposedRect.x(), frameRect().y() + exposedRect.y()), m_image, exposedRect);
+}
+#endif
+
void PluginView::paint(GraphicsContext* context, const IntRect& rect)
{
if (!m_isStarted) {
@@ -172,19 +222,32 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
setNPWindowIfNeeded();
- if (m_isWindowed || !m_drawable)
+ if (m_isWindowed)
return;
- const bool syncX = m_pluginDisplay && m_pluginDisplay != QX11Info::display();
+ if (!m_drawable
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ && m_image.isNull()
+#endif
+ )
+ return;
QPainter* painter = context->platformContext();
IntRect exposedRect(rect);
exposedRect.intersect(frameRect());
exposedRect.move(-frameRect().x(), -frameRect().y());
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ if (!m_image.isNull()) {
+ paintUsingImageSurfaceExtension(painter, exposedRect);
+ return;
+ }
+#endif
+
QPixmap qtDrawable = QPixmap::fromX11Pixmap(m_drawable, QPixmap::ExplicitlyShared);
const int drawableDepth = ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth;
ASSERT(drawableDepth == qtDrawable.depth());
+ const bool syncX = m_pluginDisplay && m_pluginDisplay != QX11Info::display();
// When printing, Qt uses a QPicture to capture the output in preview mode. The
// QPicture holds a reference to the X Pixmap. As a result, the print preview would
@@ -587,6 +650,13 @@ bool PluginView::platformGetValueStatic(NPNVariable variable, void* value, NPErr
*result = NPERR_NO_ERROR;
return true;
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ case NPNVSupportsWindowlessLocal:
+ *static_cast<NPBool*>(value) = true;
+ *result = NPERR_NO_ERROR;
+ return true;
+#endif
+
default:
return false;
}
@@ -662,7 +732,7 @@ static Display *getPluginDisplay()
// support gdk based plugins (like flash) that use a different X connection.
// The code below has the same effect as this one:
// Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
- QLibrary library("libgdk-x11-2.0");
+ QLibrary library("libgdk-x11-2.0.so.0");
if (!library.load())
return 0;
diff --git a/WebCore/plugins/symbian/PluginViewSymbian.cpp b/WebCore/plugins/symbian/PluginViewSymbian.cpp
index baa9839..b9f82ad 100644
--- a/WebCore/plugins/symbian/PluginViewSymbian.cpp
+++ b/WebCore/plugins/symbian/PluginViewSymbian.cpp
@@ -242,8 +242,11 @@ void PluginView::setParent(ScrollView* parent)
{
Widget::setParent(parent);
- if (parent)
+ if (parent) {
init();
+ if (m_status == PluginStatusLoadedSuccessfully)
+ updatePluginWidget();
+ }
}
void PluginView::setNPWindowRect(const IntRect&)
diff --git a/WebCore/plugins/win/PluginPackageWin.cpp b/WebCore/plugins/win/PluginPackageWin.cpp
index 80dea93..f3dd781 100644
--- a/WebCore/plugins/win/PluginPackageWin.cpp
+++ b/WebCore/plugins/win/PluginPackageWin.cpp
@@ -181,7 +181,7 @@ bool PluginPackage::fetchInfo()
VS_FIXEDFILEINFO* info;
UINT infoSize;
- if (!VerQueryValue(versionInfoData.get(), TEXT("\\"), (LPVOID*) &info, &infoSize) || infoSize < sizeof(VS_FIXEDFILEINFO))
+ if (!VerQueryValueW(versionInfoData.get(), L"\\", (LPVOID*) &info, &infoSize) || infoSize < sizeof(VS_FIXEDFILEINFO))
return false;
m_moduleVersion.leastSig = info->dwFileVersionLS;
m_moduleVersion.mostSig = info->dwFileVersionMS;