From e342d43d13ffcd21748bae4c782ec1509c0f40b3 Mon Sep 17 00:00:00 2001 From: Doug Turner Date: Wed, 10 Mar 2010 15:01:46 -0800 Subject: [PATCH] Bug 550545 - The NPAPI ImageExpose event should be disabled when building for Qt. r=vlad --HG-- extra : rebase_source : b66a81ba5a019e7da387eb81d4fd2454be196fe7 --- layout/generic/nsObjectFrame.cpp | 27 +++++++++---------- .../plugin/base/public/nsPluginNativeWindow.h | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 80842e9588b..96412de1c0f 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -174,18 +174,15 @@ enum { XKeyPress = KeyPress }; #undef KeyPress #endif -#if (MOZ_PLATFORM_MAEMO == 5) +#if (MOZ_PLATFORM_MAEMO == 5) && defined(MOZ_WIDGET_GTK2) #define MOZ_COMPOSITED_PLUGINS 1 - +#define MOZ_USE_IMAGE_EXPOSE 1 #include "gfxXlibSurface.h" - #include #include #include #include #include - - #endif #ifdef MOZ_WIDGET_GTK2 @@ -417,7 +414,7 @@ public: return strncmp(GetPluginName(), aPluginName, strlen(aPluginName)) == 0; } -#if (MOZ_PLATFORM_MAEMO == 5) +#ifdef MOZ_USE_IMAGE_EXPOSE nsresult SetAbsoluteScreenPosition(nsIDOMElement* element, nsIDOMClientRect* position, nsIDOMClientRect* clip); @@ -512,7 +509,7 @@ private: }; #endif -#if (MOZ_PLATFORM_MAEMO == 5) +#ifdef MOZ_USE_IMAGE_EXPOSE // On hildon, we attempt to use NPImageExpose which allows us faster // painting. @@ -1226,7 +1223,7 @@ nsObjectFrame::SetAbsoluteScreenPosition(nsIDOMElement* element, nsIDOMClientRect* position, nsIDOMClientRect* clip) { -#if (MOZ_PLATFORM_MAEMO == 5) +#ifdef MOZ_USE_IMAGE_EXPOSE if (!mInstanceOwner) return NS_ERROR_NOT_AVAILABLE; return mInstanceOwner->SetAbsoluteScreenPosition(element, position, clip); @@ -2456,7 +2453,7 @@ nsPluginInstanceOwner::nsPluginInstanceOwner() mLastPoint = nsIntPoint(0,0); #endif -#if (MOZ_PLATFORM_MAEMO == 5) +#ifdef MOZ_USE_IMAGE_EXPOSE mPluginSize = nsIntSize(0,0); mXlibSurfGC = None; mBlitWindow = nsnull; @@ -2526,7 +2523,7 @@ nsPluginInstanceOwner::~nsPluginInstanceOwner() mInstance->InvalidateOwner(); } -#if (MOZ_PLATFORM_MAEMO == 5) +#ifdef MOZ_USE_IMAGE_EXPOSE ReleaseXShm(); #endif } @@ -2738,7 +2735,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRect(NPRect *invalidRect) if (!mObjectFrame || !invalidRect || !mWidgetVisible) return NS_ERROR_FAILURE; -#if (MOZ_PLATFORM_MAEMO == 5) +#ifdef MOZ_USE_IMAGE_EXPOSE PRBool simpleImageRender = PR_FALSE; mInstance->GetValueFromPlugin(NPPVpluginWindowlessLocalBool, &simpleImageRender); @@ -4885,7 +4882,7 @@ void nsPluginInstanceOwner::Paint(gfxContext* aContext, if (!mInstance || !mObjectFrame) return; -#if (MOZ_PLATFORM_MAEMO == 5) +#ifdef MOZ_USE_IMAGE_EXPOSE // through to be able to paint the context passed in. This allows // us to handle plugins that do not self invalidate (slowly, but // accurately), and it allows us to reduce flicker. @@ -4974,7 +4971,7 @@ DepthOfVisual(const Screen* screen, const Visual* visual) } #endif -#if (MOZ_PLATFORM_MAEMO == 5) +#ifdef MOZ_USE_IMAGE_EXPOSE static GdkWindow* GetClosestWindow(nsIDOMElement *element) { @@ -5665,7 +5662,7 @@ void nsPluginInstanceOwner::SetPluginHost(nsIPluginHost* aHost) mPluginHost = aHost; } -#if (MOZ_PLATFORM_MAEMO == 5) +#ifdef MOZ_USE_IMAGE_EXPOSE PRBool nsPluginInstanceOwner::UpdateVisibility(PRBool aVisible) { // NOTE: Death grip must be held by caller. @@ -5829,7 +5826,7 @@ void nsPluginInstanceOwner::FixUpURLS(const nsString &name, nsAString &value) } } -#if (MOZ_PLATFORM_MAEMO == 5) +#ifdef MOZ_USE_IMAGE_EXPOSE nsresult nsPluginInstanceOwner::SetAbsoluteScreenPosition(nsIDOMElement* element, nsIDOMClientRect* position, diff --git a/modules/plugin/base/public/nsPluginNativeWindow.h b/modules/plugin/base/public/nsPluginNativeWindow.h index c4e8e55059c..ca7d67660a6 100644 --- a/modules/plugin/base/public/nsPluginNativeWindow.h +++ b/modules/plugin/base/public/nsPluginNativeWindow.h @@ -103,7 +103,7 @@ public: SetPluginInstance(aPluginInstance); return NS_OK; } -#if (MOZ_PLATFORM_MAEMO == 5) +#if (MOZ_PLATFORM_MAEMO == 5) && defined(MOZ_WIDGET_GTK2) #define MOZ_COMPOSITED_PLUGINS #endif #ifdef MOZ_COMPOSITED_PLUGINS