Bug 710511: Rename DrawingModel to ANPDrawingModel r=snorp

This commit is contained in:
Bas Schouten 2012-01-17 23:45:06 +01:00
Родитель 71565c1d3f
Коммит 38f797fcf5
4 изменённых файлов: 11 добавлений и 10 удалений

Просмотреть файл

@ -2507,7 +2507,7 @@ _setvalue(NPP npp, NPPVariable variable, void *result)
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
case kRequestDrawingModel_ANPSetValue: case kRequestDrawingModel_ANPSetValue:
if (inst) if (inst)
inst->SetDrawingModel(NS_PTR_TO_INT32(result)); inst->SetANPDrawingModel(NS_PTR_TO_INT32(result));
return NPERR_NO_ERROR; return NPERR_NO_ERROR;
case kAcceptEvents_ANPSetValue: case kAcceptEvents_ANPSetValue:
return NPERR_NO_ERROR; return NPERR_NO_ERROR;

Просмотреть файл

@ -89,7 +89,7 @@ nsNPAPIPluginInstance::nsNPAPIPluginInstance(nsNPAPIPlugin* plugin)
#endif #endif
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
mSurface(nsnull), mSurface(nsnull),
mDrawingModel(0), mANPDrawingModel(0),
#endif #endif
mRunning(NOT_STARTED), mRunning(NOT_STARTED),
mWindowless(false), mWindowless(false),
@ -731,10 +731,11 @@ void nsNPAPIPluginInstance::SetEventModel(NPEventModel aModel)
#endif #endif
#if defined(MOZ_WIDGET_ANDROID) #if defined(MOZ_WIDGET_ANDROID)
void nsNPAPIPluginInstance::SetDrawingModel(PRUint32 aModel) void nsNPAPIPluginInstance::SetANPDrawingModel(PRUint32 aModel)
{ {
mDrawingModel = aModel; mANPDrawingModel = aModel;
} }
class SurfaceGetter : public nsRunnable { class SurfaceGetter : public nsRunnable {
public: public:
SurfaceGetter(nsNPAPIPluginInstance* aInstance, NPPluginFuncs* aPluginFunctions, NPP_t aNPP) : SurfaceGetter(nsNPAPIPluginInstance* aInstance, NPPluginFuncs* aPluginFunctions, NPP_t aNPP) :
@ -760,7 +761,7 @@ private:
void* nsNPAPIPluginInstance::GetJavaSurface() void* nsNPAPIPluginInstance::GetJavaSurface()
{ {
if (mDrawingModel != kSurface_ANPDrawingModel) if (mANPDrawingModel != kSurface_ANPDrawingModel)
return nsnull; return nsnull;
return mSurface; return mSurface;
@ -785,7 +786,7 @@ void nsNPAPIPluginInstance::RequestJavaSurface()
nsresult nsNPAPIPluginInstance::GetDrawingModel(PRInt32* aModel) nsresult nsNPAPIPluginInstance::GetDrawingModel(PRInt32* aModel)
{ {
#if defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID) #if defined(XP_MACOSX)
*aModel = (PRInt32)mDrawingModel; *aModel = (PRInt32)mDrawingModel;
return NS_OK; return NS_OK;
#else #else

Просмотреть файл

@ -150,7 +150,8 @@ public:
#endif #endif
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
void SetDrawingModel(PRUint32 aModel); PRUint32 GetANPDrawingModel() { return mANPDrawingModel; }
void SetANPDrawingModel(PRUint32 aModel);
void* GetJavaSurface(); void* GetJavaSurface();
void SetJavaSurface(void* aSurface); void SetJavaSurface(void* aSurface);
void RequestJavaSurface(); void RequestJavaSurface();
@ -229,7 +230,7 @@ protected:
#endif #endif
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
PRUint32 mDrawingModel; PRUint32 mANPDrawingModel;
nsCOMPtr<nsIRunnable> mSurfaceGetter; nsCOMPtr<nsIRunnable> mSurfaceGetter;
#endif #endif

Просмотреть файл

@ -2868,8 +2868,7 @@ void nsPluginInstanceOwner::Paint(gfxContext* aContext,
if (!mInstance || !mObjectFrame) if (!mInstance || !mObjectFrame)
return; return;
PRInt32 model; PRInt32 model = mInstance->GetANPDrawingModel();
mInstance->GetDrawingModel(&model);
if (model == kSurface_ANPDrawingModel) { if (model == kSurface_ANPDrawingModel) {
if (!AddPluginView(aFrameRect)) { if (!AddPluginView(aFrameRect)) {