Bug 1072528. Part 1: Remove plugin-related code. r=bsmedberg
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 24 Sep 2014 16:35:00 -0400
changeset 211137 f321139439a151811fc6abec905304395e881623
parent 211136 09e514e23ef183c2850d94583382d7e8cfa9b003
child 211138 20d9430a0d6251dbee096930bd04c2f47b402f06
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbsmedberg
bugs1072528
milestone36.0a1
Bug 1072528. Part 1: Remove plugin-related code. r=bsmedberg
dom/plugins/base/npapi.h
dom/plugins/base/npfunctions.h
dom/plugins/base/nsIPluginInstanceOwner.idl
dom/plugins/base/nsNPAPIPlugin.cpp
dom/plugins/base/nsNPAPIPlugin.h
dom/plugins/base/nsNPAPIPluginInstance.cpp
dom/plugins/base/nsNPAPIPluginInstance.h
dom/plugins/base/nsPluginInstanceOwner.cpp
dom/plugins/base/nsPluginInstanceOwner.h
dom/plugins/ipc/PPluginInstance.ipdl
dom/plugins/ipc/PPluginModule.ipdl
dom/plugins/ipc/PluginInstanceChild.cpp
dom/plugins/ipc/PluginInstanceChild.h
dom/plugins/ipc/PluginInstanceParent.cpp
dom/plugins/ipc/PluginInstanceParent.h
dom/plugins/ipc/PluginMessageUtils.h
dom/plugins/ipc/PluginModuleChild.cpp
dom/plugins/ipc/PluginModuleChild.h
dom/plugins/ipc/PluginModuleParent.cpp
dom/plugins/test/reftest/plugin-async-update-ref.html
dom/plugins/test/reftest/plugin-asyncbitmap-sanity.html
dom/plugins/test/reftest/plugin-asyncbitmap-update.html
dom/plugins/test/reftest/plugin-asyncdxgi-sanity.html
dom/plugins/test/reftest/plugin-asyncdxgi-update.html
dom/plugins/test/reftest/reftest.list
dom/plugins/test/testplugin/README
dom/plugins/test/testplugin/nptest.cpp
dom/plugins/test/testplugin/nptest.h
dom/plugins/test/testplugin/nptest_droid.cpp
dom/plugins/test/testplugin/nptest_gtk2.cpp
dom/plugins/test/testplugin/nptest_macosx.mm
dom/plugins/test/testplugin/nptest_platform.h
dom/plugins/test/testplugin/nptest_qt.cpp
dom/plugins/test/testplugin/nptest_windows.cpp
--- a/dom/plugins/base/npapi.h
+++ b/dom/plugins/base/npapi.h
@@ -54,17 +54,17 @@
 #include <QRegion>
 #endif
 
 /*----------------------------------------------------------------------*/
 /*                        Plugin Version Constants                      */
 /*----------------------------------------------------------------------*/
 
 #define NP_VERSION_MAJOR 0
-#define NP_VERSION_MINOR 27
+#define NP_VERSION_MINOR 28
 
 
 /* The OS/2 version of Netscape uses RC_DATA to define the
    mime types, file extensions, etc that are required.
    Use a vertical bar to separate types, end types with \0.
    FileVersion and ProductVersion are 32bit ints, all other
    entries are strings that MUST be terminated with a \0.
 
@@ -181,43 +181,16 @@ typedef struct _NPSize
   int32_t height;
 } NPSize;
 
 typedef enum {
   NPFocusNext = 0,
   NPFocusPrevious = 1
 } NPFocusDirection;
 
-/* These formats describe the format in the memory byte-order. This means if
- * a 32-bit value of a pixel is viewed on a little-endian system the layout will
- * be 0xAARRGGBB. The Alpha channel will be stored in the most significant
- * bits. */
-typedef enum {
-  /* 32-bit per pixel 8-bit per channel - premultiplied alpha */
-  NPImageFormatBGRA32     = 0x1,
-  /* 32-bit per pixel 8-bit per channel - 1 unused channel */
-  NPImageFormatBGRX32     = 0x2 
-} NPImageFormat;
-
-typedef struct _NPAsyncSurface
-{
-  uint32_t version;
-  NPSize size;
-  NPImageFormat format;
-  union {
-    struct {
-      uint32_t stride;
-      void *data;
-    } bitmap;
-#if defined(XP_WIN)
-    HANDLE sharedHandle;
-#endif
-  };
-} NPAsyncSurface;
-
 /* Return values for NPP_HandleEvent */
 #define kNPEventNotHandled 0
 #define kNPEventHandled 1
 /* Exact meaning must be spec'd in event model. */
 #define kNPEventStartIME 2
 
 #if defined(XP_UNIX)
 /*
@@ -254,34 +227,37 @@ typedef struct
 {
   int32_t type;
   FILE* fp;
 } NPPrintCallbackStruct;
 
 #endif /* XP_UNIX */
 
 typedef enum {
+  NPDrawingModelDUMMY
 #if defined(XP_MACOSX)
 #ifndef NP_NO_QUICKDRAW
-  NPDrawingModelQuickDraw = 0,
+  , NPDrawingModelQuickDraw = 0
 #endif
-  NPDrawingModelCoreGraphics = 1,
-  NPDrawingModelOpenGL = 2,
-  NPDrawingModelCoreAnimation = 3,
-  NPDrawingModelInvalidatingCoreAnimation = 4,
+  , NPDrawingModelCoreGraphics = 1
+  , NPDrawingModelOpenGL = 2
+  , NPDrawingModelCoreAnimation = 3
+  , NPDrawingModelInvalidatingCoreAnimation = 4
 #endif
 #if defined(XP_WIN)
-  NPDrawingModelSyncWin = 5,
+  , NPDrawingModelSyncWin = 5
 #endif
 #if defined(MOZ_X11)
-  NPDrawingModelSyncX = 6,
+  , NPDrawingModelSyncX = 6
 #endif
-  NPDrawingModelAsyncBitmapSurface = 7
+#if 0 /* OBSOLETE */
+  , NPDrawingModelAsyncBitmapSurfaceOBSOLETE = 7
 #if defined(XP_WIN)
-  , NPDrawingModelAsyncWindowsDXGISurface = 8
+  , NPDrawingModelAsyncWindowsDXGISurfaceOBSOLETE = 8
+#endif
 #endif
 } NPDrawingModel;
 
 #ifdef XP_MACOSX
 typedef enum {
 #ifndef NP_NO_CARBON
   NPEventModelCarbon = 0,
 #endif
@@ -415,19 +391,21 @@ typedef enum {
 #ifndef NP_NO_QUICKDRAW
   , NPNVsupportsQuickDrawBool = 2000
 #endif
   , NPNVsupportsCoreGraphicsBool = 2001
   , NPNVsupportsOpenGLBool = 2002
   , NPNVsupportsCoreAnimationBool = 2003
   , NPNVsupportsInvalidatingCoreAnimationBool = 2004
 #endif
-  , NPNVsupportsAsyncBitmapSurfaceBool = 2007
+#if 0 /* OBSOLETE */
+  , NPNVsupportsAsyncBitmapSurfaceBoolOBSOLETE = 2007
 #if defined(XP_WIN)
-  , NPNVsupportsAsyncWindowsDXGISurfaceBool = 2008
+  , NPNVsupportsAsyncWindowsDXGISurfaceBoolOBSOLETE = 2008
+#endif
 #endif
 #if defined(XP_MACOSX)
 #ifndef NP_NO_CARBON
   , NPNVsupportsCarbonBool = 3000 /* TRUE if the browser supports the Carbon event model */
 #endif
   , NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */
   , NPNVsupportsUpdatedCocoaTextInputBool = 3002 /* TRUE if the browser supports the updated
                                                     Cocoa text input specification. */
@@ -862,21 +840,16 @@ NPError     NPN_GetAuthenticationInfo(NP
                                       uint32_t *plen);
 uint32_t    NPN_ScheduleTimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
 void        NPN_UnscheduleTimer(NPP instance, uint32_t timerID);
 NPError     NPN_PopUpContextMenu(NPP instance, NPMenu* menu);
 NPBool      NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
 NPBool      NPN_HandleEvent(NPP instance, void *event, NPBool handled);
 NPBool      NPN_UnfocusInstance(NPP instance, NPFocusDirection direction);
 void        NPN_URLRedirectResponse(NPP instance, void* notifyData, NPBool allow);
-NPError     NPN_InitAsyncSurface(NPP instance, NPSize *size,
-                                 NPImageFormat format, void *initData,
-                                 NPAsyncSurface *surface);
-NPError     NPN_FinalizeAsyncSurface(NPP instance, NPAsyncSurface *surface);
-void        NPN_SetCurrentAsyncSurface(NPP instance, NPAsyncSurface *surface, NPRect *changed);
 
 #ifdef __cplusplus
 }  /* end extern "C" */
 #endif
 
 #endif /* RC_INVOKED */
 
 #endif /* npapi_h_ */
--- a/dom/plugins/base/npfunctions.h
+++ b/dom/plugins/base/npfunctions.h
@@ -87,19 +87,18 @@ typedef NPError      (*NPN_SetValueForUR
 typedef NPError      (*NPN_GetAuthenticationInfoPtr)(NPP npp, const char *protocol, const char *host, int32_t port, const char *scheme, const char *realm, char **username, uint32_t *ulen, char **password, uint32_t *plen);
 typedef uint32_t     (*NPN_ScheduleTimerPtr)(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
 typedef void         (*NPN_UnscheduleTimerPtr)(NPP instance, uint32_t timerID);
 typedef NPError      (*NPN_PopUpContextMenuPtr)(NPP instance, NPMenu* menu);
 typedef NPBool       (*NPN_ConvertPointPtr)(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
 typedef NPBool       (*NPN_HandleEventPtr)(NPP instance, void *event, NPBool handled);
 typedef NPBool       (*NPN_UnfocusInstancePtr)(NPP instance, NPFocusDirection direction);
 typedef void         (*NPN_URLRedirectResponsePtr)(NPP instance, void* notifyData, NPBool allow);
-typedef NPError      (*NPN_InitAsyncSurfacePtr)(NPP instance, NPSize *size, NPImageFormat format, void *initData, NPAsyncSurface *surface);
-typedef NPError      (*NPN_FinalizeAsyncSurfacePtr)(NPP instance, NPAsyncSurface *surface);
-typedef void         (*NPN_SetCurrentAsyncSurfacePtr)(NPP instance, NPAsyncSurface *surface, NPRect *changed);
+
+typedef void         (*NPN_DummyPtr)(void);
 
 typedef struct _NPPluginFuncs {
   uint16_t size;
   uint16_t version;
   NPP_NewProcPtr newp;
   NPP_DestroyProcPtr destroy;
   NPP_SetWindowProcPtr setwindow;
   NPP_NewStreamProcPtr newstream;
@@ -174,19 +173,19 @@ typedef struct _NPNetscapeFuncs {
   NPN_GetAuthenticationInfoPtr getauthenticationinfo;
   NPN_ScheduleTimerPtr scheduletimer;
   NPN_UnscheduleTimerPtr unscheduletimer;
   NPN_PopUpContextMenuPtr popupcontextmenu;
   NPN_ConvertPointPtr convertpoint;
   NPN_HandleEventPtr handleevent;
   NPN_UnfocusInstancePtr unfocusinstance;
   NPN_URLRedirectResponsePtr urlredirectresponse;
-  NPN_InitAsyncSurfacePtr initasyncsurface;
-  NPN_FinalizeAsyncSurfacePtr finalizeasyncsurface;
-  NPN_SetCurrentAsyncSurfacePtr setcurrentasyncsurface;
+  NPN_DummyPtr initasyncsurfaceOBSOLETE;
+  NPN_DummyPtr finalizeasyncsurfaceOBSOLETE;
+  NPN_DummyPtr setcurrentasyncsurfaceOBSOLETE;
 } NPNetscapeFuncs;
 
 #ifdef XP_MACOSX
 /*
  * Mac OS X version(s) of NP_GetMIMEDescription(const char *)
  * These can be called to retreive MIME information from the plugin dynamically
  *
  * Note: For compatibility with Quicktime, BPSupportedMIMEtypes is another way
--- a/dom/plugins/base/nsIPluginInstanceOwner.idl
+++ b/dom/plugins/base/nsIPluginInstanceOwner.idl
@@ -21,17 +21,17 @@ enum nsPluginTagType {
   nsPluginTagType_Applet
 };
 %}
 
 [ptr] native nsNPAPIPluginInstancePtr(nsNPAPIPluginInstance);
 
 // Do not make this interface scriptable, because the virtual functions in C++
 // blocks will make script call the wrong functions.
-[uuid(59BE4CA5-3CB0-40E6-A111-9A88C8477610)]
+[uuid(c4e26e5d-7a9b-4900-b567-e128c4be6e31)]
 interface nsIPluginInstanceOwner : nsISupports
 {
   /**
    * Let the owner know what its instance is
    */
   void setInstance(in nsNPAPIPluginInstancePtr aInstance);
 
   /**
@@ -105,20 +105,16 @@ interface nsIPluginInstanceOwner : nsISu
 
   /**
    * Show native context menu
    */
 %{C++
   virtual NPError ShowNativeContextMenu(NPMenu* menu, void* event) = 0;
   virtual NPBool  ConvertPoint(double sourceX, double sourceY, NPCoordinateSpace sourceSpace,
                                double *destX, double *destY, NPCoordinateSpace destSpace) = 0;
-  virtual NPError InitAsyncSurface(NPSize *size, NPImageFormat format,
-                                   void *initData, NPAsyncSurface *surface) = 0;
-  virtual NPError FinalizeAsyncSurface(NPAsyncSurface *surface) = 0;
-  virtual void SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *changed) = 0;
 %}
 
   void setEventModel(in int32_t eventModel);
 
   /**
    * Call NPP_SetWindow on the plugin.
    */
   void callSetWindow();
--- a/dom/plugins/base/nsNPAPIPlugin.cpp
+++ b/dom/plugins/base/nsNPAPIPlugin.cpp
@@ -159,20 +159,17 @@ static NPNetscapeFuncs sBrowserFuncs = {
   _setvalueforurl,
   _getauthenticationinfo,
   _scheduletimer,
   _unscheduletimer,
   _popupcontextmenu,
   _convertpoint,
   nullptr, // handleevent, unimplemented
   nullptr, // unfocusinstance, unimplemented
-  _urlredirectresponse,
-  _initasyncsurface,
-  _finalizeasyncsurface,
-  _setcurrentasyncsurface
+  _urlredirectresponse
 };
 
 static Mutex *sPluginThreadAsyncCallLock = nullptr;
 static PRCList sPendingAsyncCalls = PR_INIT_STATIC_CLIST(&sPendingAsyncCalls);
 
 // POST/GET stream type
 enum eNPPStreamTypeInternal {
   eNPPStreamTypeInternal_Get,
@@ -2772,46 +2769,16 @@ NPError
 {
   nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata;
   if (!inst)
     return NPERR_GENERIC_ERROR;
 
   return inst->PopUpContextMenu(menu);
 }
 
-NPError
-_initasyncsurface(NPP instance, NPSize *size, NPImageFormat format, void *initData, NPAsyncSurface *surface)
-{
-  nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata;
-  if (!inst)
-    return NPERR_GENERIC_ERROR;
-
-  return inst->InitAsyncSurface(size, format, initData, surface);
-}
-
-NPError
-_finalizeasyncsurface(NPP instance, NPAsyncSurface *surface)
-{
-  nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata;
-  if (!inst)
-    return NPERR_GENERIC_ERROR;
-
-  return inst->FinalizeAsyncSurface(surface);
-}
-
-void
-_setcurrentasyncsurface(NPP instance, NPAsyncSurface *surface, NPRect *changed)
-{
-  nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata;
-  if (!inst)
-    return;
-
-  inst->SetCurrentAsyncSurface(surface, changed);
-}
-
 NPBool
 _convertpoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace)
 {
   nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata;
   if (!inst)
     return false;
 
   return inst->ConvertPoint(sourceX, sourceY, sourceSpace, destX, destY, destSpace);
--- a/dom/plugins/base/nsNPAPIPlugin.h
+++ b/dom/plugins/base/nsNPAPIPlugin.h
@@ -242,25 +242,16 @@ uint32_t
 _scheduletimer(NPP instance, uint32_t interval, NPBool repeat, PluginTimerFunc timerFunc);
 
 void
 _unscheduletimer(NPP instance, uint32_t timerID);
 
 NPError
 _popupcontextmenu(NPP instance, NPMenu* menu);
 
-NPError
-_initasyncsurface(NPP instance, NPSize *size, NPImageFormat format, void *initData, NPAsyncSurface *surface);
-
-NPError
-_finalizeasyncsurface(NPP instance, NPAsyncSurface *surface);
-
-void
-_setcurrentasyncsurface(NPP instance, NPAsyncSurface *surface, NPRect *changed);
-
 NPBool
 _convertpoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
 
 NPError
 _requestread(NPStream *pstream, NPByteRange *rangeList);
 
 NPError
 _geturlnotify(NPP npp, const char* relativeURL, const char* target,
--- a/dom/plugins/base/nsNPAPIPluginInstance.cpp
+++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp
@@ -1642,42 +1642,16 @@ nsNPAPIPluginInstance::URLRedirectRespon
   for (uint32_t i = 0; i < listenerCount; i++) {
     nsNPAPIPluginStreamListener* currentListener = mStreamListeners[i];
     if (currentListener->GetNotifyData() == notifyData) {
       currentListener->URLRedirectResponse(allow);
     }
   }
 }
 
-NPError
-nsNPAPIPluginInstance::InitAsyncSurface(NPSize *size, NPImageFormat format,
-                                        void *initData, NPAsyncSurface *surface)
-{
-  if (mOwner)
-    return mOwner->InitAsyncSurface(size, format, initData, surface);
-
-  return NPERR_GENERIC_ERROR;
-}
-
-NPError
-nsNPAPIPluginInstance::FinalizeAsyncSurface(NPAsyncSurface *surface)
-{
-  if (mOwner)
-    return mOwner->FinalizeAsyncSurface(surface);
-
-  return NPERR_GENERIC_ERROR;
-}
-
-void
-nsNPAPIPluginInstance::SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *changed)
-{
-  if (mOwner)
-    mOwner->SetCurrentAsyncSurface(surface, changed);
-}
-
 class CarbonEventModelFailureEvent : public nsRunnable {
 public:
   nsCOMPtr<nsIContent> mContent;
 
   explicit CarbonEventModelFailureEvent(nsIContent* aContent)
     : mContent(aContent)
   {}
 
--- a/dom/plugins/base/nsNPAPIPluginInstance.h
+++ b/dom/plugins/base/nsNPAPIPluginInstance.h
@@ -269,21 +269,16 @@ public:
   nsTArray<nsNPAPIPluginStreamListener*> *StreamListeners();
 
   nsTArray<nsPluginStreamListenerPeer*> *FileCachedStreamListeners();
 
   nsresult AsyncSetWindow(NPWindow& window);
 
   void URLRedirectResponse(void* notifyData, NPBool allow);
 
-  NPError InitAsyncSurface(NPSize *size, NPImageFormat format,
-                           void *initData, NPAsyncSurface *surface);
-  NPError FinalizeAsyncSurface(NPAsyncSurface *surface);
-  void SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *changed);
-
   // Called when the instance fails to instantiate beceause the Carbon
   // event model is not supported.
   void CarbonNPAPIFailure();
 
   // Returns the contents scale factor of the screen the plugin is drawn on.
   double GetContentsScaleFactor();
 
   static bool InPluginCallUnsafeForReentry() { return gInUnsafePluginCalls > 0; }
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -754,31 +754,16 @@ NPBool nsPluginInstanceOwner::ConvertPoi
   return NS_NPAPI_ConvertPointCocoa(mWidget->GetNativeData(NS_NATIVE_WIDGET),
                                     sourceX, sourceY, sourceSpace, destX, destY, destSpace);
 #else
   // we should implement this for all platforms
   return false;
 #endif
 }
 
-NPError nsPluginInstanceOwner::InitAsyncSurface(NPSize *size, NPImageFormat format,
-                                                void *initData, NPAsyncSurface *surface)
-{
-  return NPERR_INCOMPATIBLE_VERSION_ERROR;
-}
-
-NPError nsPluginInstanceOwner::FinalizeAsyncSurface(NPAsyncSurface *)
-{
-  return NPERR_INCOMPATIBLE_VERSION_ERROR;
-}
-
-void nsPluginInstanceOwner::SetCurrentAsyncSurface(NPAsyncSurface *, NPRect*)
-{
-}
-
 NS_IMETHODIMP nsPluginInstanceOwner::GetTagType(nsPluginTagType *result)
 {
   NS_ENSURE_ARG_POINTER(result);
 
   *result = nsPluginTagType_Unknown;
 
   nsIAtom *atom = mContent->Tag();
 
--- a/dom/plugins/base/nsPluginInstanceOwner.h
+++ b/dom/plugins/base/nsPluginInstanceOwner.h
@@ -62,21 +62,16 @@ public:
   
   NS_IMETHOD ShowStatus(const char16_t *aStatusMsg) MOZ_OVERRIDE;
   
   NPError    ShowNativeContextMenu(NPMenu* menu, void* event) MOZ_OVERRIDE;
   
   NPBool     ConvertPoint(double sourceX, double sourceY, NPCoordinateSpace sourceSpace,
                           double *destX, double *destY, NPCoordinateSpace destSpace) MOZ_OVERRIDE;
   
-  virtual NPError InitAsyncSurface(NPSize *size, NPImageFormat format,
-                                   void *initData, NPAsyncSurface *surface) MOZ_OVERRIDE;
-  virtual NPError FinalizeAsyncSurface(NPAsyncSurface *surface) MOZ_OVERRIDE;
-  virtual void SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *changed) MOZ_OVERRIDE;
-
   /**
    * Get the type of the HTML tag that was used ot instantiate this
    * plugin.  Currently supported tags are EMBED, OBJECT and APPLET.
    */
   NS_IMETHOD GetTagType(nsPluginTagType *aResult);
 
   void GetParameters(nsTArray<mozilla::dom::MozPluginParameter>& parameters);
   void GetAttributes(nsTArray<mozilla::dom::MozPluginParameter>& attributes);
--- a/dom/plugins/ipc/PPluginInstance.ipdl
+++ b/dom/plugins/ipc/PPluginInstance.ipdl
@@ -12,28 +12,25 @@ include protocol PStreamNotify;
 include protocol PPluginSurface;
 
 include "mozilla/GfxMessageUtils.h";
 
 using NPError from "npapi.h";
 using struct mozilla::plugins::NPRemoteWindow from "mozilla/plugins/PluginMessageUtils.h";
 using struct mozilla::plugins::NPRemoteEvent from "mozilla/plugins/PluginMessageUtils.h";
 using NPRect from "npapi.h";
-using NPImageFormat from "npapi.h";
 using NPNURLVariable from "npapi.h";
 using NPCoordinateSpace from "npapi.h";
 using NPNVariable from "npapi.h";
 using mozilla::plugins::NativeWindowHandle from "mozilla/plugins/PluginMessageUtils.h";
 using gfxSurfaceType from "gfxTypes.h";
 using gfxIntSize from "nsSize.h";
 using struct mozilla::null_t from "ipc/IPCMessageUtils.h";
 using mozilla::plugins::WindowsSharedMemoryHandle from "mozilla/plugins/PluginMessageUtils.h";
-using mozilla::plugins::DXGISharedSurfaceHandle from "mozilla/plugins/PluginMessageUtils.h";
-using mozilla::CrossProcessMutexHandle from "mozilla/ipc/CrossProcessMutex.h";
-using struct SurfaceDescriptorX11 from "gfxipc/ShadowLayerUtils.h";
+using mozilla::layers::SurfaceDescriptorX11 from "gfxipc/ShadowLayerUtils.h";
 using struct nsIntRect from "nsRect.h";
 
 namespace mozilla {
 namespace plugins {
 
 struct IOSurfaceDescriptor {
   uint32_t surfaceId;
   double contentsScaleFactor;
@@ -52,31 +49,16 @@ union SurfaceDescriptor {
   null_t;
 };
 
 union OptionalShmem {
   Shmem;
   null_t;
 };
 
-union AsyncSurfaceDescriptor {
-  Shmem;
-  DXGISharedSurfaceHandle;
-};
-
-struct NPRemoteAsyncSurface
-{
-  uint32_t version;
-  gfxIntSize size;
-  NPImageFormat format;
-  uint32_t      stride;
-  AsyncSurfaceDescriptor data;
-  uintptr_t hostPtr;
-};
-
 intr protocol PPluginInstance
 {
   manager PPluginModule;
 
   manages PPluginBackgroundDestroyer;
   manages PPluginScriptableObject;
   manages PBrowserStream;
   manages PPluginStream;
@@ -157,17 +139,17 @@ parent:
 
   intr NPN_SetValue_NPPVpluginWindow(bool windowed)
     returns (NPError result);
   intr NPN_SetValue_NPPVpluginTransparent(bool transparent)
     returns (NPError result);
   intr NPN_SetValue_NPPVpluginUsesDOMForCursor(bool useDOMForCursor)
     returns (NPError result);
   intr NPN_SetValue_NPPVpluginDrawingModel(int drawingModel)
-    returns (OptionalShmem remoteImageData, CrossProcessMutexHandle mutex, NPError result);
+    returns (NPError result);
   intr NPN_SetValue_NPPVpluginEventModel(int eventModel)
     returns (NPError result);
 
   intr NPN_GetURL(nsCString url, nsCString target)
     returns (NPError result);
   intr NPN_PostURL(nsCString url, nsCString target, nsCString buffer, bool file)
     returns (NPError result);
 
@@ -215,27 +197,21 @@ parent:
     returns (nsCString username, nsCString password, NPError result);
 
   intr NPN_ConvertPoint(double sourceX, bool ignoreDestX, double sourceY, bool ignoreDestY, NPCoordinateSpace sourceSpace,
                        NPCoordinateSpace destSpace)
     returns (double destX, double destY, bool result);
 
   async RedrawPlugin();
 
-  intr NPN_InitAsyncSurface(gfxIntSize size, NPImageFormat format)
-    returns (NPRemoteAsyncSurface surfData, bool result);
-
   // Send notification that a plugin tried to negotiate Carbon NPAPI so that
   // users can be notified that restarting the browser in i386 mode may allow
   // them to use the plugin.
   sync NegotiatedCarbon();
 
-  // Notifies us we can release a Async Surface DXGI texture.
-  async ReleaseDXGISharedSurface(DXGISharedSurfaceHandle handle);
-
 both:
   async PPluginScriptableObject();
 
 child:
   /* NPP_NewStream */
   intr PBrowserStream(nsCString url,
                      uint32_t length,
                      uint32_t lastmodified,
--- a/dom/plugins/ipc/PPluginModule.ipdl
+++ b/dom/plugins/ipc/PPluginModule.ipdl
@@ -44,17 +44,17 @@ both:
   // a nested event loop for the current interrupt call.
   async ProcessNativeEventsInInterruptCall();
 
 child:
   // Forces the child process to update its plugin function table.
   intr NP_GetEntryPoints()
     returns (NPError rv);
 
-  intr NP_Initialize(uint32_t aFlags)
+  intr NP_Initialize()
     returns (NPError rv);
 
   intr PPluginInstance(nsCString aMimeType,
                       uint16_t aMode,
                       nsCString[] aNames,
                       nsCString[] aValues)
     returns (NPError rv);
 
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -120,17 +120,16 @@ CreateDrawTargetForSurface(gfxASurface *
 }
 
 PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface)
     : mPluginIface(aPluginIface)
 #if defined(XP_MACOSX)
     , mContentsScaleFactor(1.0)
 #endif
     , mDrawingModel(kDefaultDrawingModel)
-    , mCurrentAsyncSurface(0)
     , mAsyncInvalidateMutex("PluginInstanceChild::mAsyncInvalidateMutex")
     , mAsyncInvalidateTask(0)
     , mCachedWindowActor(nullptr)
     , mCachedElementActor(nullptr)
 #ifdef MOZ_WIDGET_GTK
     , mXEmbed(false)
 #endif // MOZ_WIDGET_GTK
 #if defined(OS_WIN)
@@ -376,35 +375,16 @@ PluginInstanceChild::NPN_GetValue(NPNVar
         NPError result;
         CallNPN_GetValue_NPNVnetscapeWindow(static_cast<XID*>(aValue), &result);
         return result;
 #else
         return NPERR_GENERIC_ERROR;
 #endif
     }
 
-    case NPNVsupportsAsyncBitmapSurfaceBool: {
-#ifdef XP_WIN
-        *((NPBool*)aValue) = PluginModuleChild::current()->AsyncDrawingAllowed();
-#else
-        // We do not support non-windows yet.
-        *((NPBool*)aValue) = false;
-#endif
-        return NPERR_NO_ERROR;
-    }
-
-#ifdef XP_WIN
-    case NPNVsupportsAsyncWindowsDXGISurfaceBool: {
-        bool val;
-        CallNPN_GetValue_DrawingModelSupport(NPNVsupportsAsyncWindowsDXGISurfaceBool, &val);
-        *((NPBool*)aValue) = val;
-        return NPERR_NO_ERROR;
-    }
-#endif
-
 #ifdef XP_MACOSX
    case NPNVsupportsCoreGraphicsBool: {
         *((NPBool*)aValue) = true;
         return NPERR_NO_ERROR;
     }
 
     case NPNVsupportsCoreAnimationBool: {
         *((NPBool*)aValue) = nsCocoaFeatures::SupportCoreAnimationPlugins();
@@ -538,34 +518,19 @@ PluginInstanceChild::NPN_SetValue(NPPVar
         }
         return rv;
     }
 
     case NPPVpluginDrawingModel: {
         NPError rv;
         int drawingModel = (int16_t) (intptr_t) aValue;
 
-        if (!PluginModuleChild::current()->AsyncDrawingAllowed() &&
-            IsDrawingModelAsync(drawingModel)) {
-            return NPERR_GENERIC_ERROR;
-        }              
-
-        CrossProcessMutexHandle handle;
-        OptionalShmem optionalShmem;
-        if (!CallNPN_SetValue_NPPVpluginDrawingModel(drawingModel, &optionalShmem, &handle, &rv))
+        if (!CallNPN_SetValue_NPPVpluginDrawingModel(drawingModel, &rv))
             return NPERR_GENERIC_ERROR;
 
-        if (IsDrawingModelAsync(drawingModel)) {
-            if (optionalShmem.type() != OptionalShmem::TShmem) {
-                return NPERR_GENERIC_ERROR;
-            }
-            mRemoteImageDataShmem = optionalShmem.get_Shmem();
-            mRemoteImageData = mRemoteImageDataShmem.get<RemoteImageData>();
-            mRemoteImageDataMutex = new CrossProcessMutex(handle);
-        }
         mDrawingModel = drawingModel;
 
 #ifdef XP_MACOSX
         if (drawingModel == NPDrawingModelCoreAnimation) {
             mCARefreshTimer = ScheduleTimer(DEFAULT_REFRESH_MS, true, CAUpdate);
         }
 #endif
 
@@ -2480,222 +2445,16 @@ PluginInstanceChild::NPN_URLRedirectResp
         if (sn->mClosure == notifyData) {
             sn->SendRedirectNotifyResponse(static_cast<bool>(allow));
             return;
         }
     }
     NS_ASSERTION(false, "Couldn't find stream for redirect response!");
 }
 
-NPError
-PluginInstanceChild::DeallocateAsyncBitmapSurface(NPAsyncSurface *aSurface)
-{
-    AsyncBitmapData* data;
-    
-    if (!mAsyncBitmaps.Get(aSurface, &data)) {
-        return NPERR_INVALID_PARAM;
-    }
-
-    DeallocShmem(data->mShmem);
-    aSurface->bitmap.data = nullptr;
-
-    mAsyncBitmaps.Remove(aSurface);
-    return NPERR_NO_ERROR;
-}
-
-bool
-PluginInstanceChild::IsAsyncDrawing()
-{
-    return IsDrawingModelAsync(mDrawingModel);
-}
-
-NPError
-PluginInstanceChild::NPN_InitAsyncSurface(NPSize *size, NPImageFormat format,
-                                          void *initData, NPAsyncSurface *surface)
-{
-    AssertPluginThread();
-
-    surface->bitmap.data = nullptr;
-
-    if (!IsAsyncDrawing()) {
-        return NPERR_GENERIC_ERROR;
-    }
-
-    switch (mDrawingModel) {
-    case NPDrawingModelAsyncBitmapSurface: {
-            if (mAsyncBitmaps.Get(surface, nullptr)) {
-                return NPERR_INVALID_PARAM;
-            }
-
-            if (size->width < 0 || size->height < 0) {
-                return NPERR_INVALID_PARAM;
-            }
-
-
-            bool result;
-            NPRemoteAsyncSurface remote;
-
-            if (!CallNPN_InitAsyncSurface(gfxIntSize(size->width, size->height), format, &remote, &result) || !result) {
-                return NPERR_OUT_OF_MEMORY_ERROR;
-            }
-
-            NS_ABORT_IF_FALSE(remote.data().get_Shmem().IsWritable(),
-                "Failed to create writable shared memory.");
-            
-            AsyncBitmapData *data = new AsyncBitmapData;
-            mAsyncBitmaps.Put(surface, data);
-
-            data->mRemotePtr = (void*)remote.hostPtr();
-            data->mShmem = remote.data().get_Shmem();
-
-            surface->bitmap.data = data->mShmem.get<unsigned char>();
-            surface->bitmap.stride = remote.stride();
-            surface->format = remote.format();
-            surface->size.width = remote.size().width;
-            surface->size.height = remote.size().height;
-
-            return NPERR_NO_ERROR;
-        }
-#ifdef XP_WIN
-    case NPDrawingModelAsyncWindowsDXGISurface: {
-            if (size->width < 0 || size->height < 0) {
-                return NPERR_INVALID_PARAM;
-            }
-            bool result;
-            NPRemoteAsyncSurface remote;
-
-            if (!CallNPN_InitAsyncSurface(gfxIntSize(size->width, size->height), format, &remote, &result) || !result) {
-                return NPERR_OUT_OF_MEMORY_ERROR;
-            }
-
-            surface->format = remote.format();
-            surface->size.width = remote.size().width;
-            surface->size.height = remote.size().height;
-            surface->sharedHandle = remote.data().get_DXGISharedSurfaceHandle();
-
-            return NPERR_NO_ERROR;
-        }
-#endif
-    }
-
-    return NPERR_GENERIC_ERROR;
-}
-
-NPError
-PluginInstanceChild::NPN_FinalizeAsyncSurface(NPAsyncSurface *surface)
-{
-    AssertPluginThread();
-
-    if (!IsAsyncDrawing()) {
-        return NPERR_GENERIC_ERROR;
-    }
-
-    switch (mDrawingModel) {
-    case NPDrawingModelAsyncBitmapSurface: {
-            AsyncBitmapData *bitmapData;
-
-            if (!mAsyncBitmaps.Get(surface, &bitmapData)) {
-                return NPERR_GENERIC_ERROR;
-            }
-
-            {
-                CrossProcessMutexAutoLock autoLock(*mRemoteImageDataMutex);
-                RemoteImageData *data = mRemoteImageData;
-                if (data->mBitmap.mData == bitmapData->mRemotePtr) {
-                    data->mBitmap.mData = nullptr;
-                    data->mSize = IntSize(0, 0);
-                    data->mWasUpdated = true;
-                }
-            }
-
-            return DeallocateAsyncBitmapSurface(surface);
-        }
-#ifdef XP_WIN
-    case NPDrawingModelAsyncWindowsDXGISurface: {
-            
-            {
-                CrossProcessMutexAutoLock autoLock(*mRemoteImageDataMutex);
-                RemoteImageData *data = mRemoteImageData;
-                if (data->mTextureHandle == surface->sharedHandle) {
-                    data->mTextureHandle = nullptr;
-                    data->mSize = IntSize(0, 0);
-                    data->mWasUpdated = true;
-                }
-            }
-
-            SendReleaseDXGISharedSurface(surface->sharedHandle);
-            return NPERR_NO_ERROR;
-        }
-#endif
-    }
-
-    return NPERR_GENERIC_ERROR;
-}
-
-void
-PluginInstanceChild::NPN_SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *changed)
-{
-    if (!IsAsyncDrawing()) {
-        return;
-    }
-
-    RemoteImageData *data = mRemoteImageData;
-
-    if (!surface) {
-        CrossProcessMutexAutoLock autoLock(*mRemoteImageDataMutex);
-        data->mBitmap.mData = nullptr;
-        data->mSize = IntSize(0, 0);
-        data->mWasUpdated = true;
-    } else {
-        switch (mDrawingModel) {
-        case NPDrawingModelAsyncBitmapSurface:
-            {
-                AsyncBitmapData *bitmapData;
-        
-                if (!mAsyncBitmaps.Get(surface, &bitmapData)) {
-                    return;
-                }
-              
-                CrossProcessMutexAutoLock autoLock(*mRemoteImageDataMutex);
-                data->mBitmap.mData = (unsigned char*)bitmapData->mRemotePtr;
-                data->mSize = IntSize(surface->size.width, surface->size.height);
-                data->mFormat = surface->format == NPImageFormatBGRX32 ?
-                                RemoteImageData::BGRX32 : RemoteImageData::BGRA32;
-                data->mBitmap.mStride = surface->bitmap.stride;
-                data->mWasUpdated = true;
-                break;
-            }
-#ifdef XP_WIN
-        case NPDrawingModelAsyncWindowsDXGISurface:
-            {
-                CrossProcessMutexAutoLock autoLock(*mRemoteImageDataMutex);
-                data->mType = RemoteImageData::DXGI_TEXTURE_HANDLE;
-                data->mSize = IntSize(surface->size.width, surface->size.height);
-                data->mFormat = surface->format == NPImageFormatBGRX32 ?
-                                RemoteImageData::BGRX32 : RemoteImageData::BGRA32;
-                data->mTextureHandle = surface->sharedHandle;
-
-                data->mWasUpdated = true;
-                break;
-            }
-#endif
-        }
-    }
-
-    {
-        MutexAutoLock autoLock(mAsyncInvalidateMutex);
-        if (!mAsyncInvalidateTask) {
-            mAsyncInvalidateTask = 
-                NewRunnableMethod<PluginInstanceChild, void (PluginInstanceChild::*)()>
-                    (this, &PluginInstanceChild::DoAsyncRedraw);
-            ProcessChild::message_loop()->PostTask(FROM_HERE, mAsyncInvalidateTask);
-        }
-    }
-}
-
 void
 PluginInstanceChild::DoAsyncRedraw()
 {
     {
         MutexAutoLock autoLock(mAsyncInvalidateMutex);
         mAsyncInvalidateTask = nullptr;
     }
 
@@ -3914,26 +3673,16 @@ PluginInstanceChild::ClearAllSurfaces()
         mCGLayer = nullptr;
     }
 
     mDoubleBufferCARenderer.ClearFrontSurface();
     mDoubleBufferCARenderer.ClearBackSurface();
 #endif
 }
 
-PLDHashOperator
-PluginInstanceChild::DeleteSurface(NPAsyncSurface* surf, nsAutoPtr<AsyncBitmapData> &data, void* userArg)
-{
-    PluginInstanceChild *inst = static_cast<PluginInstanceChild*>(userArg);
-
-    inst->DeallocShmem(data->mShmem);
-
-    return PL_DHASH_REMOVE;
-}
-
 bool
 PluginInstanceChild::AnswerNPP_Destroy(NPError* aResult)
 {
     PLUGIN_LOG_DEBUG_METHOD;
     AssertPluginThread();
     *aResult = NPERR_NO_ERROR;
 
 #if defined(OS_WIN)
@@ -3999,21 +3748,16 @@ PluginInstanceChild::AnswerNPP_Destroy(N
 
     // Pending async calls are discarded, not delivered. This matches the
     // in-process behavior.
     for (uint32_t i = 0; i < mPendingAsyncCalls.Length(); ++i)
         mPendingAsyncCalls[i]->Cancel();
 
     mPendingAsyncCalls.Clear();
     
-    if (mAsyncBitmaps.Count()) {
-        NS_ERROR("Not all AsyncBitmaps were finalized by a plugin!");
-        mAsyncBitmaps.Enumerate(DeleteSurface, this);
-    }
-
 #ifdef MOZ_WIDGET_GTK
     if (mWindow.type == NPWindowTypeWindow && !mXEmbed) {
       xt_client_xloop_destroy();
     }
 #endif
 #if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
     DeleteWindow();
 #endif
--- a/dom/plugins/ipc/PluginInstanceChild.h
+++ b/dom/plugins/ipc/PluginInstanceChild.h
@@ -235,34 +235,26 @@ public:
     void UnscheduleTimer(uint32_t id);
 
     void AsyncCall(PluginThreadCallback aFunc, void* aUserData);
 
     int GetQuirks();
 
     void NPN_URLRedirectResponse(void* notifyData, NPBool allow);
 
-    NPError NPN_InitAsyncSurface(NPSize *size, NPImageFormat format,
-                                 void *initData, NPAsyncSurface *surface);
-    NPError NPN_FinalizeAsyncSurface(NPAsyncSurface *surface);
-
-    void NPN_SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *changed);
-
     void DoAsyncRedraw();
 private:
     friend class PluginModuleChild;
 
     NPError
     InternalGetNPObjectForValue(NPNVariable aValue,
                                 NPObject** aObject);
 
     bool IsAsyncDrawing();
 
-    NPError DeallocateAsyncBitmapSurface(NPAsyncSurface *aSurface);
-
     virtual bool RecvUpdateBackground(const SurfaceDescriptor& aBackground,
                                       const nsIntRect& aRect) MOZ_OVERRIDE;
 
     virtual PPluginBackgroundDestroyerChild*
     AllocPPluginBackgroundDestroyerChild() MOZ_OVERRIDE;
 
     virtual bool
     RecvPPluginBackgroundDestroyerConstructor(PPluginBackgroundDestroyerChild* aActor) MOZ_OVERRIDE;
@@ -360,27 +352,17 @@ private:
 #endif
     const NPPluginFuncs* mPluginIface;
     NPP_t mData;
     NPWindow mWindow;
 #if defined(XP_MACOSX)
     double mContentsScaleFactor;
 #endif
     int16_t               mDrawingModel;
-    NPAsyncSurface* mCurrentAsyncSurface;
-    struct AsyncBitmapData {
-      void *mRemotePtr;
-      Shmem mShmem;
-    };
 
-    static PLDHashOperator DeleteSurface(NPAsyncSurface* surf, nsAutoPtr<AsyncBitmapData> &data, void* userArg);
-    nsClassHashtable<nsPtrHashKey<NPAsyncSurface>, AsyncBitmapData> mAsyncBitmaps;
-    Shmem mRemoteImageDataShmem;
-    mozilla::layers::RemoteImageData *mRemoteImageData;
-    nsAutoPtr<CrossProcessMutex> mRemoteImageDataMutex;
     mozilla::Mutex mAsyncInvalidateMutex;
     CancelableTask *mAsyncInvalidateTask;
 
     // Cached scriptable actors to avoid IPC churn
     PluginScriptableObjectChild* mCachedWindowActor;
     PluginScriptableObjectChild* mCachedElementActor;
 
 #if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -103,23 +103,16 @@ PluginInstanceParent::~PluginInstancePar
 #endif
 #if defined(MOZ_WIDGET_COCOA)
     if (mShWidth != 0 && mShHeight != 0) {
         DeallocShmem(mShSurface);
     }
     if (mShColorSpace)
         ::CGColorSpaceRelease(mShColorSpace);
 #endif
-    if (mRemoteImageDataShmem.IsWritable()) {
-        if (mImageContainer) {
-            mImageContainer->SetRemoteImageData(nullptr, nullptr);
-            mImageContainer->SetCompositionNotifySink(nullptr);
-        }
-        DeallocShmem(mRemoteImageDataShmem);
-    }
 }
 
 bool
 PluginInstanceParent::Init()
 {
     return true;
 }
 
@@ -249,22 +242,16 @@ PluginInstanceParent::InternalGetValueFo
     }
 
     *aValue = nullptr;
     *aResult = result;
     return true;
 }
 
 bool
-PluginInstanceParent::IsAsyncDrawing()
-{
-  return IsDrawingModelAsync(mDrawingModel);
-}
-
-bool
 PluginInstanceParent::AnswerNPN_GetValue_NPNVWindowNPObject(
                                          PPluginScriptableObjectParent** aValue,
                                          NPError* aResult)
 {
     return InternalGetValueForNPObject(NPNVWindowNPObject, aValue, aResult);
 }
 
 bool
@@ -285,27 +272,16 @@ PluginInstanceParent::AnswerNPN_GetValue
     *value = v;
     return true;
 }
 
 bool
 PluginInstanceParent::AnswerNPN_GetValue_DrawingModelSupport(const NPNVariable& model, bool* value)
 {
     *value = false;
-
-#ifdef XP_WIN
-    switch (model) {
-        case NPNVsupportsAsyncWindowsDXGISurfaceBool: {
-            if (gfxWindowsPlatform::GetPlatform()->GetRenderMode() == gfxWindowsPlatform::RENDER_DIRECT2D) {
-                *value = true;
-            }
-        }
-    }
-#endif
-
     return true;
 }
 
 bool
 PluginInstanceParent::AnswerNPN_GetValue_NPNVdocumentOrigin(nsCString* value,
                                                             NPError* result)
 {
     void *v = nullptr;
@@ -354,97 +330,44 @@ public:
 
   virtual void DidComposite() { mInstance->DidComposite(); }
 private:
   PluginInstanceParent *mInstance;
 };
 
 bool
 PluginInstanceParent::AnswerNPN_SetValue_NPPVpluginDrawingModel(
-    const int& drawingModel, OptionalShmem *shmem, CrossProcessMutexHandle *mutex, NPError* result)
+    const int& drawingModel, NPError* result)
 {
-    *shmem = null_t();
-
 #ifdef XP_MACOSX
     if (drawingModel == NPDrawingModelCoreAnimation ||
         drawingModel == NPDrawingModelInvalidatingCoreAnimation) {
         // We need to request CoreGraphics otherwise
         // the nsPluginFrame will try to draw a CALayer
         // that can not be shared across process.
         mDrawingModel = drawingModel;
         *result = mNPNIface->setvalue(mNPP, NPPVpluginDrawingModel,
                                   (void*)NPDrawingModelCoreGraphics);
     } else
 #endif
-    if (drawingModel == NPDrawingModelAsyncBitmapSurface
-#ifdef XP_WIN
-        || drawingModel == NPDrawingModelAsyncWindowsDXGISurface
-#endif
-        ) {
-        ImageContainer *container = GetImageContainer();
-        if (!container) {
-            *result = NPERR_GENERIC_ERROR;
-            return true;
-        }
-
-#ifdef XP_WIN
-        if (drawingModel == NPDrawingModelAsyncWindowsDXGISurface &&
-            gfxWindowsPlatform::GetPlatform()->GetRenderMode() != gfxWindowsPlatform::RENDER_DIRECT2D) {
-            *result = NPERR_GENERIC_ERROR;
-            return true;
-        }
-#endif
-
-        mDrawingModel = drawingModel;
-        *result = mNPNIface->setvalue(mNPP, NPPVpluginDrawingModel,
-                                      reinterpret_cast<void*>(static_cast<uintptr_t>(drawingModel)));
-
-
-        if (*result != NPERR_NO_ERROR) {
-            return true;
-        }
-
-        AllocUnsafeShmem(sizeof(RemoteImageData), SharedMemory::TYPE_BASIC, &mRemoteImageDataShmem);
-
-        *shmem = mRemoteImageDataShmem;
-
-        mRemoteImageDataMutex = new CrossProcessMutex("PluginInstanceParent.mRemoteImageDataMutex");
-
-        *mutex = mRemoteImageDataMutex->ShareToProcess(OtherProcess());
-        container->SetRemoteImageData(mRemoteImageDataShmem.get<RemoteImageData>(), mRemoteImageDataMutex);
-
-        mNotifySink = new NotificationSink(this);
-
-        container->SetCompositionNotifySink(mNotifySink);
-    } else if (
+    if (
 #if defined(XP_WIN)
                drawingModel == NPDrawingModelSyncWin
 #elif defined(XP_MACOSX)
                drawingModel == NPDrawingModelOpenGL ||
                drawingModel == NPDrawingModelCoreGraphics
 #elif defined(MOZ_X11)
                drawingModel == NPDrawingModelSyncX
 #else
                false
 #endif
                ) {
-        *shmem = null_t();
-
         mDrawingModel = drawingModel;
         *result = mNPNIface->setvalue(mNPP, NPPVpluginDrawingModel,
                                       (void*)(intptr_t)drawingModel);
-
-        if (mRemoteImageDataShmem.IsWritable()) {
-            if (mImageContainer) {
-                mImageContainer->SetRemoteImageData(nullptr, nullptr);
-                mImageContainer->SetCompositionNotifySink(nullptr);
-            }
-            DeallocShmem(mRemoteImageDataShmem);
-            mRemoteImageDataMutex = nullptr;
-        }
     } else {
         *result = NPERR_GENERIC_ERROR;
     }
     return true;
 }
 
 bool
 PluginInstanceParent::AnswerNPN_SetValue_NPPVpluginEventModel(
@@ -711,22 +634,16 @@ PluginInstanceParent::GetImageContainer(
         return NS_ERROR_NOT_AVAILABLE;
 
     ImageContainer *container = GetImageContainer();
 
     if (!container) {
         return NS_ERROR_FAILURE;
     }
 
-    if (IsAsyncDrawing()) {
-      NS_IF_ADDREF(container);
-      *aContainer = container;
-      return NS_OK;
-    }
-
 #ifdef XP_MACOSX
     if (ioSurface) {
         nsRefPtr<Image> image = container->CreateImage(ImageFormat::MAC_IOSURFACE);
         if (!image) {
             return NS_ERROR_FAILURE;
         }
 
         NS_ASSERTION(image->GetFormat() == ImageFormat::MAC_IOSURFACE, "Wrong format?");
@@ -1182,22 +1099,16 @@ PluginInstanceParent::NPP_HandleEvent(vo
     double scaleFactor = 1.0;
     mNPNIface->getvalue(mNPP, NPNVcontentsScaleFactor, &scaleFactor);
     npremoteevent.contentsScaleFactor = scaleFactor;
 #endif
     int16_t handled = 0;
 
 #if defined(OS_WIN)
     if (mWindowType == NPWindowTypeDrawable) {
-        if (IsAsyncDrawing()) {
-            if (npevent->event == WM_PAINT || npevent->event == DoublePassRenderingEvent()) {
-                // This plugin maintains its own async drawing.
-                return handled;
-            }
-        }
         if (DoublePassRenderingEvent() == npevent->event) {
             return CallPaint(npremoteevent, &handled) && handled;
         }
 
         switch (npevent->event) {
             case WM_PAINT:
             {
                 RECT rect;
@@ -1687,83 +1598,16 @@ PluginInstanceParent::AnswerNPN_ConvertP
                                       ignoreDestX ? nullptr : destX,
                                       ignoreDestY ? nullptr : destY,
                                       destSpace);
 
     return true;
 }
 
 bool
-PluginInstanceParent::AnswerNPN_InitAsyncSurface(const gfxIntSize& size,
-                                                 const NPImageFormat& format,
-                                                 NPRemoteAsyncSurface* surfData,
-                                                 bool* result)
-{
-    if (!IsAsyncDrawing()) {
-        *result = false;
-        return true;
-    }
-
-    switch (mDrawingModel) {
-    case NPDrawingModelAsyncBitmapSurface: {
-            Shmem sharedMem;
-            if (!AllocUnsafeShmem(size.width * size.height * 4, SharedMemory::TYPE_BASIC, &sharedMem)) {
-                *result = false;
-                return true;
-            }
-
-            surfData->size() = size;
-            surfData->hostPtr() = (uintptr_t)sharedMem.get<unsigned char>();
-            surfData->stride() = size.width * 4;
-            surfData->format() = format;
-            surfData->data() = sharedMem;
-            *result = true;
-            return true;
-        }
-#ifdef XP_WIN
-    case NPDrawingModelAsyncWindowsDXGISurface: {
-            ID3D10Device1 *device = gfxWindowsPlatform::GetPlatform()->GetD3D10Device();
-
-            nsRefPtr<ID3D10Texture2D> texture;
-
-            CD3D10_TEXTURE2D_DESC desc(DXGI_FORMAT_B8G8R8A8_UNORM, size.width, size.height, 1, 1);
-            desc.MiscFlags = D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX;
-            desc.BindFlags = D3D10_BIND_RENDER_TARGET | D3D10_BIND_SHADER_RESOURCE;
-            if (FAILED(device->CreateTexture2D(&desc, nullptr, getter_AddRefs(texture)))) {
-                *result = false;
-                return true;
-            }
-
-            nsRefPtr<IDXGIResource> resource;
-            if (FAILED(texture->QueryInterface(IID_IDXGIResource, getter_AddRefs(resource)))) {
-                *result = false;
-                return true;
-            }
-
-            HANDLE sharedHandle;
-
-            if (FAILED(resource->GetSharedHandle(&sharedHandle))) {
-                *result = false;
-                return true;
-            }
-
-            surfData->size() = size;
-            surfData->data() = sharedHandle;
-            surfData->format() = format;
-
-            mTextureMap.Put(sharedHandle, texture);
-            *result = true;
-        }
-#endif
-    }
-
-    return true;
-}
-
-bool
 PluginInstanceParent::RecvRedrawPlugin()
 {
     nsNPAPIPluginInstance *inst = static_cast<nsNPAPIPluginInstance*>(mNPP->ndata);
     if (!inst) {
         return false;
     }
 
     inst->RedrawPlugin();
@@ -1776,25 +1620,16 @@ PluginInstanceParent::RecvNegotiatedCarb
     nsNPAPIPluginInstance *inst = static_cast<nsNPAPIPluginInstance*>(mNPP->ndata);
     if (!inst) {
         return false;
     }
     inst->CarbonNPAPIFailure();
     return true;
 }
 
-bool
-PluginInstanceParent::RecvReleaseDXGISharedSurface(const DXGISharedSurfaceHandle &aHandle)
-{
-#ifdef XP_WIN
-    mTextureMap.Remove(aHandle);
-#endif
-    return true;
-}
-
 #if defined(OS_WIN)
 
 /*
   plugin focus changes between processes
 
   focus from dom -> child:
     Focus manager calls on widget to set the focus on the window.
     We pick up the resulting wm_setfocus event here, and forward
--- a/dom/plugins/ipc/PluginInstanceParent.h
+++ b/dom/plugins/ipc/PluginInstanceParent.h
@@ -114,18 +114,16 @@ public:
     virtual bool
     AnswerNPN_SetValue_NPPVpluginTransparent(const bool& transparent,
                                              NPError* result) MOZ_OVERRIDE;
     virtual bool
     AnswerNPN_SetValue_NPPVpluginUsesDOMForCursor(const bool& useDOMForCursor,
                                                   NPError* result) MOZ_OVERRIDE;
     virtual bool
     AnswerNPN_SetValue_NPPVpluginDrawingModel(const int& drawingModel,
-                                              OptionalShmem *remoteImageData,
-                                              CrossProcessMutexHandle *mutex,
                                               NPError* result) MOZ_OVERRIDE;
     virtual bool
     AnswerNPN_SetValue_NPPVpluginEventModel(const int& eventModel,
                                              NPError* result) MOZ_OVERRIDE;
 
     virtual bool
     AnswerNPN_GetURL(const nsCString& url, const nsCString& target,
                      NPError *result) MOZ_OVERRIDE;
@@ -202,29 +200,21 @@ public:
                            const bool&   ignoreDestY,
                            const NPCoordinateSpace& sourceSpace,
                            const NPCoordinateSpace& destSpace,
                            double *destX,
                            double *destY,
                            bool *result) MOZ_OVERRIDE;
 
     virtual bool
-    AnswerNPN_InitAsyncSurface(const gfxIntSize& size,
-                               const NPImageFormat& format,
-                               NPRemoteAsyncSurface* surfData,
-                               bool* result) MOZ_OVERRIDE;
-
-    virtual bool
     RecvRedrawPlugin() MOZ_OVERRIDE;
 
     virtual bool
     RecvNegotiatedCarbon() MOZ_OVERRIDE;
 
-    virtual bool RecvReleaseDXGISharedSurface(const DXGISharedSurfaceHandle &aHandle) MOZ_OVERRIDE;
-
     NPError NPP_SetWindow(const NPWindow* aWindow);
 
     NPError NPP_GetValue(NPPVariable variable, void* retval);
     NPError NPP_SetValue(NPNVariable variable, void* value);
 
     void NPP_URLRedirectNotify(const char* url, int32_t status,
                                void* notifyData);
 
@@ -296,25 +286,21 @@ private:
 
     virtual bool
     DeallocPPluginBackgroundDestroyerParent(PPluginBackgroundDestroyerParent* aActor) MOZ_OVERRIDE;
 
     bool InternalGetValueForNPObject(NPNVariable aVariable,
                                      PPluginScriptableObjectParent** aValue,
                                      NPError* aResult);
 
-    bool IsAsyncDrawing();
-
 private:
     PluginModuleParent* mParent;
     NPP mNPP;
     const NPNetscapeFuncs* mNPNIface;
     NPWindowType mWindowType;
-    Shmem mRemoteImageDataShmem;
-    nsAutoPtr<CrossProcessMutex> mRemoteImageDataMutex;
     int16_t            mDrawingModel;
     nsAutoPtr<mozilla::layers::CompositionNotifySink> mNotifySink;
 
     nsDataHashtable<nsPtrHashKey<NPObject>, PluginScriptableObjectParent*> mScriptableObjects;
 
 #if defined(OS_WIN)
 private:
     // Used in rendering windowless plugins in other processes.
--- a/dom/plugins/ipc/PluginMessageUtils.h
+++ b/dom/plugins/ipc/PluginMessageUtils.h
@@ -49,26 +49,16 @@ MediateRace(const mozilla::ipc::MessageC
 
 std::string
 MungePluginDsoPath(const std::string& path);
 std::string
 UnmungePluginDsoPath(const std::string& munged);
 
 extern PRLogModuleInfo* GetPluginLog();
 
-const uint32_t kAllowAsyncDrawing = 0x1;
-
-inline bool IsDrawingModelAsync(int16_t aModel) {
-  return aModel == NPDrawingModelAsyncBitmapSurface
-#ifdef XP_WIN
-         || aModel == NPDrawingModelAsyncWindowsDXGISurface
-#endif
-         ;
-}
-
 #if defined(_MSC_VER)
 #define FULLFUNCTION __FUNCSIG__
 #elif defined(__GNUC__)
 #define FULLFUNCTION __PRETTY_FUNCTION__
 #else
 #define FULLFUNCTION __FUNCTION__
 #endif
 
@@ -333,42 +323,16 @@ struct ParamTraits<NPWindowType>
 
   static void Log(const paramType& aParam, std::wstring* aLog)
   {
     aLog->append(StringPrintf(L"%d", int16_t(aParam)));
   }
 };
 
 template <>
-struct ParamTraits<NPImageFormat>
-{
-  typedef NPImageFormat paramType;
-
-  static void Write(Message* aMsg, const paramType& aParam)
-  {
-    aMsg->WriteInt16(int16_t(aParam));
-  }
-
-  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
-  {
-    int16_t result;
-    if (aMsg->ReadInt16(aIter, &result)) {
-      *aResult = paramType(result);
-      return true;
-    }
-    return false;
-  }
-
-  static void Log(const paramType& aParam, std::wstring* aLog)
-  {
-    aLog->append(StringPrintf(L"%d", int16_t(aParam)));
-  }
-};
-
-template <>
 struct ParamTraits<mozilla::plugins::NPRemoteWindow>
 {
   typedef mozilla::plugins::NPRemoteWindow paramType;
 
   static void Write(Message* aMsg, const paramType& aParam)
   {
     aMsg->WriteUInt64(aParam.window);
     WriteParam(aMsg, aParam.x);
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -940,27 +940,16 @@ static NPError
 static NPBool
 _convertpoint(NPP instance, 
               double sourceX, double sourceY, NPCoordinateSpace sourceSpace,
               double *destX, double *destY, NPCoordinateSpace destSpace);
 
 static void
 _urlredirectresponse(NPP instance, void* notifyData, NPBool allow);
 
-static NPError
-_initasyncsurface(NPP instance, NPSize *size,
-                  NPImageFormat format, void *initData,
-                  NPAsyncSurface *surface);
-
-static NPError
-_finalizeasyncsurface(NPP instance, NPAsyncSurface *surface);
-
-static void
-_setcurrentasyncsurface(NPP instance, NPAsyncSurface *surface, NPRect *changed);
-
 } /* namespace child */
 } /* namespace plugins */
 } /* namespace mozilla */
 
 const NPNetscapeFuncs PluginModuleChild::sBrowserFuncs = {
     sizeof(sBrowserFuncs),
     (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR,
     mozilla::plugins::child::_geturl,
@@ -1012,20 +1001,17 @@ const NPNetscapeFuncs PluginModuleChild:
     mozilla::plugins::child::_setvalueforurl,
     mozilla::plugins::child::_getauthenticationinfo,
     mozilla::plugins::child::_scheduletimer,
     mozilla::plugins::child::_unscheduletimer,
     mozilla::plugins::child::_popupcontextmenu,
     mozilla::plugins::child::_convertpoint,
     nullptr, // handleevent, unimplemented
     nullptr, // unfocusinstance, unimplemented
-    mozilla::plugins::child::_urlredirectresponse,
-    mozilla::plugins::child::_initasyncsurface,
-    mozilla::plugins::child::_finalizeasyncsurface,
-    mozilla::plugins::child::_setcurrentasyncsurface
+    mozilla::plugins::child::_urlredirectresponse
 };
 
 PluginInstanceChild*
 InstCast(NPP aNPP)
 {
     NS_ABORT_IF_FALSE(!!(aNPP->ndata), "nil instance");
     return static_cast<PluginInstanceChild*>(aNPP->ndata);
 }
@@ -1803,36 +1789,16 @@ NPBool
 }
 
 void
 _urlredirectresponse(NPP instance, void* notifyData, NPBool allow)
 {
     InstCast(instance)->NPN_URLRedirectResponse(notifyData, allow);
 }
 
-NPError
-_initasyncsurface(NPP instance, NPSize *size,
-                  NPImageFormat format, void *initData,
-                  NPAsyncSurface *surface)
-{
-    return InstCast(instance)->NPN_InitAsyncSurface(size, format, initData, surface);
-}
-
-NPError
-_finalizeasyncsurface(NPP instance, NPAsyncSurface *surface)
-{
-    return InstCast(instance)->NPN_FinalizeAsyncSurface(surface);
-}
-
-void
-_setcurrentasyncsurface(NPP instance, NPAsyncSurface *surface, NPRect *changed)
-{
-    InstCast(instance)->NPN_SetCurrentAsyncSurface(surface, changed);
-}
-
 } /* namespace child */
 } /* namespace plugins */
 } /* namespace mozilla */
 
 //-----------------------------------------------------------------------------
 
 bool
 PluginModuleChild::AnswerNP_GetEntryPoints(NPError* _retval)
@@ -1846,23 +1812,21 @@ PluginModuleChild::AnswerNP_GetEntryPoin
     *_retval = mGetEntryPointsFunc(&mFunctions);
     return true;
 #else
 #  error Please implement me for your platform
 #endif
 }
 
 bool
-PluginModuleChild::AnswerNP_Initialize(const uint32_t& aFlags, NPError* _retval)
+PluginModuleChild::AnswerNP_Initialize(NPError* _retval)
 {
     PLUGIN_LOG_DEBUG_METHOD;
     AssertPluginThread();
 
-    mAsyncDrawingAllowed = aFlags & kAllowAsyncDrawing;
-
 #ifdef OS_WIN
     SetEventHooks();
 #endif
 
 #ifdef MOZ_X11
     // Send the parent our X socket to act as a proxy reference for our X
     // resources.
     int xSocketFd = ConnectionNumber(DefaultXDisplay());
--- a/dom/plugins/ipc/PluginModuleChild.h
+++ b/dom/plugins/ipc/PluginModuleChild.h
@@ -70,17 +70,17 @@ protected:
     {
         return MediateRace(parent, child);
     }
 
     virtual bool ShouldContinueFromReplyTimeout() MOZ_OVERRIDE;
 
     // Implement the PPluginModuleChild interface
     virtual bool AnswerNP_GetEntryPoints(NPError* rv) MOZ_OVERRIDE;
-    virtual bool AnswerNP_Initialize(const uint32_t& aFlags, NPError* rv) MOZ_OVERRIDE;
+    virtual bool AnswerNP_Initialize(NPError* rv) MOZ_OVERRIDE;
 
     virtual PPluginIdentifierChild*
     AllocPPluginIdentifierChild(const nsCString& aString,
                                 const int32_t& aInt,
                                 const bool& aTemporary) MOZ_OVERRIDE;
 
     virtual bool
     RecvPPluginIdentifierConstructor(PPluginIdentifierChild* actor,
@@ -178,18 +178,16 @@ public:
     void UnregisterActorForNPObject(NPObject* aObject);
 
     PluginScriptableObjectChild* GetActorForNPObject(NPObject* aObject);
 
 #ifdef DEBUG
     bool NPObjectIsRegistered(NPObject* aObject);
 #endif
 
-    bool AsyncDrawingAllowed() { return mAsyncDrawingAllowed; }
-
     /**
      * The child implementation of NPN_CreateObject.
      */
     static NPObject* NPN_CreateObject(NPP aNPP, NPClass* aClass);
     /**
      * The child implementation of NPN_RetainObject.
      */
     static NPObject* NPN_RetainObject(NPObject* aNPObj);
@@ -310,17 +308,16 @@ private:
     virtual void EnteredCxxStack() MOZ_OVERRIDE;
     virtual void ExitedCxxStack() MOZ_OVERRIDE;
 #endif
 
     PRLibrary* mLibrary;
     nsCString mPluginFilename; // UTF8
     nsCString mUserAgent;
     int mQuirks;
-    bool mAsyncDrawingAllowed;
 
     // we get this from the plugin
     NP_PLUGINSHUTDOWN mShutdownFunc;
 #if defined(OS_LINUX) || defined(OS_BSD)
     NP_PLUGINUNIXINIT mInitializeFunc;
 #elif defined(OS_WIN) || defined(OS_MACOSX)
     NP_PLUGININIT mInitializeFunc;
     NP_GETENTRYPOINTS mGetEntryPointsFunc;
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -1196,19 +1196,17 @@ PluginModuleParent::NP_Initialize(NPNets
 
     mNPNIface = bFuncs;
 
     if (mShutdown) {
         *error = NPERR_GENERIC_ERROR;
         return NS_ERROR_FAILURE;
     }
 
-    uint32_t flags = 0;
-
-    if (!CallNP_Initialize(flags, error)) {
+    if (!CallNP_Initialize(error)) {
         Close();
         return NS_ERROR_FAILURE;
     }
     else if (*error != NPERR_NO_ERROR) {
         Close();
         return NS_OK;
     }
 
@@ -1224,22 +1222,17 @@ PluginModuleParent::NP_Initialize(NPNets
 
     mNPNIface = bFuncs;
 
     if (mShutdown) {
         *error = NPERR_GENERIC_ERROR;
         return NS_ERROR_FAILURE;
     }
 
-    uint32_t flags = 0;
-#ifdef XP_WIN
-    flags |= kAllowAsyncDrawing;
-#endif
-
-    if (!CallNP_Initialize(flags, error)) {
+    if (!CallNP_Initialize(error)) {
         Close();
         return NS_ERROR_FAILURE;
     }
     if (*error != NPERR_NO_ERROR) {
         Close();
         return NS_OK;
     }
 
deleted file mode 100644
--- a/dom/plugins/test/reftest/plugin-async-update-ref.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!doctype html>
-<html><head>
-<title>div boxes</title>
-<style>
-div {
-  width: 400px;
-  height: 400px;
-  display: inline-block;
-}
-</style>
-</head>
-<body>
-<div style="background-color: #00FF00;"></div> <!-- green -->
-</body></html>
deleted file mode 100644
--- a/dom/plugins/test/reftest/plugin-asyncbitmap-sanity.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!doctype html>
-<html><head>
-<title>Plugin boxes</title>
-</head>
-<body>
-<embed type="application/x-test" width="400" height="400" drawmode="solid" color="FFFF0000" asyncmodel="bitmap"></embed> <!-- red -->
-<embed type="application/x-test" width="400" height="400" drawmode="solid" color="FF00FF00" asyncmodel="bitmap"></embed> <!-- green -->
-<embed type="application/x-test" width="400" height="400" drawmode="solid" color="FF0000FF" asyncmodel="bitmap"></embed> <!-- blue -->
-<embed type="application/x-test" width="400" height="400" drawmode="solid" color="FF999999" asyncmodel="bitmap"></embed> <!-- gray -->
-</body></html>
deleted file mode 100644
--- a/dom/plugins/test/reftest/plugin-asyncbitmap-update.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!doctype html>
-<html class="reftest-wait"><head>
-<title>Plugin boxes</title>
-</head>
-<body>
-<embed type="application/x-test" width="400" height="400" drawmode="solid" color="FFFF0000" id="plugin" asyncmodel="bitmap"></embed> <!-- red -->
-<script>
-  var prevPaintCount = 0;
-  function doTestWait() {
-    if (window.mozPaintCount != prevPaintCount) {
-      document.documentElement.removeAttribute('class');
-    } else {
-      setTimeout(doTestWait, 0);
-    }
-  }
-
-  function doTest() {
-    prevPaintCount = window.mozPaintCount;
-    document.getElementById("plugin").setColor("FF00FF00");
-    setTimeout(doTestWait, 0);
-  }
-  window.addEventListener("MozReftestInvalidate", doTest, false);
-</script>
-</body></html>
deleted file mode 100644
--- a/dom/plugins/test/reftest/plugin-asyncdxgi-sanity.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!doctype html>
-<html><head>
-<title>Plugin boxes</title>
-</head>
-<body>
-<embed type="application/x-test" width="400" height="400" drawmode="solid" color="FFFF0000" asyncmodel="dxgi"></embed> <!-- red -->
-<embed type="application/x-test" width="400" height="400" drawmode="solid" color="FF00FF00" asyncmodel="dxgi"></embed> <!-- green -->
-<embed type="application/x-test" width="400" height="400" drawmode="solid" color="FF0000FF" asyncmodel="dxgi"></embed> <!-- blue -->
-<embed type="application/x-test" width="400" height="400" drawmode="solid" color="FF999999" asyncmodel="dxgi"></embed> <!-- gray -->
-</body></html>
deleted file mode 100644
--- a/dom/plugins/test/reftest/plugin-asyncdxgi-update.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!doctype html>
-<html class="reftest-wait"><head>
-<title>Plugin boxes</title>
-</head>
-<body>
-<embed type="application/x-test" width="400" height="400" drawmode="solid" color="FFFF0000" id="plugin" asyncmodel="dxgi"></embed> <!-- red -->
-<script>
-  var prevPaintCount = 0;
-  function doTestWait() {
-    if (window.mozPaintCount != prevPaintCount) {
-      document.documentElement.removeAttribute('class');
-    } else {
-      setTimeout(doTestWait, 0);
-    }
-  }
-
-  function doTest() {
-    prevPaintCount = window.mozPaintCount;
-    document.getElementById("plugin").setColor("FF00FF00");
-    setTimeout(doTestWait, 0);
-  }
-  window.addEventListener("MozReftestInvalidate", doTest, false);
-</script>
-</body></html>
--- a/dom/plugins/test/reftest/reftest.list
+++ b/dom/plugins/test/reftest/reftest.list
@@ -1,16 +1,11 @@
 # basic sanity checking
 random-if(!haveTestPlugin) != plugin-sanity.html about:blank
-random-if(!haveTestPlugin) != plugin-asyncbitmap-sanity.html about:blank
 fails-if(!haveTestPlugin) == plugin-sanity.html div-sanity.html
-fails-if(!haveTestPlugin) == plugin-asyncbitmap-sanity.html div-sanity.html
-fails-if(!haveTestPlugin) == plugin-asyncdxgi-sanity.html div-sanity.html
-random-if(OSX==10.6||OSX==10.7) skip-if(!haveTestPlugin) == plugin-asyncbitmap-update.html plugin-async-update-ref.html
-random-if(OSX==10.6||OSX==10.7) skip-if(!haveTestPlugin) == plugin-asyncdxgi-update.html plugin-async-update-ref.html
 fails-if(!haveTestPlugin) == plugin-alpha-zindex.html div-alpha-zindex.html
 fails-if(!haveTestPlugin) == plugin-alpha-opacity.html div-alpha-opacity.html
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == windowless-clipping-1.html windowless-clipping-1-ref.html # bug 631832
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == border-padding-1.html border-padding-1-ref.html # bug 629430
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == border-padding-2.html border-padding-2-ref.html # bug 629430
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) skip-if(!haveTestPlugin) skip-if(Android||B2G) == border-padding-3.html border-padding-3-ref.html # bug 629430 # bug 773482
 # The following two "pluginproblemui-direction" tests are unreliable on all platforms. They should be re-written or replaced.
 #random-if(cocoaWidget||d2d||/^Windows\x20NT\x205\.1/.test(http.oscpu)) fails-if(!haveTestPlugin&&!Android) skip-if(!testPluginIsOOP()) == pluginproblemui-direction-1.html pluginproblemui-direction-1-ref.html # bug 567367
--- a/dom/plugins/test/testplugin/README
+++ b/dom/plugins/test/testplugin/README
@@ -18,25 +18,16 @@ This rendering method is not supported f
 
 The test plugin supports the following parameters:
 
 * drawmode="solid"
 The plugin will draw a solid color instead of the default rendering described
 above. The default solid color is completely transparent black (i.e., nothing).
 This should be specified when using one of the async models.
 
-* asyncmodel="bitmap"
-The plugin will use the NPAPI Async Bitmap drawing model extension. On
-unsupported platforms this will fallback to non-async rendering.
-
-* asyncmodel="dxgi"
-The plugin will use the NPAPI Async DXGI drawing model extension. Only
-supported on Windows Vista or higher. On unsupported platforms this will
-fallback to non-async rendering.
-
 * color
 This specifies the color to use for drawmode="solid". The value should be 8 hex
 digits, 2 per channel in AARRGGBB format.
 
 == Generic API Tests ==
 
 * setUndefinedValueTest
 Attempts to set the value of an undefined variable (0x0) via NPN_SetValue,
--- a/dom/plugins/test/testplugin/nptest.cpp
+++ b/dom/plugins/test/testplugin/nptest.cpp
@@ -557,49 +557,16 @@ DuplicateNPVariant(NPVariant& aDest, con
       NPN_RetainObject(NPVARIANT_TO_OBJECT(aSrc));
     OBJECT_TO_NPVARIANT(obj, aDest);
   }
   else {
     aDest = aSrc;
   }
 }
 
-void
-drawAsyncBitmapColor(InstanceData* instanceData)
-{
-  NPP npp = instanceData->npp;
-
-  uint32_t *pixelData = (uint32_t*)instanceData->backBuffer->bitmap.data;
-
-  uint32_t rgba = instanceData->scriptableObject->drawColor;
-
-  unsigned char subpixels[4];
-  subpixels[0] = rgba & 0xFF;
-  subpixels[1] = (rgba & 0xFF00) >> 8;
-  subpixels[2] = (rgba & 0xFF0000) >> 16;
-  subpixels[3] = (rgba & 0xFF000000) >> 24;
-
-  subpixels[0] = uint8_t(float(subpixels[3] * subpixels[0]) / 0xFF);
-  subpixels[1] = uint8_t(float(subpixels[3] * subpixels[1]) / 0xFF);
-  subpixels[2] = uint8_t(float(subpixels[3] * subpixels[2]) / 0xFF);
-  uint32_t premultiplied;
-  memcpy(&premultiplied, subpixels, sizeof(premultiplied));
-
-  for (uint32_t* lastPixel = pixelData + instanceData->backBuffer->size.width * instanceData->backBuffer->size.height;
-	pixelData < lastPixel;
-	++pixelData) {
-    *pixelData = premultiplied;
-  }
-
-  NPN_SetCurrentAsyncSurface(npp, instanceData->backBuffer, nullptr);
-  NPAsyncSurface *oldFront = instanceData->frontBuffer;
-  instanceData->frontBuffer = instanceData->backBuffer;
-  instanceData->backBuffer = oldFront;
-}
-
 static bool bug813906(NPP npp, const char* const function, const char* const url, const char* const frame)
 {
   NPObject *windowObj = nullptr;
   NPError err = NPN_GetValue(npp, NPNVWindowNPObject, &windowObj);
   if (err != NPERR_NO_ERROR) {
     return false;
   }
 
@@ -824,19 +791,16 @@ NPP_New(NPMIMEType pluginType, NPP insta
   instanceData->cleanupWidget = true; // only used by nptest_gtk
   instanceData->topLevelWindowActivationState = ACTIVATION_STATE_UNKNOWN;
   instanceData->topLevelWindowActivationEventCount = 0;
   instanceData->focusState = ACTIVATION_STATE_UNKNOWN;
   instanceData->focusEventCount = 0;
   instanceData->eventModel = 0;
   instanceData->closeStream = false;
   instanceData->wantsAllStreams = false;
-  instanceData->asyncDrawing = AD_NONE;
-  instanceData->frontBuffer = nullptr;
-  instanceData->backBuffer = nullptr;
   instanceData->mouseUpEventCount = 0;
   instanceData->bugMode = -1;
   instance->pdata = instanceData;
 
   TestNPObject* scriptableObject = (TestNPObject*)NPN_CreateObject(instance, &sNPClass);
   if (!scriptableObject) {
     printf("NPN_CreateObject failed to create an object, can't create a plugin instance\n");
     delete instanceData;
@@ -865,28 +829,16 @@ NPP_New(NPMIMEType pluginType, NPP insta
     else if (strcmp(argn[i], "color") == 0) {
       scriptableObject->drawColor = parseHexColor(argv[i], strlen(argv[i]));
     }
     else if (strcmp(argn[i], "wmode") == 0) {
       if (strcmp(argv[i], "window") == 0) {
         requestWindow = true;
       }
     }
-    else if (strcmp(argn[i], "asyncmodel") == 0) {
-      if (strcmp(argv[i], "bitmap") == 0) {
-        if (pluginSupportsAsyncBitmapDrawing()) {
-          instanceData->asyncDrawing = AD_BITMAP;
-        }
-      }
-      if (strcmp(argv[i], "dxgi") == 0) {
-        if (pluginSupportsAsyncDXGIDrawing()) {
-          instanceData->asyncDrawing = AD_DXGI;
-        }
-      }
-    }
     if (strcmp(argn[i], "streammode") == 0) {
       if (strcmp(argv[i], "normal") == 0) {
         instanceData->streamMode = NP_NORMAL;
       }
       else if ((strcmp(argv[i], "asfile") == 0) &&
                 strlen(argv[i]) == strlen("asfile")) {
         instanceData->streamMode = NP_ASFILE;
       }
@@ -991,37 +943,16 @@ NPP_New(NPMIMEType pluginType, NPP insta
     NPN_SetValue(instance, NPPVpluginWindowBool, (void*)false);
   }
 
   if (scriptableObject->drawMode == DM_SOLID_COLOR &&
       (scriptableObject->drawColor & 0xFF000000) != 0xFF000000) {
     NPN_SetValue(instance, NPPVpluginTransparentBool, (void*)true);
   }
 
-  if (instanceData->asyncDrawing == AD_BITMAP) {
-    NPBool supportsAsyncBitmap = false;
-    if ((NPN_GetValue(instance, NPNVsupportsAsyncBitmapSurfaceBool, &supportsAsyncBitmap) == NPERR_NO_ERROR) &&
-        supportsAsyncBitmap) {
-      NPN_SetValue(instance, NPPVpluginDrawingModel, (void*)NPDrawingModelAsyncBitmapSurface);
-    } else {
-      instanceData->asyncDrawing = AD_NONE;
-    }
-  }
-#ifdef XP_WIN
-  else if (instanceData->asyncDrawing == AD_DXGI) {
-    NPBool supportsAsyncDXGI = false;
-    if ((NPN_GetValue(instance, NPNVsupportsAsyncWindowsDXGISurfaceBool, &supportsAsyncDXGI) == NPERR_NO_ERROR) &&
-        supportsAsyncDXGI) {
-      NPN_SetValue(instance, NPPVpluginDrawingModel, (void*)NPDrawingModelAsyncWindowsDXGISurface);
-    } else {
-      instanceData->asyncDrawing = AD_NONE;
-    }
-  }
-#endif
-
   instanceData->lastReportedPrivateModeState = false;
   instanceData->lastMouseX = instanceData->lastMouseY = -1;
   instanceData->widthAtLastPaint = -1;
   instanceData->paintCount = 0;
 
   // do platform-specific initialization
   NPError err = pluginInstanceInit(instanceData);
   if (err != NPERR_NO_ERROR) {
@@ -1103,26 +1034,16 @@ NPP_Destroy(NPP instance, NPSavedData** 
   TestRange* currentrange = instanceData->testrange;
   TestRange* nextrange;
   while (currentrange != nullptr) {
     nextrange = reinterpret_cast<TestRange*>(currentrange->next);
     delete currentrange;
     currentrange = nextrange;
   }
 
-  if (instanceData->frontBuffer) {
-    NPN_SetCurrentAsyncSurface(instance, nullptr, nullptr);
-    NPN_FinalizeAsyncSurface(instance, instanceData->frontBuffer);
-    NPN_MemFree(instanceData->frontBuffer);
-  }
-  if (instanceData->backBuffer) {
-    NPN_FinalizeAsyncSurface(instance, instanceData->backBuffer);
-    NPN_MemFree(instanceData->backBuffer);
-  }
-
   pluginInstanceShutdown(instanceData);
   NPN_ReleaseObject(instanceData->scriptableObject);
 
   if (sCurrentInstanceCountWatchGeneration == instanceData->instanceCountWatchGeneration) {
     --sInstanceCount;
   }
   delete instanceData;
 
@@ -1145,46 +1066,16 @@ NPP_SetWindow(NPP instance, NPWindow* wi
   }
 
   void* oldWindow = instanceData->window.window;
   pluginDoSetWindow(instanceData, window);
   if (instanceData->hasWidget && oldWindow != instanceData->window.window) {
     pluginWidgetInit(instanceData, oldWindow);
   }
 
-  if (instanceData->asyncDrawing == AD_BITMAP) {
-    if (instanceData->frontBuffer &&
-	instanceData->frontBuffer->size.width >= 0 &&
-       (uint32_t)instanceData->frontBuffer->size.width == window->width &&
-       instanceData ->frontBuffer->size.height >= 0 &&
-       (uint32_t)instanceData->frontBuffer->size.height == window->height) {
-          return NPERR_NO_ERROR;
-    }
-    if (instanceData->frontBuffer) {
-      NPN_FinalizeAsyncSurface(instance, instanceData->frontBuffer);
-      NPN_MemFree(instanceData->frontBuffer);
-    }
-    if (instanceData->backBuffer) {
-      NPN_FinalizeAsyncSurface(instance, instanceData->backBuffer);
-      NPN_MemFree(instanceData->backBuffer);
-    }
-    instanceData->frontBuffer = (NPAsyncSurface*)NPN_MemAlloc(sizeof(NPAsyncSurface));
-    instanceData->backBuffer = (NPAsyncSurface*)NPN_MemAlloc(sizeof(NPAsyncSurface));
-
-    NPSize size;
-    size.width = window->width;
-    size.height = window->height;
-
-    memcpy(instanceData->backBuffer, instanceData->frontBuffer, sizeof(NPAsyncSurface));
-
-    NPN_InitAsyncSurface(instance, &size, NPImageFormatBGRA32, nullptr, instanceData->frontBuffer);
-    NPN_InitAsyncSurface(instance, &size, NPImageFormatBGRA32, nullptr, instanceData->backBuffer);
-
-    drawAsyncBitmapColor(instanceData);
-  }
   return NPERR_NO_ERROR;
 }
 
 NPError
 NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype)
 {
   InstanceData* instanceData = (InstanceData*)(instance->pdata);
 
@@ -1927,35 +1818,16 @@ NPN_PluginThreadAsyncCall(NPP plugin, vo
 }
 
 void
 NPN_URLRedirectResponse(NPP instance, void* notifyData, NPBool allow)
 {
   return sBrowserFuncs->urlredirectresponse(instance, notifyData, allow);
 }
 
-NPError
-NPN_InitAsyncSurface(NPP instance, NPSize *size, NPImageFormat format,
-                     void *initData, NPAsyncSurface *surface)
-{
-  return sBrowserFuncs->initasyncsurface(instance, size, format, initData, surface);
-}
-
-NPError
-NPN_FinalizeAsyncSurface(NPP instance, NPAsyncSurface *surface)
-{
-  return sBrowserFuncs->finalizeasyncsurface(instance, surface);
-}
-
-void
-NPN_SetCurrentAsyncSurface(NPP instance, NPAsyncSurface *surface, NPRect *changed)
-{
-  sBrowserFuncs->setcurrentasyncsurface(instance, surface, changed);
-}
-
 //
 // npruntime object functions
 //
 
 NPObject*
 scriptableAllocate(NPP npp, NPClass* aClass)
 {
   TestNPObject* object = (TestNPObject*)NPN_MemAlloc(sizeof(TestNPObject));
@@ -2843,26 +2715,17 @@ setColor(NPObject* npobj, const NPVarian
   id->scriptableObject->drawColor =
     parseHexColor(str->UTF8Characters, str->UTF8Length);
 
   NPRect r;
   r.left = 0;
   r.top = 0;
   r.right = id->window.width;
   r.bottom = id->window.height;
-  if (id->asyncDrawing == AD_NONE) {
-    NPN_InvalidateRect(npp, &r);
-  } else if (id->asyncDrawing == AD_BITMAP) {
-    drawAsyncBitmapColor(id);
-  }
-#ifdef XP_WIN
-  else if (id->asyncDrawing == AD_DXGI) {
-    pluginDrawAsyncDxgiColor(id);
-  }
-#endif
+  NPN_InvalidateRect(npp, &r);
 
   VOID_TO_NPVARIANT(*result);
   return true;
 }
 
 void notifyDidPaint(InstanceData* instanceData)
 {
   ++instanceData->paintCount;
--- a/dom/plugins/test/testplugin/nptest.h
+++ b/dom/plugins/test/testplugin/nptest.h
@@ -57,22 +57,16 @@ typedef enum {
   FUNCTION_NPP_NEWSTREAM,
   FUNCTION_NPP_WRITEREADY,
   FUNCTION_NPP_WRITE,
   FUNCTION_NPP_DESTROYSTREAM,
   FUNCTION_NPP_WRITE_RPC
 } TestFunction;
 
 typedef enum {
-  AD_NONE,
-  AD_BITMAP,
-  AD_DXGI
-} AsyncDrawing;
-
-typedef enum {
   ACTIVATION_STATE_UNKNOWN,
   ACTIVATION_STATE_ACTIVATED,
   ACTIVATION_STATE_DEACTIVATED
 } ActivationState;
 
 typedef struct FunctionTable {
   TestFunction funcId;
   const char* funcName;
@@ -143,19 +137,16 @@ typedef struct InstanceData {
   ActivationState topLevelWindowActivationState;
   int32_t topLevelWindowActivationEventCount;
   ActivationState focusState;
   int32_t focusEventCount;
   int32_t eventModel;
   bool closeStream;
   std::string lastKeyText;
   bool wantsAllStreams;
-  AsyncDrawing asyncDrawing;
-  NPAsyncSurface *frontBuffer;
-  NPAsyncSurface *backBuffer;
   int32_t mouseUpEventCount;
   int32_t bugMode;
   std::string javaCodebase;
 } InstanceData;
 
 void notifyDidPaint(InstanceData* instanceData);
 
 #endif // nptest_h_
--- a/dom/plugins/test/testplugin/nptest_droid.cpp
+++ b/dom/plugins/test/testplugin/nptest_droid.cpp
@@ -44,22 +44,16 @@ pluginSupportsWindowMode()
 }
 
 bool
 pluginSupportsWindowlessMode()
 {
   return true;
 }
 
-bool
-pluginSupportsAsyncBitmapDrawing()
-{
-  return false;
-}
-
 NPError
 pluginInstanceInit(InstanceData* instanceData)
 {
   printf("NPERR_INCOMPATIBLE_VERSION_ERROR\n");
   return NPERR_INCOMPATIBLE_VERSION_ERROR;
 }
 
 void
--- a/dom/plugins/test/testplugin/nptest_gtk2.cpp
+++ b/dom/plugins/test/testplugin/nptest_gtk2.cpp
@@ -66,22 +66,16 @@ pluginSupportsWindowMode()
 }
 
 bool
 pluginSupportsWindowlessMode()
 {
   return true;
 }
 
-bool
-pluginSupportsAsyncBitmapDrawing()
-{
-  return false;
-}
-
 NPError
 pluginInstanceInit(InstanceData* instanceData)
 {
 #ifdef MOZ_X11
   instanceData->platformData = static_cast<PlatformData*>
     (NPN_MemAlloc(sizeof(PlatformData)));
   if (!instanceData->platformData)
     return NPERR_OUT_OF_MEMORY_ERROR;
--- a/dom/plugins/test/testplugin/nptest_macosx.mm
+++ b/dom/plugins/test/testplugin/nptest_macosx.mm
@@ -45,22 +45,16 @@ pluginSupportsWindowMode()
 }
 
 bool
 pluginSupportsWindowlessMode()
 {
   return true;
 }
 
-bool
-pluginSupportsAsyncBitmapDrawing()
-{
-  return false;
-}
-
 NPError
 pluginInstanceInit(InstanceData* instanceData)
 {
   NPP npp = instanceData->npp;
 
   NPBool supportsCoreGraphics = false;
   if ((NPN_GetValue(npp, NPNVsupportsCoreGraphicsBool, &supportsCoreGraphics) == NPERR_NO_ERROR) &&
       supportsCoreGraphics) {
--- a/dom/plugins/test/testplugin/nptest_platform.h
+++ b/dom/plugins/test/testplugin/nptest_platform.h
@@ -44,33 +44,16 @@ bool    pluginSupportsWindowMode();
 /**
  * Returns true if the plugin supports windowless mode. At least one of
  * "pluginSupportsWindowMode" and "pluginSupportsWindowlessMode" must
  * return true.
  */
 bool    pluginSupportsWindowlessMode();
 
 /**
- * Returns true if the plugin supports async bitmap drawing.
- */
-bool    pluginSupportsAsyncBitmapDrawing();
-
-/**
- * Returns true if the plugin supports DXGI bitmap drawing.
- */
-inline bool    pluginSupportsAsyncDXGIDrawing()
-{
-#ifdef XP_WIN
-  return true;
-#else
-  return false;
-#endif
-}
-
-/**
  * Initialize the plugin instance. Returning an error here will cause the
  * plugin instantiation to fail.
  */
 NPError pluginInstanceInit(InstanceData* instanceData);
 
 /**
  * Shutdown the plugin instance.
  */
@@ -88,20 +71,16 @@ void    pluginDoSetWindow(InstanceData* 
 void    pluginWidgetInit(InstanceData* instanceData, void* oldWindow);
 
 /**
  * Handle an event for a windowless plugin. (Windowed plugins are
  * responsible for listening for their own events.)
  */
 int16_t pluginHandleEvent(InstanceData* instanceData, void* event);
 
-#ifdef XP_WIN
-void    pluginDrawAsyncDxgiColor(InstanceData* instanceData);
-#endif
-
 enum RectEdge {
   EDGE_LEFT = 0,
   EDGE_TOP = 1,
   EDGE_RIGHT = 2,
   EDGE_BOTTOM = 3
 };
 
 enum {
--- a/dom/plugins/test/testplugin/nptest_qt.cpp
+++ b/dom/plugins/test/testplugin/nptest_qt.cpp
@@ -42,22 +42,16 @@ pluginSupportsWindowMode()
 }
 
 bool
 pluginSupportsWindowlessMode()
 {
   return true;
 }
 
-bool
-pluginSupportsAsyncBitmapDrawing()
-{
-  return false;
-}
-
 NPError
 pluginInstanceInit(InstanceData* instanceData)
 {
   printf("NPERR_INCOMPATIBLE_VERSION_ERROR\n");
   return NPERR_INCOMPATIBLE_VERSION_ERROR;
 }
 
 void
--- a/dom/plugins/test/testplugin/nptest_windows.cpp
+++ b/dom/plugins/test/testplugin/nptest_windows.cpp
@@ -60,22 +60,16 @@ pluginSupportsWindowMode()
 }
 
 bool
 pluginSupportsWindowlessMode()
 {
   return true;
 }
 
-bool
-pluginSupportsAsyncBitmapDrawing()
-{
-  return true;
-}
-
 NPError
 pluginInstanceInit(InstanceData* instanceData)
 {
   NPP npp = instanceData->npp;
 
   instanceData->platformData = static_cast<PlatformData*>
     (NPN_MemAlloc(sizeof(PlatformData)));
   if (!instanceData->platformData)
@@ -100,128 +94,20 @@ pluginInstanceShutdown(InstanceData* ins
   }
   if (pd->device) {
     pd->device->Release();
   }
   NPN_MemFree(instanceData->platformData);
   instanceData->platformData = 0;
 }
 
-static ID3D10Device1*
-getD3D10Device()
-{
-  ID3D10Device1 *device;
-    
-  HMODULE d3d10module = LoadLibraryA("d3d10_1.dll");
-  decltype(D3D10CreateDevice1)* createD3DDevice =
-      (decltype(D3D10CreateDevice1)*) GetProcAddress(d3d10module,
-                                                     "D3D10CreateDevice1");
-
-  if (createD3DDevice) {
-    HMODULE dxgiModule = LoadLibraryA("dxgi.dll");
-    decltype(CreateDXGIFactory1)* createDXGIFactory1 =
-        (decltype(CreateDXGIFactory1)*) GetProcAddress(dxgiModule,
-                                                       "CreateDXGIFactory1");
-
-    HRESULT hr;
-
-    // Try to use a DXGI 1.1 adapter in order to share resources
-    // across processes.
-    IDXGIAdapter1 *adapter1;
-    if (createDXGIFactory1) {
-      IDXGIFactory1 *factory1;
-      hr = createDXGIFactory1(__uuidof(IDXGIFactory1),
-                              (void**)&factory1);
-
-      if (FAILED(hr) || !factory1) {
-        // Uh-oh
-        return nullptr;
-      }
-
-      hr = factory1->EnumAdapters1(0, &adapter1);
-
-      if (SUCCEEDED(hr) && adapter1) {
-        hr = adapter1->CheckInterfaceSupport(__uuidof(ID3D10Device),
-                                             nullptr);
-        if (FAILED(hr)) {
-            adapter1 = nullptr;
-        }
-      }
-      factory1->Release();
-    }
-
-    hr = createD3DDevice(
-          adapter1, 
-          D3D10_DRIVER_TYPE_HARDWARE,
-          nullptr,
-          D3D10_CREATE_DEVICE_BGRA_SUPPORT |
-          D3D10_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS,
-          D3D10_FEATURE_LEVEL_10_0,
-          D3D10_1_SDK_VERSION,
-          &device);
-
-    adapter1->Release();
-  }
-
-  return device;
-}
-
 void
 pluginDoSetWindow(InstanceData* instanceData, NPWindow* newWindow)
 {
   instanceData->window = *newWindow;
-  NPP npp = instanceData->npp;
-
-  if (instanceData->asyncDrawing == AD_DXGI) {
-    if (instanceData->frontBuffer &&
-        instanceData->frontBuffer->size.width == newWindow->width &&
-        instanceData->frontBuffer->size.height == newWindow->height) {
-          return;
-    }
-    if (instanceData->frontBuffer) {
-      instanceData->platformData->frontBuffer->Release();
-      instanceData->platformData->frontBuffer = nullptr;
-      NPN_FinalizeAsyncSurface(npp, instanceData->frontBuffer);
-      NPN_MemFree(instanceData->frontBuffer);
-    }
-    if (instanceData->backBuffer) {
-      instanceData->platformData->backBuffer->Release();
-      instanceData->platformData->backBuffer = nullptr;
-      NPN_FinalizeAsyncSurface(npp, instanceData->backBuffer);
-      NPN_MemFree(instanceData->backBuffer);
-    }
-
-    if (!instanceData->platformData->device) {
-      instanceData->platformData->device = getD3D10Device();
-    }
-
-    ID3D10Device1 *dev = instanceData->platformData->device;
-
-    if (!dev) {
-      return;
-    }
-
-    instanceData->frontBuffer = (NPAsyncSurface*)NPN_MemAlloc(sizeof(NPAsyncSurface));
-    instanceData->backBuffer = (NPAsyncSurface*)NPN_MemAlloc(sizeof(NPAsyncSurface));
-
-    NPSize size;
-    size.width = newWindow->width;
-    size.height = newWindow->height;
-
-    memset(instanceData->frontBuffer, 0, sizeof(NPAsyncSurface));
-    memset(instanceData->backBuffer, 0, sizeof(NPAsyncSurface));
-
-    NPN_InitAsyncSurface(npp, &size, NPImageFormatBGRA32, nullptr, instanceData->frontBuffer);
-    NPN_InitAsyncSurface(npp, &size, NPImageFormatBGRA32, nullptr, instanceData->backBuffer);
-
-    dev->OpenSharedResource(instanceData->frontBuffer->sharedHandle, __uuidof(ID3D10Texture2D), (void**)&instanceData->platformData->frontBuffer);
-    dev->OpenSharedResource(instanceData->backBuffer->sharedHandle, __uuidof(ID3D10Texture2D), (void**)&instanceData->platformData->backBuffer);
-
-    pluginDrawAsyncDxgiColor(instanceData);
-  }
 }
 
 #define CHILD_WIDGET_SIZE 10
 
 void
 pluginWidgetInit(InstanceData* instanceData, void* oldWindow)
 {
   HWND hWnd = (HWND)instanceData->window.window;
@@ -700,50 +586,8 @@ void pluginDoInternalConsistencyCheck(In
     HWND hWnd = (HWND)instanceData->window.window;
     ::GetWindowRect(hWnd, &ourRect);
     checkEquals(childRect.left, ourRect.left, "Child widget left", error);
     checkEquals(childRect.top, ourRect.top, "Child widget top", error);
     checkEquals(childRect.right, childRect.left + CHILD_WIDGET_SIZE, "Child widget width", error);
     checkEquals(childRect.bottom, childRect.top + CHILD_WIDGET_SIZE, "Child widget height", error);
   }
 }
-
-void
-pluginDrawAsyncDxgiColor(InstanceData* id)
-{
-  PlatformData *pd = id->platformData;
-
-  ID3D10Device1 *dev = pd->device;
-
-  IDXGIKeyedMutex *mutex;
-  pd->backBuffer->QueryInterface(&mutex);
-
-  mutex->AcquireSync(0, INFINITE);
-  ID3D10RenderTargetView *rtView;
-  dev->CreateRenderTargetView(pd->backBuffer, nullptr, &rtView);
-
-  uint32_t rgba = id->scriptableObject->drawColor;
-
-  unsigned char subpixels[4];
-  subpixels[0] = rgba & 0xFF;
-  subpixels[1] = (rgba & 0xFF00) >> 8;
-  subpixels[2] = (rgba & 0xFF0000) >> 16;
-  subpixels[3] = (rgba & 0xFF000000) >> 24;
-
-  float color[4];
-  color[2] = float(subpixels[3] * subpixels[0]) / 0xFE01;
-  color[1] = float(subpixels[3] * subpixels[1]) / 0xFE01;
-  color[0] = float(subpixels[3] * subpixels[2]) / 0xFE01;
-  color[3] = float(subpixels[3]) / 0xFF;
-  dev->ClearRenderTargetView(rtView, color);
-  rtView->Release();
-
-  mutex->ReleaseSync(0);
-  mutex->Release();
-
-  NPN_SetCurrentAsyncSurface(id->npp, id->backBuffer, nullptr);
-  NPAsyncSurface *oldFront = id->frontBuffer;
-  id->frontBuffer = id->backBuffer;
-  id->backBuffer = oldFront;
-  ID3D10Texture2D *oldFrontT = pd->frontBuffer;
-  pd->frontBuffer = pd->backBuffer;
-  pd->backBuffer = oldFrontT;
-}